Using array for making form
Hi,
I want to make a form in such a way that the contents of the form
should be declared in the array, and also the user details field
corresponding to that contents of the form, which a user fills, should
also be in array in the the models of the project.
I currently use to do this like:
class soil_oshr(models.Model):
date_of_testing = models.CharField(max_length=255)
type_of_str = models.CharField(max_length=255)
latitude_N = models.CharField(max_length=255,blank=True)
longitude_E = models.CharField(max_length=255,blank=True)
presence_1 = models.CharField(max_length=255)
presence_2 = models.CharField(max_length=255,blank=True)
submitted_1 = models.CharField(max_length=255)
submitted_2 = models.CharField(max_length=255,blank=True)
submitted_3 = models.CharField(max_length=255,blank=True)
site_name = models.CharField(max_length=255)
water_table = models.CharField(max_length=255)
depth_D = models.CharField(max_length=255)
water_table = models.CharField(max_length=255)
def __str__(self):
return self.date_of_testing
class soil_oshrForm(ModelForm):
class Meta :
model = soil_oshr
The thing i need that in case of above class "soil_ohsr" the choices
like "date_of_testing", "type_of_str", "latitude_N", and their values
which are in charfields, should be declared as array to avoid the
lengthy code.
If anybody tell me how i'll do it. Thanks in advance.
--
Satinderpal Singh
http://satindergoraya.blogspot.in/
http://satindergoraya91.blogspot.in/
--
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.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home