mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-22 12:11:14 -05:00
- Cleaned up and standardized assertions in ApiTestMixin for API response validation. - Updated ASGI settings to use os.environ for setting the DJANGO_SETTINGS_MODULE. - Removed unused imports and improved formatting in settings.py. - Refactored URL patterns in urls.py for better readability and organization. - Enhanced view functions in views.py for consistency and clarity. - Added .flake8 configuration for linting and style enforcement. - Introduced type stubs for django-environ to improve type checking with Pylance.
54 lines
1.9 KiB
Python
54 lines
1.9 KiB
Python
# Generated by Django 5.2.5 on 2025-08-16 17:42
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("contenttypes", "0002_remove_content_type_name"),
|
|
("location", "0001_initial"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.AddConstraint(
|
|
model_name="location",
|
|
constraint=models.CheckConstraint(
|
|
condition=models.Q(
|
|
("latitude__isnull", True),
|
|
models.Q(("latitude__gte", -90), ("latitude__lte", 90)),
|
|
_connector="OR",
|
|
),
|
|
name="location_latitude_range",
|
|
violation_error_message="Latitude must be between -90 and 90 degrees",
|
|
),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name="location",
|
|
constraint=models.CheckConstraint(
|
|
condition=models.Q(
|
|
("longitude__isnull", True),
|
|
models.Q(("longitude__gte", -180), ("longitude__lte", 180)),
|
|
_connector="OR",
|
|
),
|
|
name="location_longitude_range",
|
|
violation_error_message="Longitude must be between -180 and 180 degrees",
|
|
),
|
|
),
|
|
migrations.AddConstraint(
|
|
model_name="location",
|
|
constraint=models.CheckConstraint(
|
|
condition=models.Q(
|
|
models.Q(("latitude__isnull", True), ("longitude__isnull", True)),
|
|
models.Q(
|
|
("latitude__isnull", False),
|
|
("longitude__isnull", False),
|
|
),
|
|
_connector="OR",
|
|
),
|
|
name="location_coordinates_complete",
|
|
violation_error_message="Both latitude and longitude must be provided together",
|
|
),
|
|
),
|
|
]
|