Skip to main content

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.

The Lettings feature lets users browse every available holiday home and view the details of any individual property. From the listings index, visitors can see all available rentals at a glance; clicking a title takes them to a dedicated detail page showing the full postal address for that property.

Listings index

Route: GET /lettings/ The listings index page queries all Letting objects from the database and renders them as a clickable list. Each item in the list displays the property’s title and links to that letting’s detail page. If no lettings have been created yet, the page displays a “No lettings are available.” message instead of an empty list.

Letting detail page

Route: GET /lettings/<letting_id>/ The detail page fetches a single Letting by its integer id and renders the following information:
  • Title — the name of the property
  • Address — the full postal address, rendered across three lines:
    • number and street
    • city, state, and zip_code
    • country_iso_code

Data model

Address

Every letting is linked to exactly one Address record via a OneToOneField. The Address model stores the full postal details for a property:
class Address(models.Model):
    number = models.PositiveIntegerField(validators=[MaxValueValidator(9999)])
    street = models.CharField(max_length=64)
    city = models.CharField(max_length=64)
    state = models.CharField(max_length=2, validators=[MinLengthValidator(2)])
    zip_code = models.PositiveIntegerField(validators=[MaxValueValidator(99999)])
    country_iso_code = models.CharField(max_length=3, validators=[MinLengthValidator(3)])
FieldTypeConstraints
numberPositive integerMaximum value: 9999
streetStringMaximum length: 64 characters
cityStringMaximum length: 64 characters
stateStringExactly 2 characters
zip_codePositive integerMaximum value: 99999
country_iso_codeStringExactly 3 characters (ISO 3166-1)

Letting

The Letting model ties a human-readable title to an address:
class Letting(models.Model):
    title = models.CharField(max_length=256)
    address = models.OneToOneField(Address, on_delete=models.CASCADE)
Deleting a Letting also cascades to its linked Address record.

Explore other features

User profiles

Browse registered user profiles and their favorite city preferences.

Admin panel

Manage lettings, addresses, and profiles through the Django admin interface.

Build docs developers (and LLMs) love