@@ -46,31 +46,31 @@ def __str__(self):
4646 return self .code
4747
4848
49- class Location (models .Model ):
50- location = gis_models .PointField (srid = 4326 )
49+ class Tag (models .Model ):
5150 name = models .TextField ()
52- address = models .TextField ()
53- hours = models .ForeignKey (BusinessHours , on_delete = models .CASCADE )
54- location_type = models .ForeignKey (LocationType , on_delete = models .CASCADE )
55- price_category = models .CharField (max_length = 5 )
51+ tag_type = models .ForeignKey (TagType , on_delete = models .CASCADE )
52+ value = models .DecimalField (decimal_places = 1 , max_digits = 2 )
5653 created_datetime = models .DateTimeField (auto_now_add = True )
5754 modified_datetime = models .DateTimeField (auto_now = True )
5855
59- REQUIRED_FIELDS = ["location " , "location_type " , "created_datetime" , "modified_datetime" ]
56+ REQUIRED_FIELDS = ["name " , "tag_type" , "value " , "created_datetime" , "modified_datetime" ]
6057
6158 def __str__ (self ):
6259 return self .name
6360
6461
65- class Tag (models .Model ):
62+ class Location (models .Model ):
63+ location = gis_models .PointField (srid = 4326 )
6664 name = models .TextField ()
67- locations = models .ManyToManyField (Location , related_name = 'tags' )
68- tag_type = models .ForeignKey (TagType , on_delete = models .CASCADE )
69- value = models .DecimalField (decimal_places = 1 , max_digits = 2 )
65+ address = models .TextField ()
66+ hours = models .ManyToManyField (BusinessHours , related_name = 'locations' , blank = True )
67+ location_type = models .ForeignKey (LocationType , on_delete = models .CASCADE )
68+ tags = models .ManyToManyField (Tag , related_name = 'tags' )
69+ price_category = models .CharField (max_length = 5 )
7070 created_datetime = models .DateTimeField (auto_now_add = True )
7171 modified_datetime = models .DateTimeField (auto_now = True )
7272
73- REQUIRED_FIELDS = ["name " , "tag_type" , "value " , "created_datetime" , "modified_datetime" ]
73+ REQUIRED_FIELDS = ["location " , "location_type " , "created_datetime" , "modified_datetime" ]
7474
7575 def __str__ (self ):
7676 return self .name
0 commit comments