12311k

Untitled

Mar 7th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from django.db import models
  2.  
  3. # Create your models here.
  4. GENRE_CHOICES = (
  5. ("R", "Рок"),
  6. ("E", "Электроника"),
  7. ("P", "Поп"),
  8. ("C", "Классика"),
  9. ("O", "Саундтреки"),
  10. )
  11.  
  12.  
  13. class CD(models.Model):
  14. title = models.CharField(max_length=100)
  15. description = models.TextField(null=True, blank=True)
  16. artist = models.CharField(max_length=40)
  17. genre = models.CharField(max_length=1, choices=GENRE_CHOICES)
  18.  
  19. def __repr__(self):
  20. return "Вот я такой кросавчик"
Add Comment
Please, Sign In to add comment