From 17c4e95680e7d491c808fa06d1bad45dd743ccce Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 24 Jan 2008 12:58:48 +0100 Subject: [PATCH] * Replace all tabs with spaces. --- events/models.py | 46 ++++++++++++++-------------- influences/models.py | 72 ++++++++++++++++++++++---------------------- settings.py | 22 +++++++------- urls.py | 20 ++++++------ 4 files changed, 80 insertions(+), 80 deletions(-) diff --git a/events/models.py b/events/models.py index 58fd93a..eccab09 100644 --- a/events/models.py +++ b/events/models.py @@ -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) diff --git a/influences/models.py b/influences/models.py index ffc1f66..846410f 100644 --- a/influences/models.py +++ b/influences/models.py @@ -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") diff --git a/settings.py b/settings.py index d6b5299..7b4a4a6 100644 --- a/settings.py +++ b/settings.py @@ -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 ae9c60f..e7597b1 100644 --- 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\d+)/$', 'ee.events.views.event.detail'), - (r'^events/event/(?P\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\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\d+)/$', 'ee.events.views.event.detail'), + (r'^events/event/(?P\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\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: -- 2.30.2