created, modified changes + erang css + script to update meeting dates

This commit is contained in:
Sanj 2012-02-02 15:49:45 +05:30
parent 30a6125e3b
commit 2db5425fe0
8 changed files with 55 additions and 10 deletions

View File

@ -10,6 +10,7 @@ from insidepages.models import ModuleTab, ModelExtra
from os.path import exists
from sorl.thumbnail import get_thumbnail
from django.template import RequestContext
import datetime
def splitSearch(string):
ret = []
@ -36,6 +37,17 @@ class ItfModel(models.Model):
hasComments = True
title_field = "title"
is_itf_model = True
changed = models.DateTimeField(null=True, editable=False)
created = models.DateTimeField(null=True, editable=False)
def save(self, *args, **kwargs):
''' On save, update timestamps '''
if not self.id:
self.created = datetime.datetime.today()
self.changed = datetime.datetime.today()
if self.created == None:
self.created = self.changed
super(ItfModel, self).save(*args, **kwargs)
class Meta:
abstract = True

View File

@ -38,6 +38,7 @@ class Meeting(ItfModel):
slug = models.SlugField()
fts_fields = ['title', 'intro']
def preview_dict(self):
return {
'id': self.id,

View File

@ -11,7 +11,7 @@ from django.core.mail import send_mail
class ContactForm(forms.Form):
name = forms.CharField(max_length=255)
email = forms.EmailField()
email = forms.CharField()
message = forms.CharField(widget=Textarea(attrs={'cols': 10, 'rows': 6}))
def save(self, fail_silently=False):

View File

@ -29,7 +29,7 @@ HAYSTACK_WHOOSH_PATH = join(PROJECT_PATH, "../whoosh/itf_index")
CKEDITOR_MEDIA_PREFIX = "/static/ckeditor/"
CKEDITOR_UPLOAD_PATH = join(PROJECT_PATH, "static/upload/images/")
AUTH_PROFILE_MODULE = "profiles.Person"
AUTH_PROFILE_MODULE = "itfprofiles.ItfProfile"
LOGIN_REDIRECT_URL = "/t/"
@ -41,12 +41,25 @@ INTERNAL_IPS = ('127.0.0.1',)
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
DATABASE_NAME = 'theatre' # Or path to database file if using sqlite3.
DATABASE_USER = 'root' # Not used with sqlite3.
DATABASE_PASSWORD = '' # Not used with sqlite3.
DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
#DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
#DATABASE_NAME = 'theatre' # Or path to database file if using sqlite3.
#DATABASE_USER = 'root' # Not used with sqlite3.
#DATABASE_PASSWORD = '' # Not used with sqlite3.
#DATABASE_HOST = '' # Set to empty string for localhost. Not used with sqlite3.
#DATABASE_PORT = '' # Set to empty string for default. Not used with sqlite3.
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'theatre', # Or path to database file if using sqlite3.
'USER': 'root', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
}
}
TWITTER_ID = "sachin_rt"
@ -160,6 +173,7 @@ INSTALLED_APPS = (
'scriptbank',
'bestpractices',
'emailer',
'itfprofiles',
'pages',
'tagging',
'app',

View File

@ -174,7 +174,12 @@ cursor: pointer;
font-family:"Century Gothic", Arial, Helvetica, sans-serif;
font-size:12px;
padding-right:12px;
float:right;
float:right;
}
.authorBio {
padding-left:8px;
padding-right:8px;
}
.articleImg {

View File

@ -17,4 +17,14 @@ def clean_participants():
d.delete()
print u
def add_meeting_dates():
for m in Meeting.objects.all():
dates = MeetingDay.objects.filter(meeting=m)
if len(dates) > 0:
date = dates[0].meeting_date
if not m.created:
m.created = date
if not m.changed:
m.changed = date
m.save()

View File

@ -4,6 +4,7 @@ import os
from os.path import join
from django.views.generic.simple import direct_to_template
# from django.auth.views import login, logout, register,
from itfprofiles.forms import ItfRegistrationForm
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
@ -31,6 +32,7 @@ urlpatterns = patterns('',
(r'jsdoc/', 'api.views.jsdoc'),
(r'site.json', 'app.views.site_json'),
(r'^itf/', include('festival.urls')),
# (r'^accounts/register/', 'registration.views.register', {'form_class': ItfRegistrationForm }),
(r'^accounts/', include('registration.urls')),
(r'^admin/', include(admin.site.urls)),
('^getLanguages', 'itfcore.views.getLanguages'),

View File

@ -4,9 +4,10 @@
-e bzr+http://firefogg.org/dev/python-firefogg/#egg=python-firefogg
-e bzr+http://firefogg.org/dev/django_firefogg/#egg=django_firefogg
-e hg+https://django-ajax-filtered-fields.googlecode.com/hg/#egg=django-ajax-filtered-fields
-e git://github.com/bit/django-extensions.git#egg=django_extensions
sorl-thumbnail
django-tagging
django-extensions
#django-extensions
django-debug-toolbar
South
django-ckeditor