Created
January 28, 2018 12:14
-
-
Save ridoansaleh/bec582b9af9839d4e72444bf6b9d44ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Song(models.Model): | |
genre_choices = ( | |
('Pop', 'Pop'), | |
('Reggae', 'Reggae'), | |
('Country', 'Country'), | |
('Jazz', 'Jazz'), | |
('Hip Hop', 'Hip Hop'), | |
('Rock', 'Rock'), | |
('R&B and Souls', 'R&B and Souls'), | |
('Dangdut', 'Dangdut'), | |
) | |
title = models.CharField(max_length=50) | |
genre = models.CharField(max_length=25, choices=genre_choices, default='Pop') | |
singer = models.CharField(max_length=50) | |
rating = models.PositiveIntegerField(default=1) | |
def __unicode__(self): | |
return self.title |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment