mirror of
https://github.com/rjNemo/villafleurie
synced 2026-06-06 02:16:47 +00:00
* crete setting module to split prod and dev configs * fix calendar midmatch * lint imports using isort * doc: add doctrings
27 lines
804 B
Python
27 lines
804 B
Python
from django.db import models
|
|
|
|
from rental.models.booking import Booking
|
|
from rental.models.guest import Guest
|
|
|
|
|
|
class Testimonial(models.Model):
|
|
"""Testimonial represent a past customer testimony."""
|
|
|
|
class Meta:
|
|
verbose_name = "Témoignage"
|
|
|
|
def __str__(self):
|
|
return f"Témoignage de {self.author}"
|
|
|
|
author = models.CharField(max_length=200)
|
|
text = models.TextField(max_length=1000)
|
|
picture = models.ImageField(
|
|
max_length=200, upload_to='img/', null=True, blank=True
|
|
)
|
|
link = models.URLField(max_length=200, null=True, blank=True)
|
|
guest = models.OneToOneField(
|
|
Guest, on_delete=models.CASCADE, blank=True, null=True
|
|
)
|
|
reservation = models.OneToOneField(
|
|
Booking, on_delete=models.CASCADE, blank=True, null=True
|
|
)
|