-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add address parts as context variables in simple_tag - Rename `address` context variable to `fill_address`
- Loading branch information
Showing
4 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,7 +34,11 @@ def serialize_firm_info(queryset): | |
{ | ||
"email": "[email protected]", | ||
"phone": "003369856321", | ||
"address": "1 avenue Charles de Gaulle, 99999 Paris" | ||
"full_address": "1 avenue Charles de Gaulle, 99999 Paris France", | ||
"address": "1 avenue Charles de Gaulle", | ||
"postal_code": "99999", | ||
"city": "Paris", | ||
"country": "France", | ||
} | ||
``` | ||
""" | ||
|
@@ -45,7 +49,11 @@ def serialize_firm_info(queryset): | |
return { | ||
"email": firm_info.get("email"), | ||
"phone": firm_info.get("phone_number"), | ||
"address": _format_address(firm_info), | ||
"full_address": _format_address(firm_info), | ||
"address": firm_info.get("address"), | ||
"postal_code": firm_info.get("postal_code"), | ||
"city": firm_info.get("city"), | ||
"country": firm_info.get("country"), | ||
} | ||
except Exception as err: | ||
raise SerializeFirmError from err | ||
|
6 changes: 5 additions & 1 deletion
6
firm_info/templates/tests/templatetags/firm_info/test_firm_contact.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<p>Email: {{ email }}</p> | ||
<p>Phone: {{ phone }}</p> | ||
<p>Address: {{ address }}</p> | ||
<p>Full address: {{ full_address }}</p> | ||
<p>Address: {{ address }}</p> | ||
<p>city: {{ city }}</p> | ||
<p>postal code: {{ postal_code }}</p> | ||
<p>country: {{ country }}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,11 @@ def serialized_contact(): | |
return { | ||
"email": "[email protected]", | ||
"phone": "1234567890", | ||
"address": "1234 Main St, 12345 Anytown USA" | ||
'address': '1234 Main St', | ||
'city': 'Anytown', | ||
'country': 'USA', | ||
'full_address': '1234 Main St, 12345 Anytown USA', | ||
'postal_code': '12345', | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters