» Django: How can I render a ModelForm partially editable fields and show other fields as label items?
Django: How can I render a ModelForm partially editable fields and show other fields as label items?
|September 6, 2014
Posted by forumadmin
I am doing my first app on django.
I have the following class:
model = Solicitante
fields = ['congregacionOfertante', 'id_oferta', 'observaciones', 'descartado']
Solicitante extends the django
Model class, and have other fields.
I want to use the django forms approach to render the form. But it renders only the fields defined on
Meta.fields. I want it render the other fields but using
<span> instead of
How can I do that?
Thanks in advance.
More Related Questions
- Change the width of form elements created with ModelForm in Django How can i change the width of a textarea form element if i used ModelForm to create it?
Here is my product class:
long_desc = […]
- Django forms want to auto-save user, client and datetime I need some help.
In my models.py I have a table for Note. What I want to to do with this table is to create a form where a user could enter some notes in a text field for a particular […]
- Customizing an Admin form in Django while also using autodiscover I want to modify a few tiny details of Django's built-in django.contrib.auth module. Specifically, I want a different form that makes username an email field (and email an alternate email […]
- django-autocomplete-light default load a previously saved value? I have a working implementation of autocomplete_light in my django project, pulling values from cities_light in a dropdown, which correctly saves the foreign key to the field in the db on […]
- Django: Put a Form into a Form (recursive …) I like Django forms library, but it would be even better if I could put a form into a form like a form field.
My dream looks like this: I have a form which behaves like normal form. You […]
- Django Passing Custom Form Parameters to Formset I have a Django Form that looks like this:
option = forms.ModelChoiceField(queryset=ServiceOption.objects.none())
rate = […]
- Is there a way in Django to make it so that when a form with initial text is clicked the text disappears? For example, on some sites in the username form box it says something like "username" and then when you click there the "username" disappears so you can type your username.
- In a django form, How to make a field readonly (or disabled) so that it cannot be edited? In a django form, how do I make a field read-only (or disabled)?
When the form is being used to create a new entry, all fields should be enabled - but when the record is in update mode […]
- Validation when dynamic choices are set in django forms I had a little issue a few hours ago, I wanted to save a form after getting data from a POST submited by the user.
The thing was that I set the choices for my multiple choice select […]
- Django set default form values I have a Model as follows
user = models.ForeignKey(User)
tank = models.ForeignKey(TankProfile)
ts = models.IntegerField(max_length=15)
title = […]