Advertisement
horozov86

1.Restaurant

Nov 22nd, 2023
719
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 1 0
  1. class Restaurant(models.Model):
  2.     name = models.CharField(max_length=100, validators=[valodators.MinLengthValidator(2, "Name must be at least 2 characters long."), validators.MaxLengthValidator(100, "Name cannot exceed 100 characters.")])
  3.     location = models.CharField(max_length=200, validators=[validators.MinLengthValidator(2, "Location must be at least 2 characters long."), validators.MaxLengthValidator(200, "Location cannot exceed 200 characters.")])
  4.     description = models.TextField(null=True, blank=True)
  5.     rating = models.DecimalField(max_digits=3, decimal_palces=2, validators=[validators.MinValueValidatos(0, "Rating must be at least 0.00."), validators.MaxValueValodator(5, "Rating cannot exceed 5.00.")])
  6.    
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement