Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/models/weather.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from schematics.models import Model
from schematics.types import FloatType, GeoPointType, ModelType, StringType
from schematics.types.serializable import serializable
from unidecode import unidecode
from api.utils.metatypes import EnumMeta

class PhysicalQuantity(Model):
Expand Down Expand Up @@ -116,3 +117,7 @@ class Weather(Model):

class Options:
serialize_when_none = False

@serializable(type=StringType, serialized_name='id')
def id(self):
return unidecode(f'{self.city.name.upper()}')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At PassFort's team we use UUID. Please, take a look.