Orange County Lettings uses three Django models to represent its data:Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OpenClassrooms-Student-Center/Python-OC-Lettings-FR/llms.txt
Use this file to discover all available pages before exploring further.
Address, Letting, and Profile. Each model is defined in oc_lettings_site/models.py.
Address
Represents a physical postal address for a letting property.| Field | Type | Constraints |
|---|---|---|
number | PositiveIntegerField | Max value: 9999 |
street | CharField | Max length: 64 chars |
city | CharField | Max length: 64 chars |
state | CharField | Exactly 2 chars (US state code) |
zip_code | PositiveIntegerField | Max value: 99999 |
country_iso_code | CharField | Exactly 3 chars (ISO 3166-1 alpha-3 country code) |
__str__ returns "{number} {street}" — for example, "27 Old Lyme Road".
Letting
Represents an individual holiday home listing, linked to a singleAddress.
| Field | Type | Constraints |
|---|---|---|
title | CharField | Max length: 256 chars |
address | OneToOneField → Address | Deletes the letting when the linked address is deleted (CASCADE) |
__str__ returns the value of title.
The
OneToOneField on address means each Address record can only be associated with a single Letting. Deleting an Address automatically deletes its linked Letting.Profile
Extends Django’s built-inUser model with an optional favourite city preference.
| Field | Type | Constraints |
|---|---|---|
user | OneToOneField → django.contrib.auth.models.User | Deletes the profile when the linked user is deleted (CASCADE) |
favorite_city | CharField | Max length: 64 chars; optional (blank=True) |
__str__ returns self.user.username.
favorite_city is optional — blank=True means the field can be left empty when saving via a form. The column is still created in the database; it simply accepts an empty string.