Last active
August 29, 2015 14:06
-
-
Save karthikbgl/cdbab5b125a434bb90c1 to your computer and use it in GitHub Desktop.
Sunsigns models and create view using django
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
#models.py | |
CAPRICORN = 'Capricorn' | |
AQUARIUS = 'Aquarius' | |
PISCES = 'Pisces' | |
ARIES = 'Aries' | |
TAURUS = 'Taurus' | |
GEMINI = 'Gemini' | |
CANCER = 'Cancer' | |
LEO = 'Leo' | |
VIRGO = 'Virgo' | |
LIBRA = 'Libra' | |
SCORPIO = 'Scorpio' | |
SAGITTARIUS = 'Sagittarius' | |
SIGN_CHOICES = ( | |
(1, CAPRICORN, | |
2, AQUARIUS, | |
3, PISCES, | |
4, ARIES, | |
5, TAURUS, | |
6, GEMINI, | |
7, CANCER, | |
8, LEO, | |
9, VIRGO, | |
10, LIBRA, | |
11, SCORPIO, | |
12, SAGITTARIUS) | |
) | |
class Sign(models.Model): | |
signtype = models.CharField(choice=SIGN_CHOICES) | |
astro_date = models.DateField() | |
headline = models.CharField(max_length=255) | |
headcontent = models.TextField() | |
rating = RatingField() | |
misc = models.CharField(max_length=255) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment