Skip to content
Browse files

More work making the admin interface nicer.

  • Loading branch information...
1 parent f097321 commit 318a332600ebac0e03b7f1f65ff7edf14b3eb24d @mithro mithro committed Feb 8, 2012
Showing with 23 additions and 3 deletions.
  1. +2 −3 urls.py
  2. +21 −0 usergroup/models.py
View
5 urls.py
@@ -1,16 +1,15 @@
from django.conf.urls.defaults import patterns, url, include
-# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'',
# admin pages
- (r'^admin', include(admin.site.urls)),
+ (r'^admin/', include(admin.site.urls)),
# auth specific urls
- (r'^accounts', include('accounts.urls')),
+ (r'^accounts/', include('accounts.urls')),
# Our actual app
(r'^', include('usergroup.urls')),
)
View
21 usergroup/models.py
@@ -5,6 +5,7 @@
"""Module contains the models of objects used in the application."""
+from django.contrib import admin
from django.db import models
from django.contrib.auth.models import User
@@ -27,6 +28,10 @@ def __unicode__(self):
published_on = models.DateTimeField(
auto_now_add=True, blank=False)
+class AnnouncementAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(Announcement, AnnouncementAdmin)
+
class Event(models.Model):
"""An event."""
@@ -54,6 +59,10 @@ def __unicode__(self):
start = models.DateTimeField(blank=False)
end = models.DateTimeField(blank=False)
+class EventAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(Event, EventAdmin)
+
class TalkOffer(models.Model):
"""An lightning talk to be given at an event."""
@@ -73,6 +82,10 @@ def get_url(self):
minutes = models.IntegerField()
consent = models.BooleanField()
+class TalkOfferAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(TalkOffer, TalkOfferAdmin)
+
class LightningTalk(models.Model):
created_by = models.ForeignKey(User, blank=False, related_name='+')
@@ -84,6 +97,10 @@ class LightningTalk(models.Model):
event = models.ForeignKey(Event, blank=False,
related_name='agenda')
+class LightningTalkAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(LightningTalk, LightningTalkAdmin)
+
class Response(models.Model):
"""An RSVP to attend an event."""
@@ -102,3 +119,7 @@ class Response(models.Model):
guest = models.BooleanField(blank=False, default=False)
guest_name = models.TextField()
guest_email = models.EmailField()
+
+class ResponseAdmin(admin.ModelAdmin):
+ pass
+admin.site.register(Response, ResponseAdmin)

0 comments on commit 318a332

Please sign in to comment.
Something went wrong with that request. Please try again.