drf-appkit 1.4.4__tar.gz → 1.4.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {drf-appkit-1.4.4/drf_appkit.egg-info → drf_appkit-1.4.6}/PKG-INFO +1 -1
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/serializers.py +4 -1
- drf_appkit-1.4.6/appkit/migrations/0024_place_city_place_country_place_postal_code_and_more.py +33 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/models.py +8 -11
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/transformers.py +16 -1
- {drf-appkit-1.4.4 → drf_appkit-1.4.6/drf_appkit.egg-info}/PKG-INFO +1 -1
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/drf_appkit.egg-info/SOURCES.txt +1 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/setup.cfg +1 -1
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/LICENSE +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/MANIFEST.in +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/README.md +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/filters.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/mixins.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/pagination.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/relations.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/renderers.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/tests.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/api/views.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/apps.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/auth/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/auth/backends.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/auth/decorators.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/auth/email.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/auth/permissions.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/debug.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/adapters.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/authentication.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/backends.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/endpoints.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/exceptions.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/fields.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/filters.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/mixins.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/permissions.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf/serializers.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf_appkit.egg-info/PKG-INFO +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf_appkit.egg-info/SOURCES.txt +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf_appkit.egg-info/dependency_links.txt +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/drf_appkit.egg-info/top_level.txt +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/forms/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/forms/widgets.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/handlers.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/jinja2/appkit/forms/widgets/money_widget.html +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/managers.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0001_initial.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0002_arrangement_tags.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0003_auto_20210221_0852.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0004_auto_20210309_0655.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0005_auto_20210324_1046.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0006_sitealias.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0007_auto_20211021_1901.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0008_update_autofields.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0009_alter_arrangement_unique_together_and_more.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0010_arrangement_name.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0011_alter_sitealias_options.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0012_alter_sitealias_site.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0013_usergroup.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0014_remove_note_notes_note_content_type_note_object_id.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0015_alter_note_content_type_alter_note_object_id.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0016_alter_arrangementitem_unique_together_and_more.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0017_alter_imageattachment_image.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0018_place_geoposition.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0019_alter_place_geoposition.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0020_remove_arrangement_type_arrangement_content_type.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0021_rename_content_type_arrangement_item_type.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0022_imageattachment_rendition_key_imageattachment_warm.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/0023_delete_usergroup.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/migrations/__init__.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/notification.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/settings.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/shortcuts.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/storages.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/tasks.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/tests.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/util.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/appkit/views.py +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/drf_appkit.egg-info/dependency_links.txt +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/drf_appkit.egg-info/top_level.txt +0 -0
- {drf-appkit-1.4.4 → drf_appkit-1.4.6}/setup.py +0 -0
|
@@ -139,7 +139,10 @@ class PlaceSerializer(serializers.ModelSerializer):
|
|
|
139
139
|
|
|
140
140
|
class Meta:
|
|
141
141
|
model = Place
|
|
142
|
-
fields = (
|
|
142
|
+
fields = (
|
|
143
|
+
'place_id', 'info',
|
|
144
|
+
'city', 'state', 'country', 'postal_code',
|
|
145
|
+
)
|
|
143
146
|
|
|
144
147
|
|
|
145
148
|
class RegionSerializer(serializers.HyperlinkedModelSerializer):
|
drf_appkit-1.4.6/appkit/migrations/0024_place_city_place_country_place_postal_code_and_more.py
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Generated by Django 4.2.11 on 2024-04-14 14:48
|
|
2
|
+
|
|
3
|
+
from django.db import migrations, models
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class Migration(migrations.Migration):
|
|
7
|
+
|
|
8
|
+
dependencies = [
|
|
9
|
+
('appkit', '0023_delete_usergroup'),
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
operations = [
|
|
13
|
+
migrations.AddField(
|
|
14
|
+
model_name='place',
|
|
15
|
+
name='city',
|
|
16
|
+
field=models.CharField(blank=True, max_length=50),
|
|
17
|
+
),
|
|
18
|
+
migrations.AddField(
|
|
19
|
+
model_name='place',
|
|
20
|
+
name='country',
|
|
21
|
+
field=models.CharField(blank=True, max_length=30),
|
|
22
|
+
),
|
|
23
|
+
migrations.AddField(
|
|
24
|
+
model_name='place',
|
|
25
|
+
name='postal_code',
|
|
26
|
+
field=models.CharField(blank=True, max_length=7),
|
|
27
|
+
),
|
|
28
|
+
migrations.AddField(
|
|
29
|
+
model_name='place',
|
|
30
|
+
name='state',
|
|
31
|
+
field=models.CharField(blank=True, max_length=2),
|
|
32
|
+
),
|
|
33
|
+
]
|
|
@@ -167,7 +167,12 @@ class ModelBase(models.Model):
|
|
|
167
167
|
class Place(ModelBase):
|
|
168
168
|
place_id = models.CharField(max_length=255, unique=True)
|
|
169
169
|
geoposition = PointField(geography=True)
|
|
170
|
+
|
|
170
171
|
info = models.JSONField()
|
|
172
|
+
city = models.CharField(max_length=50, blank=True)
|
|
173
|
+
state = models.CharField(max_length=2, blank=True)
|
|
174
|
+
country = models.CharField(max_length=30, blank=True)
|
|
175
|
+
postal_code = models.CharField(max_length=7, blank=True)
|
|
171
176
|
|
|
172
177
|
def __str__(self):
|
|
173
178
|
if 'formatted_address' in self.info:
|
|
@@ -175,17 +180,9 @@ class Place(ModelBase):
|
|
|
175
180
|
return self.place_id
|
|
176
181
|
|
|
177
182
|
@property
|
|
178
|
-
def
|
|
179
|
-
formatted_address = self.info.get('formatted_address')
|
|
180
|
-
|
|
181
|
-
try:
|
|
182
|
-
# ASSUME: address is of the form: <city>, <state>, <country>
|
|
183
|
-
# and <state> is exactly two characters
|
|
184
|
-
return formatted_address[0:formatted_address.index(',') + 4]
|
|
185
|
-
except ValueError:
|
|
186
|
-
return None
|
|
187
|
-
|
|
188
|
-
return None
|
|
183
|
+
def address_parts(self):
|
|
184
|
+
formatted_address = self.info.get('formatted_address', '')
|
|
185
|
+
return formatted_address.split(', ')
|
|
189
186
|
|
|
190
187
|
|
|
191
188
|
class Region(MP_Node):
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
from django.db.models.fields import BLANK_CHOICE_DASH
|
|
2
|
+
|
|
3
|
+
|
|
1
4
|
def img_src(image_attachment, size):
|
|
2
5
|
image = image_attachment.image
|
|
3
6
|
|
|
@@ -10,7 +13,19 @@ def img_src(image_attachment, size):
|
|
|
10
13
|
return image.url
|
|
11
14
|
|
|
12
15
|
|
|
13
|
-
def to_choices(
|
|
16
|
+
def to_choices(values, key=None, include_blank=True):
|
|
17
|
+
choices = [(
|
|
18
|
+
value[key] if key else value,
|
|
19
|
+
value
|
|
20
|
+
) for value in values]
|
|
21
|
+
|
|
22
|
+
if include_blank:
|
|
23
|
+
choices.insert(0, ("", "---------"))
|
|
24
|
+
|
|
25
|
+
return choices
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def to_choice_info_list(choice_list, nullable=False):
|
|
14
29
|
choices = []
|
|
15
30
|
for item in choice_list:
|
|
16
31
|
if isinstance(item, tuple):
|
|
@@ -73,6 +73,7 @@ appkit/migrations/0020_remove_arrangement_type_arrangement_content_type.py
|
|
|
73
73
|
appkit/migrations/0021_rename_content_type_arrangement_item_type.py
|
|
74
74
|
appkit/migrations/0022_imageattachment_rendition_key_imageattachment_warm.py
|
|
75
75
|
appkit/migrations/0023_delete_usergroup.py
|
|
76
|
+
appkit/migrations/0024_place_city_place_country_place_postal_code_and_more.py
|
|
76
77
|
appkit/migrations/__init__.py
|
|
77
78
|
drf_appkit.egg-info/PKG-INFO
|
|
78
79
|
drf_appkit.egg-info/SOURCES.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|