"""App settings for the django_owm app."""fromdjango.confimportsettingsfromdjango.dbimportmodelsDJANGO_OWM=getattr(settings,"DJANGO_OWM",{})# Example:# DJANGO_OWM = {# 'OWM_API_KEY': None, # Developer should provide their API key in settings.py# 'OWM_API_RATE_LIMITS': {# 'one_call': {# 'calls_per_minute': 60,# 'calls_per_month': 1000000,# },# # Future APIs will be added here# },# 'OWM_MODEL_MAPPINGS': { # Maps abstract model names to appname.ModelName# 'WeatherLocation': 'myapp.MyWeatherLocation',# 'CurrentWeather': 'myapp.MyCurrentWeather',# 'MinutelyWeather': 'myapp.MyMinutelyWeather',# 'HourlyWeather': 'myapp.MyHourlyWeather',# 'DailyWeather': 'myapp.MyDailyWeather',# 'WeatherAlert': 'myapp.MyWeatherAlert',# 'WeatherErrorLog': 'myapp.MyWeatherErrorLog',# 'APICallLog': 'myapp.MyAPICallLog',# },# 'OWM_BASE_MODEL': models.Model, # Base model for OWM models# 'OWM_USE_BUILTIN_ADMIN': True, # Use built-in admin for OWM models# 'OWM_USE_BUILTIN_CONCRETE_MODELS': False, # Use built-in concrete models# 'OWM_SHOW_MAP': False, # Show map in admin for AbstractWeatherLocation# 'OWM_USE_UUID': False, # Use UUIDs with OWM models# }
[docs]defget_base_model():"""Get the base model for OWM models."""classModel(models.Model):"""Simply provides a base model with a Meta class."""classMeta:"""Meta options for the base model."""abstract=Trueobjects=models.Manager()returnModel