Many thanks Karen. This worked perfectly (though the 'name' attribute
is just name without the quotes).
Cheers,
Ken
On 5 Mar, 01:42, Karen Tracey wrote:
> On Thu, Mar 4, 2010 at 2:24 PM, Ken wrote:
> > Thanks for your example, but whilst you're correct about Person.id not
> > getting updated
On Thu, Mar 4, 2010 at 2:24 PM, Ken wrote:
> Thanks for your example, but whilst you're correct about Person.id not
> getting updated, all the other columns do get changed (even if it is
> to the same value).
>
> Here's my code...
>
> class TcsDetectionListsForm(forms.Form):
>name = forms.Cha
Thanks for your example, but whilst you're correct about Person.id not
getting updated, all the other columns do get changed (even if it is
to the same value).
Here's my code...
class TcsDetectionListsForm(forms.Form):
name = forms.CharField()
def candidateWithForm(request, tcs_transient_obj
1. Doing Person.save() will NOT update every field in your model.
2. Your snippet uses a ModelForm. Mine used a Form. There's a huge difference.
If you use a ModelForm you're going to have to exclude all the fields you don't
want.
3. If you use a ModelForm and instantiate it with request.POST, d
Thanks Shawn
My problem is that Person.save() will do an update of all my columns.
Even though they are all identical, apart from the changed value, this
will violate my minimum privileges requirement of only allowing the
application access to the columns that it is allowed to change - hence
your
Here's a simple example. It could be improved, but it's meant to be very simple.
#Make a simple form.
class AgeForm(forms.Form):
age = forms.IntegerField()
#When the user submits the form:
age_form = AgeForm(request.POST)
if age_form.is_valid()
#get the pk however you need to
Thanks
Unfortunately I'm very new to Forms/ModelForms, and I'm having a lot
of difficulty understanding the Django examples.
All I want is to allow my users to make one change to one column. I
don't want them to see the ID, just a text box and a submit button.
Hitting Submit should take them bac
Use a forms.ModelForm and exclude all the fields except one, or use a
forms.Form with one field and use its value in a queryset .update()
call.
Shawn
Sent from my iPhone
On Mar 2, 2010, at 7:11 PM, Ken wrote:
Folks
This is a bit of a newbie question on Model updates. I've been
happily
8 matches
Mail list logo