jjbgf / eventbooking

Django webapp which allows to submit required date to attend an event.
GNU General Public License v2.0
0 stars 0 forks source link

Add predefined choices for fields like "Bundesland", "Jugendgruppe", etc. #4

Closed numberpi closed 9 years ago

numberpi commented 9 years ago

Predefined values could be useful for:

Example:

class Student(models.Model):
    FRESHMAN = 'FR'
    SOPHOMORE = 'SO'
    JUNIOR = 'JR'
    SENIOR = 'SR'
    YEAR_IN_SCHOOL_CHOICES = (
        (FRESHMAN, 'Freshman'),
        (SOPHOMORE, 'Sophomore'),
        (JUNIOR, 'Junior'),
        (SENIOR, 'Senior'),
    )
    year_in_school = models.CharField(max_length=2,
                                      choices=YEAR_IN_SCHOOL_CHOICES,
                                      default=FRESHMAN)
numberpi commented 9 years ago

There is already an app providing "Bundesländer", have a look:

https://django-localflavor.readthedocs.org/en/latest/localflavor/de/

samuelstein commented 9 years ago

looks promising