* Replace all tabs with spaces.
authorMatthijs Kooijman <matthijs@stdin.nl>
Thu, 24 Jan 2008 11:58:48 +0000 (12:58 +0100)
committerMatthijs Kooijman <matthijs@stdin.nl>
Thu, 24 Jan 2008 11:58:48 +0000 (12:58 +0100)
events/models.py
influences/models.py
settings.py
urls.py

index 58fd93a93a3175fb3dbaee1984710fae6bec6693..eccab097b48f194e43a41f68ee2dfc5bdda0466f 100644 (file)
@@ -2,34 +2,34 @@ from django.db import models
 
 # Create your models here.
 class Event(models.Model):
-       name = models.CharField(max_length=50)
-       title = models.CharField(max_length=100)
-       slots = models.IntegerField()
+    name = models.CharField(max_length=50)
+    title = models.CharField(max_length=100)
+    slots = models.IntegerField()
 
-       def __str__(self):
-               if (self.title):
-                       return self.name + ' - ' + self.title
-               else:
-                       return self.name
+    def __str__(self):
+        if (self.title):
+            return self.name + ' - ' + self.title
+        else:
+            return self.name
 
-       class Admin:
-               fields = (
-                       (None,            {'fields' : ('name', 'title')} ),
-                       ('Registrations', {'fields' : ('slots',)} ),
-               )
+    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)
+    first_name = models.CharField(max_length=255)
+    last_name  = models.CharField(max_length=255)
 
-       def __str__(self):
-               return self.first_name + ' ' + self.last_name
+    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 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(Person, edit_inline=models.STACKED, num_in_admin=3)
+    event  = models.ForeignKey(Event, core=True)
index ffc1f66ff2ec2f5a4dc65f30e9c4e9984441bf50..846410f5cd2caf57daf2d7335fd58590cfb1896c 100644 (file)
@@ -4,45 +4,45 @@ from django.utils.translation import ugettext_lazy as _
 
 # Create your models here.
 class Character(models.Model):
-       created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
-       modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
-       name        = models.CharField(max_length=255, verbose_name = _("Name"))
-       player      = models.ForeignKey(User, verbose_name = _("Player"))
+    created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
+    modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
+    name        = models.CharField(max_length=255, verbose_name = _("Name"))
+    player      = models.ForeignKey(User, verbose_name = _("Player"))
 
-       def __str__(self):
-               return self.name
+    def __str__(self):
+        return self.name
 
-       class Admin:
-               pass
+    class Admin:
+        pass
 
-       class Meta:
-               verbose_name = _("Character")
-               verbose_name_plural = _("Characters")
+    class Meta:
+        verbose_name = _("Character")
+        verbose_name_plural = _("Characters")
 
 class Influence(models.Model):
-       STATUS_CHOICES = (
-               ('N', 'New'),
-               ('U', 'Under discussion'),
-               ('P', 'Processing'),
-               ('D', 'Done'),
-       )
-       created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
-       modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
-       
-       character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True, verbose_name = _("Character"))
-       contact     = models.CharField(max_length=255, verbose_name = _("Contact"))
-       description = models.TextField(verbose_name = _("Description"))
-       status      = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status"))
-       longterm    = models.BooleanField(default=False, verbose_name = _("Long term"))
-
-       def __str__(self):
-               return self.description[0:10]
-
-       class Admin:
-               list_filter=('character', 'status', 'longterm')
-               search_fields=('character', 'description', 'contact')
-
-       class Meta:
-               verbose_name = _("Influence")
-               verbose_name_plural = _("Influences")
+    STATUS_CHOICES = (
+        ('N', 'New'),
+        ('U', 'Under discussion'),
+        ('P', 'Processing'),
+        ('D', 'Done'),
+    )
+    created     = models.DateField(auto_now_add=1, verbose_name = _("Creation time"))
+    modified    = models.DateField(auto_now=1, verbose_name = _("Modification time"))
+    
+    character   = models.ForeignKey(Character, edit_inline=models.TABULAR, num_in_admin=3, core=True, verbose_name = _("Character"))
+    contact     = models.CharField(max_length=255, verbose_name = _("Contact"))
+    description = models.TextField(verbose_name = _("Description"))
+    status      = models.TextField(max_length=1, choices=STATUS_CHOICES, default='N', verbose_name = _("Status"))
+    longterm    = models.BooleanField(default=False, verbose_name = _("Long term"))
+
+    def __str__(self):
+        return self.description[0:10]
+
+    class Admin:
+        list_filter=('character', 'status', 'longterm')
+        search_fields=('character', 'description', 'contact')
+
+    class Meta:
+        verbose_name = _("Influence")
+        verbose_name_plural = _("Influences")
 
