id = AutoField( primary_key = True )
description = CharField( max_length = 50 )
def __unicode__(self):
return self.description
class Client_Interprise( Model ):
id = AutoField( primary_key = True )
activitie = ForeignKey( Activitie )
interprise = ForeignKey( Interprise )
full_name = CharField( max_length = 100, blank = True ,null= True)
telephon_number = CharField( max_length = 20, blank = True ,null=
True)
class Activitie( Model ):
id = AutoField( primary_key = True )
begin_date = DateTimeField()
end_date = DateTimeField()
collaborator = ManyToManyField( Interprise,
related_name="collaborator")
client = ManyToManyField( Interprise, through='Client_Interprise')
############### END MODEL ######################
from django.forms import ModelForm, Textarea
from django.contrib.admin.widgets import AdminSplitDateTime,
FilteredSelectMultiple
class ActivitieForm( ModelForm ):
class Meta:
model = Activitie
fields=[
'begin_date', 'end_date', 'collaborator',
'client',
]
widgets={
'collaborator':
FilteredSelectMultiple( verbose_name = "collaborator",
is_stacked=False ),
'begin_date': AdminSplitDateTime(),
'end_date':
AdminSplitDateTime(),
'description': Textarea( attrs={ 'cols':50, 'rows':
10 } ),
'client': ?????????????????? HELP HELP
}
class ActivitieCreateView( CreateView ):
template_name = "create_journal_activity.xhtml"
context_object_title = 'Activitie'
form_class = ActivitieForm
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment