from django.db import models
+from django.contrib.auth.models import User
# Create your models here.
class Event(models.Model):
('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)
+ person = models.ForeignKey(User, edit_inline=models.STACKED, num_in_admin=3)
event = models.ForeignKey(Event, core=True)
+++ /dev/null
-#from django.template import Context, loader
-#from django.http import HttpResponse
-from ee.events.models import Event
-from django.shortcuts import render_to_response
-from django.http import Http404
-
-
-
-def detail(request, event_id):
- try:
- event = Event.objects.get(id=event_id)
- #t = loader.get_template('events/event/detail.html')
- #c = Context({
- # 'event' : event,
- #})
- #return HttpResponse(t.render(c))
- return render_to_response('events/event/detail.html', {'event' : event})
- except Event.DoesNotExist:
- raise Http404
-
-def regs(request, event_id):
- pass
- #return HttpResponse('')