doh! its one thing being stupid... its another being stupid in front of a big crowd of people!
if my field is readonly... it probably doesn't need a dropdown list does it?? would still be nice to set date field text box class to vDateField to get nice pop-up thingy! On Jan 16, 1:38 pm, sico <[email protected]> wrote: > Hi, > > I've inherited a django app - running on 0.96. So far, the people > before me have not created any views, and have just used the built-in > admin app to modify everything. > > I want to create a view to control adding/editing records for a > specific model. > > #So, I create form from the model like: > > if add == True: > myObj = "" > myForm = form_for_model (MyModel) > else: > myObj = MyModel.objects.get(pk=myId) > myForm = form_for_instance(myObj) > > form = myForm() # this got me at first!! > > # Then I pass this form object to my template using render_to_response > > return render_to_response('mytemplate.html', > {'myId':myId, > 'myForm':form, > }, > context_instance=RequestContext(request)) > > all good so far... > > then, in my template... I thought about using > > myForm.as_table > > but... I want some fields to be disabled if you're editing the record > - still want them displayed, just not editable... > > so I tried to display the fields all separately, > > form.fieldname > > that will let me display all the other fields, but to make my field > readonly I tried putting it in directly... <input type=...... had > to pass in the model object as well to get the data, but the big > kicker is the field is a lookup.... to a really big table.... > > surely I'm trying to do this the hard way!!! > > Is there a way to display a form field and specify it to be read- > only ??? > > Also, would be nice to be able to add class="vDateField" to my > datefields so it has the nice pop-up like the admin form.... > > thanks in advance!! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---