index d6b5299bb279839b7a178499df35ef512461f5ac..7b4a4a63e866d58761b783a8f22f2bb64ec5ae6e 100644 (file)
@@ -75,7 +75,7 @@ TEMPLATE_DIRS = (
     # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
     # Always use forward slashes, even on Windows.
     # Don't forget to use absolute paths, not relative paths.
-       '/home/matthijs/docs/src/django/ee/templates',
+    '/home/matthijs/docs/src/django/ee/templates',
 )
 
 INSTALLED_APPS = (
@@ -84,17 +84,17 @@ INSTALLED_APPS = (
     'django.contrib.sessions',
     'django.contrib.sites',
     'django.contrib.admin',
-       'ee.events',
-       'ee.influences',
-       'ee.base',
+    'ee.events',
+    'ee.influences',
+    'ee.base',
 )
 
 TEMPLATE_CONTEXT_PROCESSORS = (
-       "django.core.context_processors.auth",
-       "django.core.context_processors.debug",
-       "django.core.context_processors.i18n",
-       # Add STATIC_URL_PREFIX to the context
-       "ee.tools.context_processors.static",
+    "django.core.context_processors.auth",
+    "django.core.context_processors.debug",
+    "django.core.context_processors.i18n",
+    # Add STATIC_URL_PREFIX to the context
+    "ee.tools.context_processors.static",
 )
 
 LOGIN_URL = "/accounts/login/"
@@ -103,6 +103,6 @@ LOGIN_REDIRECT_URL = "/influences/"
 # Allow authentication against the phpb user accounts
 
 AUTHENTICATION_BACKENDS = (
-       'ee.auth.PhpBBBackend',
-       'django.contrib.auth.backends.ModelBackend',
+    'ee.auth.PhpBBBackend',
+    'django.contrib.auth.backends.ModelBackend',
 )
diff --git a/urls.py b/urls.py
index ae9c60fd24dce4c08c730a8416032122298b4873..e7597b1bf2cfe4874883d279edde56320c187b7d 100644 (file)
--- a/urls.py
+++ b/urls.py
@@ -3,20 +3,20 @@ from django.conf.urls.defaults import *
 from ee.influences.models import Character
 
 chars_dict = {
-       'queryset': Character.objects.all(),
+    'queryset': Character.objects.all(),
 }
  
 urlpatterns = patterns('',
     (r'^admin/', include('django.contrib.admin.urls')),
-       (r'^events/event/(?P<event_id>\d+)/$', 'ee.events.views.event.detail'),
-       (r'^events/event/(?P<event_id>\d+)/regs$', 'ee.events.views.event.regs'),
-       (r'^influences/add/(\d+)?/?$', 'ee.influences.views.add'),
-       (r'^influences/$', 'ee.influences.views.index'),
-       (r'^influences/character/$', 'django.views.generic.list_detail.object_list', chars_dict),
-       (r'^influences/character/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', chars_dict),
-       (r'^influences/character/add/$', 'ee.influences.views.addCharacter'),
-       (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}),
-       (r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'),
+    (r'^events/event/(?P<event_id>\d+)/$', 'ee.events.views.event.detail'),
+    (r'^events/event/(?P<event_id>\d+)/regs$', 'ee.events.views.event.regs'),
+    (r'^influences/add/(\d+)?/?$', 'ee.influences.views.add'),
+    (r'^influences/$', 'ee.influences.views.index'),
+    (r'^influences/character/$', 'django.views.generic.list_detail.object_list', chars_dict),
+    (r'^influences/character/(?P<object_id>\d+)/$', 'django.views.generic.list_detail.object_detail', chars_dict),
+    (r'^influences/character/add/$', 'ee.influences.views.addCharacter'),
+    (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'base/login.html'}),
+    (r'^accounts/logout/$', 'django.contrib.auth.views.logout_then_login'),
 )
 
 if settings.DEBUG: