From 323aa6a686264cdb64560bd5f67fca8dbb82b7cf Mon Sep 17 00:00:00 2001 From: sanj Date: Thu, 21 Oct 2010 18:51:01 +0200 Subject: [PATCH] erang order + added summary field --- itf/erang_organised/models.py | 1 + itf/erang_organised/views.py | 2 +- itf/itfcore/admin.py | 14 ++++++++++++++ itf/itfcore/models.py | 8 ++++---- itf/itfcore/views.py | 16 ++++++++++++++++ itf/urls.py | 3 +++ requirements.txt | 2 +- 7 files changed, 40 insertions(+), 6 deletions(-) diff --git a/itf/erang_organised/models.py b/itf/erang_organised/models.py index 21241e3..fc31266 100644 --- a/itf/erang_organised/models.py +++ b/itf/erang_organised/models.py @@ -2,6 +2,7 @@ from django.db import models class Issue(models.Model): title = models.CharField(max_length=255) + summary = models.TextField(blank=True, null=True) date = models.DateField() html = models.TextField(blank=True) diff --git a/itf/erang_organised/views.py b/itf/erang_organised/views.py index ab2899e..bbb25fc 100644 --- a/itf/erang_organised/views.py +++ b/itf/erang_organised/views.py @@ -7,7 +7,7 @@ from django.http import HttpResponse from django.core.mail import send_mail def home(request): - all_issues = Issue.objects.all().order_by('date') + all_issues = Issue.objects.all().order_by('-date') if request.GET.has_key('issue_id'): issue_id = request.GET.get('issue_id') else: diff --git a/itf/itfcore/admin.py b/itf/itfcore/admin.py index 786ae6a..3673236 100755 --- a/itf/itfcore/admin.py +++ b/itf/itfcore/admin.py @@ -1,6 +1,20 @@ from django.contrib import admin from django.contrib.auth.models import User from models import * + +class OccupationAdmin(admin.ModelAdmin): + model = Occupation + +class RelationAdmin(admin.ModelAdmin): + model = Relation + +class LanguageAdmin(admin.ModelAdmin): + model = Language + +admin.site.register(Occupation, OccupationAdmin) +admin.site.register(Relation, RelationAdmin) +admin.site.register(Language, LanguageAdmin) + ''' #class NicknameInline(admin.StackedInline): # model = Nickname diff --git a/itf/itfcore/models.py b/itf/itfcore/models.py index 19b6b9e..4bfbdb2 100644 --- a/itf/itfcore/models.py +++ b/itf/itfcore/models.py @@ -15,7 +15,7 @@ class Person(models.Model): #Basic Info user = models.ForeignKey(User, blank=True, null=True, db_index=True) first_name = models.CharField(max_length=255) - last_name = models.CharField(max_length=255, blank=True) + last_name = models.CharField(max_length=255) email = models.EmailField(blank=True, null=True, unique=True, db_index=True) tel_no = models.CharField(max_length=100, blank=True) about = models.TextField(blank=True, null=True) @@ -101,7 +101,7 @@ class PersonPerson(models.Model): person1 = models.ForeignKey(Person, related_name='PersonFrom', db_index=True) person2 = models.ForeignKey(Person, related_name='PersonTo', db_index=True) relation = models.ForeignKey("Relation") - approved = models.BooleanField(default=False) + disapproved = models.BooleanField(default=False) class Relation(models.Model): name = models.CharField(max_length=255, db_index=True) @@ -121,7 +121,7 @@ class Training(models.Model): person = models.ForeignKey("Person") area = models.CharField(max_length=255) # Choices? with_whom = models.CharField(max_length=255) # Is this a foreign key to person, or group, or just text field like now? - location = models.ForeignKey("Location") + where = models.ForeignKey("TheatreGroup") from_when = models.DateField(blank=True, null=True) until_when = models.DateField(blank=True, null=True) @@ -151,7 +151,7 @@ class PersonProduction(models.Model): original_cast = models.BooleanField(default=False) class TheatreGroup(models.Model): - name = models.CharField(max_length=255, db_index=True) + name = models.CharField(max_length=255, db_index=True) # name + location is unique city = models.CharField(max_length=255) location = models.ForeignKey(Location, blank=True, null=True) tel = models.IntegerField(blank=True, null=True) diff --git a/itf/itfcore/views.py b/itf/itfcore/views.py index e8d1cd2..3511eb9 100644 --- a/itf/itfcore/views.py +++ b/itf/itfcore/views.py @@ -4,6 +4,20 @@ from django.contrib import admin from settings import LANGUAGES import simplejson import sys +from forms import PersonForm, ConnectionFormset, ProductionFormset + +def edit_profile(request): + u = request.user + #Do stuff like check if user has a person instance and then instantiate form with that person instance. + personForm = PersonForm() + formsets = [ConnectionFormset(), ProductionFormset()] + return render_to_response("itfcore/edit_profile.html", { + 'personForm': personForm, + 'formsets': formsets + }) + +def profile(request, name): + return HttpResponse(name) def index(request): return HttpResponse("India Theatre Forum - Coming Soon") @@ -39,8 +53,10 @@ def resources(request): def erang(request): return render_to_response("x0erang.html") +''' def profile(request): return render_to_response("x0profile.html") +''' def googlehosted(request): return HttpResponse('googlefffffffffc014cb4') diff --git a/itf/urls.py b/itf/urls.py index f309fee..9556680 100644 --- a/itf/urls.py +++ b/itf/urls.py @@ -33,6 +33,9 @@ urlpatterns = patterns('', ('^getLanguages', 'itfcore.views.getLanguages'), # Uncomment the admin/doc line below and add 'django.contrib.admindocs' # to INSTALLED_APPS to enable admin documentation: + #Core views: +# (r'profile', 'itfcore.views.edit_profile'), + (r'i/', include('itfcore.urls')), (r'^admin/doc/', include('django.contrib.admindocs.urls')), (r'^mockup/', 'itfcore.views.mockup'), (r'x0news/', 'itfcore.views.allnews'), diff --git a/requirements.txt b/requirements.txt index a36dd0e..76840a3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ --e svn+http://code.djangoproject.com/svn/django/branches/releases/1.1.X/#egg=django +-e svn+http://code.djangoproject.com/svn/django/branches/releases/1.2.X/#egg=django -e bzr+http://code.0xdb.org/python-oxdjango/#egg=python-oxdjango -e svn+http://django-multilingual.googlecode.com/svn/trunk/#egg=multilingual -e bzr+http://firefogg.org/dev/python-firefogg/#egg=python-firefogg