Added documentation for Address
This commit is contained in:
parent
2832c1696f
commit
2c9e0033ec
|
|
@ -17,7 +17,50 @@ from utils.permissions import (
|
|||
|
||||
# Address
|
||||
class AddressListCreateView(common.AddressViewMixin, generics.ListCreateAPIView):
|
||||
"""Create view for model Address."""
|
||||
"""
|
||||
## List/Create view
|
||||
### *GET*
|
||||
#### Description
|
||||
Get paginated list of addresses
|
||||
##### Response
|
||||
E.g.:
|
||||
```
|
||||
{
|
||||
"count": 58,
|
||||
"next": 2,
|
||||
"previous": null,
|
||||
"results": [
|
||||
{
|
||||
"id": 1,
|
||||
...
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
### *POST*
|
||||
#### Description
|
||||
Create a new address
|
||||
##### Request
|
||||
Required
|
||||
* latitude (`float`) - latitude
|
||||
* longitude (`float`) - longitude
|
||||
* city_id (`int`) - identifier of city
|
||||
|
||||
Available
|
||||
* district_name (`str`) - city district name
|
||||
* street_name_1 (`str`) - street name
|
||||
* street_name_2 (`str`) - street name (additional)
|
||||
* number (`int`) - city name
|
||||
* postal_code (`str`) - city postal code
|
||||
##### Response
|
||||
E.g.:
|
||||
```
|
||||
{
|
||||
"id": 1,
|
||||
...
|
||||
}
|
||||
```
|
||||
"""
|
||||
serializer_class = serializers.AddressDetailSerializer
|
||||
queryset = models.Address.objects.all()
|
||||
permission_classes = get_permission_classes(
|
||||
|
|
@ -28,7 +71,48 @@ class AddressListCreateView(common.AddressViewMixin, generics.ListCreateAPIView)
|
|||
|
||||
|
||||
class AddressRUDView(common.AddressViewMixin, generics.RetrieveUpdateDestroyAPIView):
|
||||
"""RUD view for model Address."""
|
||||
"""
|
||||
## Retrieve/Update/Destroy view
|
||||
### *GET*
|
||||
#### Description
|
||||
Return serialized object of an address by an identifier.
|
||||
##### Response
|
||||
E.g.:
|
||||
```
|
||||
{
|
||||
"id": 1,
|
||||
...
|
||||
}
|
||||
```
|
||||
### *PUT*/*PATCH*
|
||||
#### Description
|
||||
Completely/Partially update an address object by an identifier.
|
||||
##### Request
|
||||
Available
|
||||
* latitude (`float`) - latitude
|
||||
* longitude (`float`) - longitude
|
||||
* city_id (`int`) - identifier of city
|
||||
* district_name (`str`) - city district name
|
||||
* street_name_1 (`str`) - street name
|
||||
* street_name_2 (`str`) - street name (additional)
|
||||
* number (`int`) - city name
|
||||
* postal_code (`str`) - city postal code
|
||||
##### Response
|
||||
E.g.
|
||||
```
|
||||
{
|
||||
"id": 1,
|
||||
...
|
||||
}
|
||||
```
|
||||
### *DELETE*
|
||||
#### Description
|
||||
Delete an address object by an identifier.
|
||||
##### Response
|
||||
```
|
||||
No content
|
||||
```
|
||||
"""
|
||||
serializer_class = serializers.AddressDetailSerializer
|
||||
queryset = models.Address.objects.all()
|
||||
permission_classes = get_permission_classes(
|
||||
|
|
|
|||
|
|
@ -117,8 +117,8 @@ ELASTICSEARCH_DSL_AUTOSYNC = False
|
|||
# Email settings
|
||||
EMAIL_USE_TLS = True
|
||||
EMAIL_HOST = 'smtp.gmail.com'
|
||||
EMAIL_HOST_USER = 'anatolyfeteleu@gmail.com'
|
||||
EMAIL_HOST_PASSWORD = 'nggrlnbehzksgmbt'
|
||||
EMAIL_HOST_USER = 'dev.fr.test.gm.back.1@gmail.com'
|
||||
EMAIL_HOST_PASSWORD = 'onvwzsggdhdfqemi'
|
||||
EMAIL_PORT = 587
|
||||
|
||||
# ADD TRANSFER TO INSTALLED APPS
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user