verbose_name, help_text for forms, use HTML 5 widgets; change models - Training and Resource are now generic
This commit is contained in:
parent
75ec1aa0cc
commit
e7590216e3
|
@ -45,6 +45,21 @@ class AwardsForm(ItfForm):
|
||||||
|
|
||||||
AwardsInline = itf_inlineformset_factory(Award, form=AwardsForm, title="Awards", is_generic=True)
|
AwardsInline = itf_inlineformset_factory(Award, form=AwardsForm, title="Awards", is_generic=True)
|
||||||
|
|
||||||
|
class ResourcesForm(ItfForm):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Resource
|
||||||
|
|
||||||
|
ResourcesInline = itf_inlineformset_factory(Resource, form=ResourcesForm, title="Resources", is_generic=True)
|
||||||
|
|
||||||
|
|
||||||
|
class TrainingsForm(ItfForm):
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Training
|
||||||
|
|
||||||
|
TrainingsInline = itf_inlineformset_factory(Training, form=TrainingsForm, title='Training', is_generic=True)
|
||||||
|
|
||||||
|
|
||||||
class PadmaClipForm(ItfForm):
|
class PadmaClipForm(ItfForm):
|
||||||
pass
|
pass
|
||||||
|
@ -117,9 +132,9 @@ class PersonForm(ItfForm):
|
||||||
# occupations = forms.ModelMultipleChoiceField(Occupation.objects.all(), widget=forms.CheckboxSelectMultiple())
|
# occupations = forms.ModelMultipleChoiceField(Occupation.objects.all(), widget=forms.CheckboxSelectMultiple())
|
||||||
# connections = forms.ModelMultipleChoiceField(Person.objects.all(), widget=ConnectionsWidget())
|
# connections = forms.ModelMultipleChoiceField(Person.objects.all(), widget=ConnectionsWidget())
|
||||||
# occupations = forms.ModelMultipleChoiceField(Occupation.objects.all(), widget=forms.CheckboxSelectMultiple())
|
# occupations = forms.ModelMultipleChoiceField(Occupation.objects.all(), widget=forms.CheckboxSelectMultiple())
|
||||||
email = forms.EmailField(widget=forms.EmailInput(attrs={'placeholder': 'john@example.com'}))
|
email = forms.EmailField(widget=forms.EmailInput(attrs={'placeholder': 'example@email.com'}))
|
||||||
# inlines = [ConnectionsInline]
|
# inlines = [ConnectionsInline]
|
||||||
inlines = [ConnectionsInline, ProductionsInline, GroupsInline, BuzzItemsInline, AwardsInline, PersonOccupationsInline, PadmaClipsInline]
|
inlines = [PersonOccupationsInline, ConnectionsInline, ProductionsInline, GroupsInline, TrainingsInline, BuzzItemsInline, AwardsInline, ResourcesInline, PadmaClipsInline]
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
self.helper = FormHelper()
|
self.helper = FormHelper()
|
||||||
|
@ -134,6 +149,8 @@ class PersonForm(ItfForm):
|
||||||
widgets = {
|
widgets = {
|
||||||
'first_name': forms.TextInput,
|
'first_name': forms.TextInput,
|
||||||
'last_name': forms.TextInput,
|
'last_name': forms.TextInput,
|
||||||
|
'languages': forms.CheckboxSelectMultiple,
|
||||||
|
'dob': forms.DateInput
|
||||||
# 'occupations': forms.CheckboxSelectMultiple
|
# 'occupations': forms.CheckboxSelectMultiple
|
||||||
}
|
}
|
||||||
#exclude = ('connections', 'productions', 'occupations', 'groups',)
|
#exclude = ('connections', 'productions', 'occupations', 'groups',)
|
||||||
|
@ -159,7 +176,7 @@ GroupOccupationInline = itf_inlineformset_factory(TheatreGroup, GroupGroupOccupa
|
||||||
|
|
||||||
class TheatreGroupForm(ItfForm):
|
class TheatreGroupForm(ItfForm):
|
||||||
languages = forms.ModelMultipleChoiceField(Language.objects.all(), widget=forms.CheckboxSelectMultiple())
|
languages = forms.ModelMultipleChoiceField(Language.objects.all(), widget=forms.CheckboxSelectMultiple())
|
||||||
inlines = [GroupOccupationInline, PersonGroupInline, BuzzItemsInline, AwardsInline, LocationsInline]
|
inlines = [GroupOccupationInline, PersonGroupInline, ResourcesInline, BuzzItemsInline, AwardsInline, TrainingsInline, LocationsInline]
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = TheatreGroup
|
model = TheatreGroup
|
||||||
|
@ -177,7 +194,7 @@ class PersonProductionForm(ItfForm):
|
||||||
PersonProductionInline = itf_inlineformset_factory(Production, PersonProduction, form=PersonProductionForm, title="People associated with the production")
|
PersonProductionInline = itf_inlineformset_factory(Production, PersonProduction, form=PersonProductionForm, title="People associated with the production")
|
||||||
|
|
||||||
class ProductionForm(ItfForm):
|
class ProductionForm(ItfForm):
|
||||||
inlines = [PersonProductionInline]
|
inlines = [PersonProductionInline, AwardsInline]
|
||||||
script = forms.ModelChoiceField(Script.objects.all(), widget=AutocompleteAddWidget(model_class=Script))
|
script = forms.ModelChoiceField(Script.objects.all(), widget=AutocompleteAddWidget(model_class=Script))
|
||||||
director = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person))
|
director = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person))
|
||||||
playwright = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person))
|
playwright = forms.ModelChoiceField(Person.objects.all(), widget=AutocompleteAddWidget(model_class=Person))
|
||||||
|
|
|
@ -24,12 +24,13 @@ class Person(ItfModel):
|
||||||
first_name = models.CharField(max_length=255)
|
first_name = models.CharField(max_length=255)
|
||||||
last_name = models.CharField(max_length=255)
|
last_name = models.CharField(max_length=255)
|
||||||
email = models.EmailField(blank=True, null=True, unique=True, db_index=True)
|
email = models.EmailField(blank=True, null=True, unique=True, db_index=True)
|
||||||
tel_no = models.CharField(max_length=100, blank=True)
|
tel_no = models.CharField(max_length=100, blank=True, verbose_name='Telephone number')
|
||||||
about = models.TextField(blank=True, null=True)
|
is_practitioner = models.BooleanField(default=False, verbose_name='Are you a theatre practitioner?')
|
||||||
|
is_freelancer = models.BooleanField(default=False, verbose_name='Are you a theatre associate?') #Change to is_associate
|
||||||
|
is_enthusiast = models.BooleanField(default=True, verbose_name='Are you a theatre enthusiast?')
|
||||||
|
|
||||||
|
about = models.TextField(blank=True, null=True, verbose_name='About yourself')
|
||||||
dob = models.DateField(null=True, verbose_name="Date of Birth", blank=True)
|
dob = models.DateField(null=True, verbose_name="Date of Birth", blank=True)
|
||||||
is_practitioner = models.BooleanField(default=False)
|
|
||||||
is_enthusiast = models.BooleanField(default=True)
|
|
||||||
is_freelancer = models.BooleanField(default=False) #Change to is_associate
|
|
||||||
|
|
||||||
#Occupation info
|
#Occupation info
|
||||||
occupations = models.ManyToManyField("Occupation", through='PersonOccupation', blank=True, null=True)
|
occupations = models.ManyToManyField("Occupation", through='PersonOccupation', blank=True, null=True)
|
||||||
|
@ -43,7 +44,7 @@ class Person(ItfModel):
|
||||||
groups = models.ManyToManyField("TheatreGroup", blank=True, null=True, through='PersonGroup')
|
groups = models.ManyToManyField("TheatreGroup", blank=True, null=True, through='PersonGroup')
|
||||||
connections = models.ManyToManyField('Person', blank=True, null=True, through='PersonPerson')
|
connections = models.ManyToManyField('Person', blank=True, null=True, through='PersonPerson')
|
||||||
productions = models.ManyToManyField("Production", blank=True, null=True, through='PersonProduction')
|
productions = models.ManyToManyField("Production", blank=True, null=True, through='PersonProduction')
|
||||||
trainings = models.ManyToManyField("Training", blank=True, null=True, related_name="trainee")
|
trainings = generic.GenericRelation("Training", related_name='Trainee')
|
||||||
# awards = models.ManyToManyField("Award", blank=True, null=True)
|
# awards = models.ManyToManyField("Award", blank=True, null=True)
|
||||||
languages = models.ManyToManyField("Language", blank=True, null=True) #s added
|
languages = models.ManyToManyField("Language", blank=True, null=True) #s added
|
||||||
awards = generic.GenericRelation("Award")
|
awards = generic.GenericRelation("Award")
|
||||||
|
@ -220,6 +221,9 @@ class Training(models.Model):
|
||||||
from_when = models.DateField(blank=True, null=True)
|
from_when = models.DateField(blank=True, null=True)
|
||||||
until_when = models.DateField(blank=True, null=True)
|
until_when = models.DateField(blank=True, null=True)
|
||||||
locations = generic.GenericRelation("Location")
|
locations = generic.GenericRelation("Location")
|
||||||
|
content_type = models.ForeignKey(ContentType)
|
||||||
|
object_id = models.PositiveIntegerField()
|
||||||
|
content_object = generic.GenericForeignKey('content_type', 'object_id')
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.area
|
return self.area
|
||||||
|
@ -240,10 +244,10 @@ class TheatreGroup(ItfModel):
|
||||||
form_names = ['TheatreGroupForm', 'PopupGroupForm']
|
form_names = ['TheatreGroupForm', 'PopupGroupForm']
|
||||||
main_form = 'TheatreGroupForm'
|
main_form = 'TheatreGroupForm'
|
||||||
added_by = models.ForeignKey(User)
|
added_by = models.ForeignKey(User)
|
||||||
name = models.CharField(max_length=255, db_index=True) # name + location is unique
|
name = models.CharField(max_length=255, db_index=True, help_text='Name of theatre group') # name + location is unique
|
||||||
email = models.EmailField(blank=True, null=True)
|
email = models.EmailField(blank=True, null=True)
|
||||||
# location = models.ForeignKey(Location, blank=True, null=True, related_name="theatregroup_location")
|
# location = models.ForeignKey(Location, blank=True, null=True, related_name="theatregroup_location")
|
||||||
tel = models.IntegerField(blank=True, null=True)
|
tel = models.IntegerField(blank=True, null=True, verbose_name='Telephone number')
|
||||||
# -- FIXME tel = models.CharField(blank=True, null=True)
|
# -- FIXME tel = models.CharField(blank=True, null=True)
|
||||||
|
|
||||||
languages = models.ManyToManyField("Language", blank=True, null=True)
|
languages = models.ManyToManyField("Language", blank=True, null=True)
|
||||||
|
@ -252,7 +256,7 @@ class TheatreGroup(ItfModel):
|
||||||
awards = generic.GenericRelation("Award")
|
awards = generic.GenericRelation("Award")
|
||||||
buzzitems = generic.GenericRelation("BuzzItem")
|
buzzitems = generic.GenericRelation("BuzzItem")
|
||||||
website = models.URLField(blank=True, verify_exists=False)
|
website = models.URLField(blank=True, verify_exists=False)
|
||||||
resources = models.ManyToManyField("Resource", blank=True, null=True)
|
resources = generic.GenericRelation("Resource")
|
||||||
locations = generic.GenericRelation("Location")
|
locations = generic.GenericRelation("Location")
|
||||||
# albums = generic.GenericRelation(Album)
|
# albums = generic.GenericRelation(Album)
|
||||||
nature_of_work = models.ManyToManyField("GroupOccupation", blank=True, null=True, through="GroupGroupOccupation")
|
nature_of_work = models.ManyToManyField("GroupOccupation", blank=True, null=True, through="GroupGroupOccupation")
|
||||||
|
@ -260,8 +264,8 @@ class TheatreGroup(ItfModel):
|
||||||
|
|
||||||
about = models.TextField(blank=True, null=True)
|
about = models.TextField(blank=True, null=True)
|
||||||
#nature_of_work = models.CharField(max_length=255)
|
#nature_of_work = models.CharField(max_length=255)
|
||||||
founded = models.CharField(max_length=10)
|
# founded = models.CharField(max_length=10)
|
||||||
trainings = models.ManyToManyField("Training", blank=True, null=True)
|
trainings = generic.GenericRelation("Training")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -293,10 +297,12 @@ class TheatreGroup(ItfModel):
|
||||||
class Resource(models.Model):
|
class Resource(models.Model):
|
||||||
title = models.CharField(max_length=255, blank=True)
|
title = models.CharField(max_length=255, blank=True)
|
||||||
desc = models.TextField(max_length=10000, blank=True, null =True, help_text="Optional Description, 500 words or less")
|
desc = models.TextField(max_length=10000, blank=True, null =True, help_text="Optional Description, 500 words or less")
|
||||||
fil = models.FileField(upload_to='upload/docs', blank=True, null=True)
|
fil = models.FileField(upload_to='upload/docs', blank=True, null=True, verbose_name='File')
|
||||||
url = models.URLField(blank=True, null=True, verify_exists=True)
|
url = models.URLField(blank=True, null=True, verify_exists=True)
|
||||||
thumbnail= models.ImageField(upload_to='uploads/docs', blank=True, null=True)
|
thumbnail= models.ImageField(upload_to='uploads/docs', blank=True, null=True)
|
||||||
|
content_type = models.ForeignKey(ContentType)
|
||||||
|
object_id = models.PositiveIntegerField()
|
||||||
|
content_object = generic.GenericForeignKey('content_type', 'object_id')
|
||||||
|
|
||||||
from scriptbank.models import Script
|
from scriptbank.models import Script
|
||||||
|
|
||||||
|
@ -314,6 +320,7 @@ class Production(ItfModel):
|
||||||
director = models.ForeignKey(Person, related_name='productions_directed', blank=True, null=True)
|
director = models.ForeignKey(Person, related_name='productions_directed', blank=True, null=True)
|
||||||
playwright = models.ForeignKey(Person, related_name='productions_authored', blank=True, null=True)
|
playwright = models.ForeignKey(Person, related_name='productions_authored', blank=True, null=True)
|
||||||
anecdotes = models.TextField(blank=True)
|
anecdotes = models.TextField(blank=True)
|
||||||
|
awards = generic.GenericRelation("Award")
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -380,8 +387,8 @@ class GroupOccupation(models.Model):
|
||||||
|
|
||||||
class GroupGroupOccupation(models.Model):
|
class GroupGroupOccupation(models.Model):
|
||||||
theatregroup = models.ForeignKey("TheatreGroup")
|
theatregroup = models.ForeignKey("TheatreGroup")
|
||||||
groupoccupation = models.ForeignKey("GroupOccupation")
|
groupoccupation = models.ForeignKey("GroupOccupation", verbose_name="Occupation")
|
||||||
is_main = models.BooleanField(default=False)
|
is_main = models.BooleanField(default=False, verbose_name="Is this the group's main occupation?")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,30 @@
|
||||||
import floppyforms as forms
|
import floppyforms as forms
|
||||||
from models import Script
|
from models import Script
|
||||||
from app.forms import *
|
from app.forms import *
|
||||||
|
from itfprofiles.models import TheatreGroup
|
||||||
|
|
||||||
|
|
||||||
class ScriptForm(ItfForm):
|
class ScriptForm(ItfForm):
|
||||||
|
# no_characters = forms.IntegerField(widget=forms.NumberInput())
|
||||||
class Meta:
|
# no_of_women = forms.IntegerField(widget=forms.NumberInput())
|
||||||
model = Script
|
# approx_duration = forms.IntegerField(widget=forms.NumberInput())
|
||||||
exclude = ('added_by',)
|
# contact = forms.EmailField(widget=forms.EmailInput())
|
||||||
|
theatre_group = forms.ModelChoiceField(TheatreGroup.objects.all(), widget=AutocompleteAddWidget(model_class=TheatreGroup))
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
model = Script
|
||||||
|
exclude = ('added_by',)
|
||||||
|
widgets = {
|
||||||
|
'no_characters': forms.NumberInput,
|
||||||
|
'no_of_women': forms.NumberInput,
|
||||||
|
'approx_duration': forms.NumberInput,
|
||||||
|
'contact': forms.EmailInput
|
||||||
|
}
|
||||||
|
|
||||||
class PopupScriptForm(PopupForm):
|
class PopupScriptForm(PopupForm):
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = Script
|
model = Script
|
||||||
|
fields = ('title', 'synopsis',)
|
||||||
#fields = ('name', 'email',)
|
#fields = ('name', 'email',)
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ from app.models import ItfModel
|
||||||
from itfprofiles.models import TheatreGroup
|
from itfprofiles.models import TheatreGroup
|
||||||
|
|
||||||
GENRES = (
|
GENRES = (
|
||||||
('Fiction', 'Fiction'),
|
('Fiction', 'Fiction'),
|
||||||
('Comedy', 'Comedy'),
|
('Comedy', 'Comedy'),
|
||||||
)
|
)
|
||||||
|
|
||||||
LICENSE_TYPE_CHOICES = (
|
LICENSE_TYPE_CHOICES = (
|
||||||
|
@ -16,90 +16,65 @@ LICENSE_TYPE_CHOICES = (
|
||||||
)
|
)
|
||||||
|
|
||||||
LANGUAGE_CHOICES = (
|
LANGUAGE_CHOICES = (
|
||||||
('en', 'English'),
|
('en', 'English'),
|
||||||
('hi', 'Hindi'),
|
('hi', 'Hindi'),
|
||||||
('ma', 'Marathi'),
|
('ma', 'Marathi'),
|
||||||
('be', 'Bengali'),
|
('be', 'Bengali'),
|
||||||
)
|
)
|
||||||
|
|
||||||
class Script(ItfModel):
|
class Script(ItfModel):
|
||||||
added_by = models.ForeignKey(User)
|
added_by = models.ForeignKey(User)
|
||||||
form_names = ['ScriptForm', 'PopupScriptForm']
|
form_names = ['ScriptForm', 'PopupScriptForm']
|
||||||
main_form = 'ScriptForm'
|
main_form = 'ScriptForm'
|
||||||
title = models.CharField(max_length=255)
|
title = models.CharField(max_length=255, help_text="Title of the play")
|
||||||
synopsis = models.TextField(blank=True)
|
synopsis = models.TextField(blank=True)
|
||||||
no_characters = models.IntegerField(blank=True, null=True, help_text="Approximate number of characters")
|
no_characters = models.IntegerField(blank=True, null=True, verbose_name="No of characters", help_text="Approximate number of characters")
|
||||||
no_of_women = models.IntegerField(blank=True, null=True, help_text="How many characters are women?")
|
no_of_women = models.IntegerField(blank=True, null=True, help_text="How many characters are women?")
|
||||||
tags = TagField(blank=True)
|
tags = TagField(blank=True, help_text="Enter as many tags as you like, separated by commas")
|
||||||
production_notes = models.TextField(blank=True, help_text="Additional production notes")
|
production_notes = models.TextField(blank=True, help_text="Additional production notes")
|
||||||
language = models.CharField(max_length=32, choices=LANGUAGE_CHOICES)
|
language = models.CharField(max_length=32, choices=LANGUAGE_CHOICES)
|
||||||
approx_duration = models.IntegerField(blank=True, null=True, help_text="Approximate time, in minutes")
|
approx_duration = models.IntegerField(blank=True, null=True, verbose_name="Approximate duration", help_text="Approximate time, in minutes")
|
||||||
is_partial = models.BooleanField(default=False, help_text="Check this if you are uploading only a partial script")
|
author = models.CharField(max_length=255, help_text="Name of the author of the play")
|
||||||
author = models.CharField(max_length=255)
|
contact = models.EmailField()
|
||||||
contact = models.EmailField()
|
script = models.FileField(null=True, upload_to='upload/scripts/')
|
||||||
script = models.FileField(null=True, upload_to='upload/scripts/')
|
is_partial = models.BooleanField(default=False, verbose_name="Is this a partial script upload?", help_text="Check this if you are uploading only a partial script")
|
||||||
license_adapt = models.ForeignKey("License", related_name="adaptation_license", help_text="License for adaptation rights")
|
license_adapt = models.ForeignKey("License", related_name="adaptation_license", verbose_name="Adaptation License", help_text="License for adaptation rights")
|
||||||
license_perform = models.ForeignKey("License", related_name="performance_license", help_text="License for performance rights")
|
license_perform = models.ForeignKey("License", related_name="performance_license", verbose_name="Performance License", help_text="License for performance rights")
|
||||||
fts_fields = ['title', 'synopsis', 'author']
|
fts_fields = ['title', 'synopsis', 'author']
|
||||||
fk_fields = ['license_adapt', 'license_perform']
|
fk_fields = ['license_adapt', 'license_perform']
|
||||||
theatre_group = models.ForeignKey(TheatreGroup, help_text="Theatre Group, if any")
|
theatre_group = models.ForeignKey(TheatreGroup, help_text="Theatre Group, if any")
|
||||||
# add_form = 'ScriptForm'
|
# add_form = 'ScriptForm'
|
||||||
|
|
||||||
#Meta
|
#Meta
|
||||||
added = models.DateTimeField(auto_now_add=True)
|
added = models.DateTimeField(auto_now_add=True)
|
||||||
modified = models.DateTimeField(auto_now=True)
|
modified = models.DateTimeField(auto_now=True)
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
def list_dict(self):
|
def list_dict(self):
|
||||||
return {
|
return {
|
||||||
'id': self.id,
|
'id': self.id,
|
||||||
'title': self.title,
|
'title': self.title,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_dict(self):
|
def get_dict(self):
|
||||||
return {
|
return {
|
||||||
'title': self.title,
|
'title': self.title,
|
||||||
'synopsis': self.synopsis,
|
'synopsis': self.synopsis,
|
||||||
'no_characters': self.no_characters,
|
'no_characters': self.no_characters,
|
||||||
'no_of_women': self.no_of_women,
|
'no_of_women': self.no_of_women,
|
||||||
'production_notes': self.production_notes,
|
'production_notes': self.production_notes,
|
||||||
'language': self.language,
|
'language': self.language,
|
||||||
'approx_duration': self.approx_duration,
|
'approx_duration': self.approx_duration,
|
||||||
'is_partial': self.is_partial,
|
'is_partial': self.is_partial,
|
||||||
'author': self.author,
|
'author': self.author,
|
||||||
'contact': self.contact,
|
'contact': self.contact,
|
||||||
'script_file': self.script.url,
|
'script_file': self.script.url,
|
||||||
'license_adapt': self.license_adapt,
|
'license_adapt': self.license_adapt,
|
||||||
'license_perform': self.license_perform
|
'license_perform': self.license_perform
|
||||||
}
|
}
|
||||||
|
|
||||||
'''
|
|
||||||
@classmethod
|
|
||||||
def get_list(kls, data):
|
|
||||||
options = {
|
|
||||||
'page_no': 1,
|
|
||||||
'list_size': 8
|
|
||||||
}
|
|
||||||
options.update(data)
|
|
||||||
l = []
|
|
||||||
page_no = options['page_no']
|
|
||||||
list_size = options['list_size']
|
|
||||||
qset = kls.objects.all()
|
|
||||||
|
|
||||||
paginator = Paginator(qset, list_size)
|
|
||||||
try:
|
|
||||||
results = paginator.page(page_no)
|
|
||||||
except (EmptyPage, InvalidPage):
|
|
||||||
results = paginator.page(paginator.num_pages)
|
|
||||||
for r in results.object_list:
|
|
||||||
l.append({
|
|
||||||
'id': r.id,
|
|
||||||
'title': r.title
|
|
||||||
})
|
|
||||||
return l
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
28
migrations/sqldiff020812.sql
Normal file
28
migrations/sqldiff020812.sql
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
drop table itfprofiles_resource;
|
||||||
|
drop table itfprofiles_training;
|
||||||
|
|
||||||
|
CREATE TABLE `itfprofiles_resource` (
|
||||||
|
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
`title` varchar(255) NOT NULL,
|
||||||
|
`desc` longtext,
|
||||||
|
`fil` varchar(100),
|
||||||
|
`url` varchar(200),
|
||||||
|
`thumbnail` varchar(100),
|
||||||
|
`content_type_id` integer NOT NULL,
|
||||||
|
`object_id` integer UNSIGNED NOT NULL
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
||||||
|
CREATE TABLE `itfprofiles_training` (
|
||||||
|
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
|
||||||
|
`person_id` integer NOT NULL,
|
||||||
|
`area` varchar(255) NOT NULL,
|
||||||
|
`with_whom` varchar(255) NOT NULL,
|
||||||
|
`where_id` integer NOT NULL,
|
||||||
|
`from_when` date,
|
||||||
|
`until_when` date,
|
||||||
|
`content_type_id` integer NOT NULL,
|
||||||
|
`object_id` integer UNSIGNED NOT NULL
|
||||||
|
)
|
||||||
|
;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user