Transport models Analyzing
Transport models Analyzing (English fallback)
Aug. 17, 2025
Posted by admin
Nhom |
Notes |
|
🌍 Transport Models - Detailed Field Analysis & Business Use
|
|
1. Country Model - Geographic Foundation Purpose: Foundation model for geographical organization and localization class Country(models.Model): name_en = models.CharField(max_length=100, verbose_name=_("English Name")) name_vi = models.CharField(max_length=100, blank=True, verbose_name=_("Vietnamese Name")) country_code = models.CharField(max_length=2, unique=True, help_text=_("ISO 3166-1 alpha-2 code")) Field Details:
Business Applications:
Localized content delivery |
|
2. City Model - Urban Transportation Hubs Purpose: Transportation centers within countries with timezone support class City(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='cities') timezone = models.CharField(max_length=50, blank=True, help_text="e.g. Asia/Ho_Chi_Minh") unique_together = ['name_en', 'country'] Field Details:
Business Applications:
Weather integration by timezone |
|
3. Airport Model - Aviation Infrastructure Purpose: Complete airport data with international aviation standards class Airport(models.Model): name_en = models.CharField(max_length=200, verbose_name="English Name") name_vi = models.CharField(max_length=200, blank=True, verbose_name="Vietnamese Name") iata_code = models.CharField(max_length=3, unique=True, help_text="3-letter IATA code (e.g. SGN)") icao_code = models.CharField(max_length=4, unique=True, help_text="4-letter ICAO code (e.g. VVTS)") city = models.ForeignKey(City, on_delete=models.CASCADE, related_name='airports') latitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) longitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
4. Airline Model - Carrier Information Purpose: Airline company data with branding and identification class Airline(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") iata_code = models.CharField(max_length=2, unique=True, help_text="2-letter IATA code (e.g. VN)") icao_code = models.CharField(max_length=3, unique=True, help_text="3-letter ICAO code (e.g. HVN)") country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='airlines') logo = models.ImageField(upload_to='airlines/', blank=True, null=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
5. Aircraft Model - Fleet Information Purpose: Aircraft specifications for capacity and service planning class Aircraft(models.Model): model = models.CharField(max_length=50, help_text="e.g. Boeing 777-300ER") manufacturer = models.CharField(max_length=50, help_text="e.g. Boeing, Airbus") capacity = models.PositiveIntegerField(default=0, help_text="Total passenger capacity") Field Details:
Business Applications:
|
|
6. Flight Model - Core Aviation Operations Purpose: Individual flight schedules with comprehensive operational data class Flight(models.Model): flight_number = models.CharField(max_length=20, help_text="e.g. VN151") airline = models.ForeignKey(Airline, on_delete=models.CASCADE, related_name='flights', null=True) aircraft = models.ForeignKey(Aircraft, on_delete=models.SET_NULL, null=True, blank=True)
origin_airport = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name='departing_flights', null=True) destination_airport = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name='arriving_flights', null=True)
departure_time = models.DateTimeField() arrival_time = models.DateTimeField() duration_minutes = models.PositiveIntegerField(default=0, help_text="Flight duration in minutes")
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='SCHEDULED') gate = models.CharField(max_length=10, blank=True, help_text="Departure gate") terminal = models.CharField(max_length=10, blank=True, help_text="Departure terminal")
# Pricing economy_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) business_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) first_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) Field Details: Flight Identification:
Aircraft Assignment:
Route Information:
Timing:
Operational Status:
Pricing Structure:
Business Applications:
|
|
7. TransportStation Model - Ground Transportation Hubs Purpose: Bus, train, ferry, and metro stations with multilingual support class TransportStation(models.Model): STATION_TYPES = [ ('BUS', 'Bus Station'), ('TRAIN', 'Train Station'), ('FERRY', 'Ferry Terminal'), ('METRO', 'Metro Station'), ]
name_en = models.CharField(max_length=200, verbose_name="English Name") name_vi = models.CharField(max_length=200, blank=True, verbose_name="Vietnamese Name") type = models.CharField(max_length=10, choices=STATION_TYPES) city = models.ForeignKey(City, on_delete=models.CASCADE, related_name='transport_stations') address_en = models.TextField(blank=True, verbose_name="English Address") address_vi = models.TextField(blank=True, verbose_name="Vietnamese Address") latitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) longitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
8. TransportOperator Model - Service Providers Purpose: Companies operating ground transportation services class TransportOperator(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") type = models.CharField(max_length=10, choices=TransportStation.STATION_TYPES) country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='transport_operators') website = models.URLField(blank=True) phone = models.CharField(max_length=20, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
9. Transit Model - Ground Transportation Schedules Purpose: Individual ground transportation schedules and services class Transit(models.Model): TRANSIT_TYPES = ( ('BUS', 'Bus'), ('TRAIN', 'Train'), ('FERRY', 'Ferry'), ('METRO', 'Metro'), ('CAR', 'Car Rental'), ('TAXI', 'Taxi'), ('OTHER', 'Other'), )
route_name = models.CharField(max_length=100, blank=True, help_text="e.g. Route 109, Express Line") type = models.CharField(max_length=10, choices=TRANSIT_TYPES) operator = models.ForeignKey(TransportOperator, on_delete=models.CASCADE, related_name='transits', null=True)
origin_station = models.ForeignKey(TransportStation, on_delete=models.CASCADE, related_name='departing_transits', null=True) destination_station = models.ForeignKey(TransportStation, on_delete=models.CASCADE, related_name='arriving_transits', null=True)
departure_time = models.DateTimeField() arrival_time = models.DateTimeField() duration_minutes = models.PositiveIntegerField(default=0, help_text="Transit duration in minutes")
# Pricing standard_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) premium_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True)
# Additional info vehicle_number = models.CharField(max_length=20, blank=True) platform = models.CharField(max_length=10, blank=True) notes_en = models.TextField(blank=True, verbose_name="English Notes") notes_vi = models.TextField(blank=True, verbose_name="Vietnamese Notes") Field Details: Service Identification:
Routing:
Timing:
Pricing:
Operational Details:
Business Applications:
|
|
🔄 Model Relationships & Business Flow Hierarchical Structure: Country ├── Cities │ ├── Airports → Airlines → Flights │ └── TransportStations → TransportOperators → Transits └── Airlines (country-based)
|
|
Business Integration Points:
This comprehensive transport system enables complete journey planning from flights to ground transportation, with full multilingual support and operational management capabilities.
|
Nhom |
Notes |
|
🌍 Transport Models - Detailed Field Analysis & Business Use
|
|
1. Country Model - Geographic Foundation Purpose: Foundation model for geographical organization and localization class Country(models.Model): name_en = models.CharField(max_length=100, verbose_name=_("English Name")) name_vi = models.CharField(max_length=100, blank=True, verbose_name=_("Vietnamese Name")) country_code = models.CharField(max_length=2, unique=True, help_text=_("ISO 3166-1 alpha-2 code")) Field Details:
Business Applications:
Localized content delivery |
|
2. City Model - Urban Transportation Hubs Purpose: Transportation centers within countries with timezone support class City(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='cities') timezone = models.CharField(max_length=50, blank=True, help_text="e.g. Asia/Ho_Chi_Minh") unique_together = ['name_en', 'country'] Field Details:
Business Applications:
Weather integration by timezone |
|
3. Airport Model - Aviation Infrastructure Purpose: Complete airport data with international aviation standards class Airport(models.Model): name_en = models.CharField(max_length=200, verbose_name="English Name") name_vi = models.CharField(max_length=200, blank=True, verbose_name="Vietnamese Name") iata_code = models.CharField(max_length=3, unique=True, help_text="3-letter IATA code (e.g. SGN)") icao_code = models.CharField(max_length=4, unique=True, help_text="4-letter ICAO code (e.g. VVTS)") city = models.ForeignKey(City, on_delete=models.CASCADE, related_name='airports') latitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) longitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
4. Airline Model - Carrier Information Purpose: Airline company data with branding and identification class Airline(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") iata_code = models.CharField(max_length=2, unique=True, help_text="2-letter IATA code (e.g. VN)") icao_code = models.CharField(max_length=3, unique=True, help_text="3-letter ICAO code (e.g. HVN)") country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='airlines') logo = models.ImageField(upload_to='airlines/', blank=True, null=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
5. Aircraft Model - Fleet Information Purpose: Aircraft specifications for capacity and service planning class Aircraft(models.Model): model = models.CharField(max_length=50, help_text="e.g. Boeing 777-300ER") manufacturer = models.CharField(max_length=50, help_text="e.g. Boeing, Airbus") capacity = models.PositiveIntegerField(default=0, help_text="Total passenger capacity") Field Details:
Business Applications:
|
|
6. Flight Model - Core Aviation Operations Purpose: Individual flight schedules with comprehensive operational data class Flight(models.Model): flight_number = models.CharField(max_length=20, help_text="e.g. VN151") airline = models.ForeignKey(Airline, on_delete=models.CASCADE, related_name='flights', null=True) aircraft = models.ForeignKey(Aircraft, on_delete=models.SET_NULL, null=True, blank=True)
origin_airport = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name='departing_flights', null=True) destination_airport = models.ForeignKey(Airport, on_delete=models.CASCADE, related_name='arriving_flights', null=True)
departure_time = models.DateTimeField() arrival_time = models.DateTimeField() duration_minutes = models.PositiveIntegerField(default=0, help_text="Flight duration in minutes")
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='SCHEDULED') gate = models.CharField(max_length=10, blank=True, help_text="Departure gate") terminal = models.CharField(max_length=10, blank=True, help_text="Departure terminal")
# Pricing economy_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) business_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) first_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) Field Details: Flight Identification:
Aircraft Assignment:
Route Information:
Timing:
Operational Status:
Pricing Structure:
Business Applications:
|
|
7. TransportStation Model - Ground Transportation Hubs Purpose: Bus, train, ferry, and metro stations with multilingual support class TransportStation(models.Model): STATION_TYPES = [ ('BUS', 'Bus Station'), ('TRAIN', 'Train Station'), ('FERRY', 'Ferry Terminal'), ('METRO', 'Metro Station'), ]
name_en = models.CharField(max_length=200, verbose_name="English Name") name_vi = models.CharField(max_length=200, blank=True, verbose_name="Vietnamese Name") type = models.CharField(max_length=10, choices=STATION_TYPES) city = models.ForeignKey(City, on_delete=models.CASCADE, related_name='transport_stations') address_en = models.TextField(blank=True, verbose_name="English Address") address_vi = models.TextField(blank=True, verbose_name="Vietnamese Address") latitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) longitude = models.DecimalField(max_digits=10, decimal_places=7, null=True, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
8. TransportOperator Model - Service Providers Purpose: Companies operating ground transportation services class TransportOperator(models.Model): name_en = models.CharField(max_length=100, verbose_name="English Name") name_vi = models.CharField(max_length=100, blank=True, verbose_name="Vietnamese Name") type = models.CharField(max_length=10, choices=TransportStation.STATION_TYPES) country = models.ForeignKey(Country, on_delete=models.CASCADE, related_name='transport_operators') website = models.URLField(blank=True) phone = models.CharField(max_length=20, blank=True) is_active = models.BooleanField(default=True) Field Details:
Business Applications:
|
|
9. Transit Model - Ground Transportation Schedules Purpose: Individual ground transportation schedules and services class Transit(models.Model): TRANSIT_TYPES = ( ('BUS', 'Bus'), ('TRAIN', 'Train'), ('FERRY', 'Ferry'), ('METRO', 'Metro'), ('CAR', 'Car Rental'), ('TAXI', 'Taxi'), ('OTHER', 'Other'), )
route_name = models.CharField(max_length=100, blank=True, help_text="e.g. Route 109, Express Line") type = models.CharField(max_length=10, choices=TRANSIT_TYPES) operator = models.ForeignKey(TransportOperator, on_delete=models.CASCADE, related_name='transits', null=True)
origin_station = models.ForeignKey(TransportStation, on_delete=models.CASCADE, related_name='departing_transits', null=True) destination_station = models.ForeignKey(TransportStation, on_delete=models.CASCADE, related_name='arriving_transits', null=True)
departure_time = models.DateTimeField() arrival_time = models.DateTimeField() duration_minutes = models.PositiveIntegerField(default=0, help_text="Transit duration in minutes")
# Pricing standard_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True) premium_price = models.DecimalField(max_digits=10, decimal_places=2, null=True, blank=True)
# Additional info vehicle_number = models.CharField(max_length=20, blank=True) platform = models.CharField(max_length=10, blank=True) notes_en = models.TextField(blank=True, verbose_name="English Notes") notes_vi = models.TextField(blank=True, verbose_name="Vietnamese Notes") Field Details: Service Identification:
Routing:
Timing:
Pricing:
Operational Details:
Business Applications:
|
|
🔄 Model Relationships & Business Flow Hierarchical Structure: Country ├── Cities │ ├── Airports → Airlines → Flights │ └── TransportStations → TransportOperators → Transits └── Airlines (country-based)
|
|
Business Integration Points:
This comprehensive transport system enables complete journey planning from flights to ground transportation, with full multilingual support and operational management capabilities.
|
Attached Files
You are viewing this article in public mode. Some features may be limited.