Thanks Tom.
On Wed, Nov 27, 2013 at 8:13 AM, Tom Evans wrote:
>
> No, "form" is an instance of your form. Model forms have a method
> called save(), when you call this method, the model form updates an
> instance of the model with the values from the form, saves the
> instance and then returns it
On Wed, Nov 27, 2013 at 9:50 AM, Timothy W. Cook wrote:
> On Tue, Nov 26, 2013 at 9:34 AM, Daniel Roseman wrote:
>> On Monday, 25 November 2013 21:42:51 UTC, Timothy W. Cook wrote:
>>
>> But that's just what form.save() does. In your original code, you called it
>> and a new Review object was sav
On Tue, Nov 26, 2013 at 9:34 AM, Daniel Roseman wrote:
> On Monday, 25 November 2013 21:42:51 UTC, Timothy W. Cook wrote:
>
> But that's just what form.save() does. In your original code, you called it
> and a new Review object was saved in the database (it was also returned, but
> you didn't use
On Monday, 25 November 2013 21:42:51 UTC, Timothy W. Cook wrote:
>
> On Mon, Nov 25, 2013 at 8:22 AM, Daniel Roseman
> >
> wrote:
> > On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote:
> >>
> >> On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman
>
> >> wrote:
>
> >
> > No, `f` i
On Mon, Nov 25, 2013 at 8:22 AM, Daniel Roseman wrote:
> On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote:
>>
>> On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman
>> wrote:
>
> No, `f` is now an unsaved instance of the Review model, rather than a form
> (you should probably make tha
On Sunday, 24 November 2013 18:46:21 UTC, Timothy W. Cook wrote:
>
> On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman
> >
> wrote:
> > Hmm, I tried to post an answer to your original question earlier but it
> never appeared.
> >
>
> Thanks Daniel. Your help is very much appreciated.
>
> > Th
On Sun, Nov 24, 2013 at 4:38 PM, Daniel Roseman wrote:
> Hmm, I tried to post an answer to your original question earlier but it never
> appeared.
>
Thanks Daniel. Your help is very much appreciated.
> The reason why adding the values to `cleaned_data` doesn't work is that those
> fields aren
Hmm, I tried to post an answer to your original question earlier but it never
appeared.
The reason why adding the values to `cleaned_data` doesn't work is that those
fields aren't in the `fields` list for the form in the first place, so it
doesn't know to do anything with them. Adding them to t
SOLVED: (I think)
Though I do not understand the how/why. From an example on
StackOverflow I tried changing the post method to this:
def post(self, request, *args, **kwargs):
form = self.form_class(request.POST)
if form.is_valid():
#
paper = get_obj
I have an issue with save data from a form.
The actual form has one required and two optional fields.
The model has three additional fields that I want to assign based on
the context, two of those are ForeignKey related.
The post method in the view:
def post(self, request, *args, **kwargs):
10 matches
Mail list logo