Skip to content

Commit

Permalink
Fix minor formatting and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklinke committed Oct 12, 2024
1 parent a8ea11f commit ac4e80c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,3 @@ services:
ports:
- "8111:8111"
command: /start

40 changes: 20 additions & 20 deletions docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@ These models are all abstract, allowing developers to customize their own concre

The app provides several management commands to interact with the weather data models:

- **create\_location**: Creates a new weather location.
- **create_location**: Creates a new weather location.

- **Input Parameters**:
- **name** (str): The name of the location.
- **latitude** (float): The latitude of the location.
- **longitude** (float): The longitude of the location.
- **timezone** (str, optional): The timezone of the location.

- **delete\_location**: Deletes a specified weather location.
- **delete_location**: Deletes a specified weather location.

- **Input Parameters**:
- **location\_id** (int or UUID): The ID of the location to delete.
- **location_id** (int or UUID): The ID of the location to delete.

- **list\_locations**: Lists all weather locations stored in the database.
- **list_locations**: Lists all weather locations stored in the database.

- **Input Parameters**: None.

- **manual\_weather\_fetch**: Manually fetches weather data for a specific location.
- **manual_weather_fetch**: Manually fetches weather data for a specific location.

- **Input Parameters**:
- **location\_id** (int or UUID): The ID of the location for which to fetch weather data.
- **location_id** (int or UUID): The ID of the location for which to fetch weather data.

These commands help developers easily manage the locations for which weather data is collected.

Expand All @@ -57,13 +57,13 @@ The `utils` module provides various utility functions to interact with the OpenW

The settings for the `django-owm` app are defined in `app_settings.py`, allowing flexibility for customization:

- **OWM\_API\_KEY** (default: `None`): A string representing the API key used to make requests to OpenWeatherMap. This key is required for the app to function properly, as it authorizes API requests.
- **OWM_API_KEY** (default: `None`): A string representing the API key used to make requests to OpenWeatherMap. This key is required for the app to function properly, as it authorizes API requests.

- **Type**: `str`
- **Example**: `OWM_API_KEY = "your_openweathermap_api_key_here"`
- **Why Set**: Developers need to provide their own API key to connect to the OpenWeatherMap API.

- **OWM\_API\_RATE\_LIMITS** (default: `{ "one_call": { "calls_per_minute": 60, "calls_per_month": 1000000 } }`): A dictionary defining the rate limits for the API calls, including calls per minute and per month. This helps manage API usage effectively.
- **OWM_API_RATE_LIMITS** (default: `{ "one_call": { "calls_per_minute": 60, "calls_per_month": 1000000 } }`): A dictionary defining the rate limits for the API calls, including calls per minute and per month. This helps manage API usage effectively.

- **Type**: `dict`
- **Example**:
Expand All @@ -77,7 +77,7 @@ The settings for the `django-owm` app are defined in `app_settings.py`, allowing
```
- **Why Set**: To ensure that the app respects the rate limits of the OpenWeatherMap API and prevents exceeding them, which could result in blocked access.

- **OWM\_MODEL\_MAPPINGS** (default: `{}`): A dictionary mapping abstract models to concrete model implementations in the developer's application. This setting allows developers to customize the data storage by specifying their own models. **Note: All models must be mapped in ********`OWM_MODEL_MAPPINGS`******** for the app to function correctly.**
- **OWM_MODEL_MAPPINGS** (default: `{}`): A dictionary mapping abstract models to concrete model implementations in the developer's application. This setting allows developers to customize the data storage by specifying their own models. **Note: All models must be mapped in **\*\*\***\*`OWM_MODEL_MAPPINGS`**\*\*\*\*\*\* for the app to function correctly.\*\*

- **Type**: `dict`
- **Example**:
Expand All @@ -95,13 +95,13 @@ The settings for the `django-owm` app are defined in `app_settings.py`, allowing
```
- **Why Set**: Developers must provide mappings for all abstract models to ensure the app's functionality. This allows them to extend or modify the behavior of default models to fit the specific requirements of their application.

- **OWM\_USE\_BUILTIN\_ADMIN** (default: `True`): A boolean that controls whether built-in Django admin views should be used for the models.
- **OWM_USE_BUILTIN_ADMIN** (default: `True`): A boolean that controls whether built-in Django admin views should be used for the models.

- **Type**: `bool`
- **Example**: `OWM_USE_BUILTIN_ADMIN = False`
- **Why Set**: If developers prefer to create custom admin interfaces for managing weather data, they can set this to `False` and override the default behavior.

- **OWM\_USE\_UUID** (default: `False`): A boolean that configures whether a `uuid` field should be added to the models for querying and data uniqueness.
- **OWM_USE_UUID** (default: `False`): A boolean that configures whether a `uuid` field should be added to the models for querying and data uniqueness.

- **Type**: `bool`
- **Example**: `OWM_USE_UUID = True`
Expand Down Expand Up @@ -139,15 +139,15 @@ These settings provide a flexible and extensible approach to managing the app's

The app provides several function-based views for displaying weather data:

- **list\_locations**: Displays a list of all weather locations.
- **create\_location**: Allows users to create a new weather location.
- **update\_location**: Allows users to update an existing location's details.
- **delete\_location**: Deletes a specified weather location.
- **weather\_detail**: Displays current weather details for a specified location.
- **weather\_history**: Displays historical weather data.
- **weather\_forecast**: Shows hourly and daily forecasts for a location.
- **weather\_alerts**: Displays any active weather alerts for a location.
- **weather\_errors**: Shows logged errors encountered when fetching data.
- **list_locations**: Displays a list of all weather locations.
- **create_location**: Allows users to create a new weather location.
- **update_location**: Allows users to update an existing location's details.
- **delete_location**: Deletes a specified weather location.
- **weather_detail**: Displays current weather details for a specified location.
- **weather_history**: Displays historical weather data.
- **weather_forecast**: Shows hourly and daily forecasts for a location.
- **weather_alerts**: Displays any active weather alerts for a location.
- **weather_errors**: Shows logged errors encountered when fetching data.

These views are designed to be easily customizable and integrate seamlessly with Django templates.

Expand Down
4 changes: 3 additions & 1 deletion example_project/example/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Generated by Django 4.2.16 on 2024-10-11 16:59

from django.db import migrations, models
import django.db.models.deletion
from django.db import migrations
from django.db import models

import src.django_owm.validators


Expand Down
4 changes: 0 additions & 4 deletions example_project/example/urls.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
"""URL configuration for example app."""

from django.urls import include
from django.urls import path


urlpatterns = []
1 change: 1 addition & 0 deletions example_project/example/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Views for the example app."""

0 comments on commit ac4e80c

Please sign in to comment.