X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fprojects%2Fxerxes.git;a=blobdiff_plain;f=events%2Fmodels.py;h=6f0112893c860b877496e81a9c2aed21411eebe6;hp=eccab097b48f194e43a41f68ee2dfc5bdda0466f;hb=HEAD;hpb=17c4e95680e7d491c808fa06d1bad45dd743ccce diff --git a/events/models.py b/events/models.py index eccab09..6f01128 100644 --- a/events/models.py +++ b/events/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.contrib.auth.models import User # Create your models here. class Event(models.Model): @@ -12,24 +13,7 @@ class Event(models.Model): else: return self.name - class Admin: - fields = ( - (None, {'fields' : ('name', 'title')} ), - ('Registrations', {'fields' : ('slots',)} ), - ) - -class Person(models.Model): - first_name = models.CharField(max_length=255) - last_name = models.CharField(max_length=255) - - def __str__(self): - return self.first_name + ' ' + self.last_name - - class Admin: - list_display = ('first_name', 'last_name') - list_filter = ['last_name'] - search_fields = ['first_name', 'last_name'] - class Registration(models.Model): - person = models.ForeignKey(Person, edit_inline=models.STACKED, num_in_admin=3) - event = models.ForeignKey(Event, core=True) + person = models.ForeignKey(User) + event = models.ForeignKey(Event) +# vim: set sts=4 sw=4 expandtab: