mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 23:11:08 -05:00
Add operators and property owners functionality
- Implemented OperatorListView and OperatorDetailView for managing operators. - Created corresponding templates for operator listing and detail views. - Added PropertyOwnerListView and PropertyOwnerDetailView for managing property owners. - Developed templates for property owner listing and detail views. - Established relationships between parks and operators, and parks and property owners in the models. - Created migrations to reflect the new relationships and fields in the database. - Added admin interfaces for PropertyOwner management. - Implemented tests for operators and property owners.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.utils import timezone
|
||||
from companies.models import Company
|
||||
from operators.models import Operator
|
||||
from parks.models import Park, ParkArea
|
||||
from location.models import Location
|
||||
from django.contrib.contenttypes.models import ContentType
|
||||
@@ -51,12 +51,12 @@ class Command(BaseCommand):
|
||||
|
||||
companies = {}
|
||||
for company_data in companies_data:
|
||||
company, created = Company.objects.get_or_create(
|
||||
operator, created = Operator.objects.get_or_create(
|
||||
name=company_data['name'],
|
||||
defaults=company_data
|
||||
)
|
||||
companies[company.name] = company
|
||||
self.stdout.write(f'{"Created" if created else "Found"} company: {company.name}')
|
||||
companies[operator.name] = operator
|
||||
self.stdout.write(f'{"Created" if created else "Found"} company: {operator.name}')
|
||||
|
||||
# Create parks with their locations
|
||||
parks_data = [
|
||||
|
||||
Reference in New Issue
Block a user