Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Restaurant(models.Model):
- 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.")])
- 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.")])
- description = models.TextField(null=True, blank=True)
- 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.")])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement