Re: Struggling with formsets

2015-02-19 Thread Werner Brand
Thanks for the reponse! My template looks like this: {{ formset.management_form }} {{ formset }} {% csrf_token %} Here is the print request.POST: form-1-salaryform-MAX_NUM_FORMSform-0-surnameform-0-nameform-TOTAL_FORMSform-MIN_NUM_FORMSform-0-idform-1-nameform-

Re: Struggling with formsets

2015-02-19 Thread aRkadeFR
Hello, Can we have the template? Did you rendered the hidden fields id of your forms ? Dump (by printing) the request.POST informations to see if you received any "id" :) On 02/19/2015 04:25 PM, Werner Brand wrote: I cannot seem to figure this, although I suspects it is really elementary:

Struggling with formsets

2015-02-19 Thread Werner Brand
I cannot seem to figure this, although I suspects it is really elementary: I have two models: class Employee(models.Model): id_number = models.CharField(max_length=13) surname = models.CharField(max_length=100) name = models.CharField(max_length=100) class Payslip(models.Model): surname =

Re: Struggling with formsets

2012-05-29 Thread akaariai
On May 29, 12:45 pm, David wrote: > Anyone else have any suggestions please? > > Thank you I don't think there is a way to create formsets, and then formsets related to the first formsets. So, something like this is what you likely need: for p in persons: do_what_you_did_for_single_object()

Re: Struggling with formsets

2012-05-29 Thread David
Anyone else have any suggestions please? Thank you -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/-8zgkyBbFBoJ. To post to this group, send email to djang

Re: Struggling with formsets

2012-05-18 Thread David
Thanks Pedesen for your reply. I have tried inline-formsets and as you say unfortunately I could only get it to work with a single object. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups

Re: Struggling with formsets

2012-05-18 Thread pedesen
For this case inline-formsets should be the way to go: https://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets But I think this will work for a particular person, but not for multiple persons... Am Freitag, 18. Mai 2012 15:27:05 UTC+2 schrieb David: > > Given 2 models: > >

Struggling with formsets

2012-05-18 Thread David
Given 2 models: class Person(models.Model): first_name = models.CharField(max_length=255) last_name = models.CharField(max_length=255) class PersonAttendance(models.Model): person = models.ForeignKey(Person) attend_date = models.DateField() I need to produce a formset that lists