Re: Slow page load performance with a large number of formsets (over 25)

2022-02-26 Thread Carlos R. Pacheco F.
The solution is to use select2 with ajax El vie, 25 feb 2022 a la(s) 19:58, Jacob Greene (jacobgreene1...@gmail.com) escribió: > If you're using model choice fields, it's very likely you are making an > SQL query for each form set. It should be pretty obvio

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-26 Thread Antonis Christofides
ct: *Re: Slow page load performance with a large number of formsets (over 25) If you're using model choice fields, it's very likely you are making an SQL query for each form set. It should be pretty obvious in the log with debug turned on. On Fri, Feb 25, 2022, 4:31 PM Ry

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Steve Smith
formsets (over 25) You would need to cache the queryset and pass it to each form instance that the formset creates. I've done this a few different ways in the past. I've never understood why there isn't a more straight forward way to do this. Here's a post with a few legit

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Jacob Greene
o: *django-users@googlegroups.com > *Subject: *Re: Slow page load performance with a large number of formsets > (over 25) > > > > If you're using model choice fields, it's very likely you are making an > SQL query for each form set. It should be pretty obvious in the log with

RE: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Steve Smith
2 5:58 PM To: django-users@googlegroups.com<mailto:django-users@googlegroups.com> Subject: Re: Slow page load performance with a large number of formsets (over 25) If you're using model choice fields, it's very likely you are making an SQL query for each form set. It should be pretty o

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Jacob Greene
If you're using model choice fields, it's very likely you are making an SQL query for each form set. It should be pretty obvious in the log with debug turned on. On Fri, Feb 25, 2022, 4:31 PM Ryan Nowakowski wrote: > Steven, are you using ModelFormSet? If so, Is it the initial query > that's sl

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-25 Thread Ryan Nowakowski
Steven, are you using ModelFormSet? If so, Is it the initial query that's slow? The form rendering? Or is it the POST back to the server that's slow? You can use django-debug-toolbar[1] to profile your page and get these metrics. Once you figure out what part is slowest, then you can optimize.

Re: Formsets?!?!?!?!?!?!?!?!?!?

2022-02-12 Thread Antonis Christofides
Hello, I have also seen some discussions about formsets recently. I think it's not as simple as that. I don't believe there's any rule that applies to all cases. Each case is probably different. You say you have 100 rows with 12 fields each, and that it takes 19 seconds to

Formsets?!?!?!?!?!?!?!?!?!?

2022-02-11 Thread Steve Smith
Hello all I have formsets workingbut I seem to be encountering some performance issues if I have more than 25 rows. I've looked at my database callsselect_related...prefetch_related...and I've polled several audiences...SOFacebook Groupsand the consensus seems

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-08 Thread Steven Smith
What is hard reload? On Monday, February 7, 2022 at 12:43:08 PM UTC-6 abdouli...@gmail.com wrote: > Try hard reload it's little bit faster > > On Mon, Feb 7, 2022, 18:12 Steven Smith wrote: > >> Did this issue ever get resolved? I'm experiencing the same thing. Once >> it hits 100 forms or so

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-07 Thread Abdulrahman Abbas
Try hard reload it's little bit faster On Mon, Feb 7, 2022, 18:12 Steven Smith wrote: > Did this issue ever get resolved? I'm experiencing the same thing. Once > it hits 100 forms or so it gets pretty slow. > > On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote: > >> Yes,

Re: Slow page load performance with a large number of formsets (over 25)

2022-02-07 Thread Steven Smith
Did this issue ever get resolved? I'm experiencing the same thing. Once it hits 100 forms or so it gets pretty slow. On Monday, September 22, 2014 at 10:48:52 AM UTC-5 Collin Anderson wrote: > Yes, if you want speed, using javascript and ajax is probably your best > bet. It will probably also

Re: Formsets

2022-02-06 Thread Steve Smith
'm using class based views with formsets and just kind of at a loss right now as to if there is anything that can be done to speed up these queries. I opened up a SO on the issue...and got some suggestions on how to go about improving my dictionary look up...but after trying some of those sug

Re: Formsets

2022-02-06 Thread Steven Mapes
ruary 2022 at 20:27:10 UTC stevesm...@hotmail.com wrote: > Hello all! > > I find formsets wildly useful...but very difficult to architect. I have > them working...But I am running into a commonly documented problem...They > are slow as you build up the number of fields and que

Formsets

2022-02-05 Thread Steven Smith
Hello all! I find formsets wildly useful...but very difficult to architect. I have them working...But I am running into a commonly documented problem...They are slow as you build up the number of fields and queries. Are there any general tips that can be used or share on how to improve

Specifying the value format for a DateTimeInput using type=datetime-local, especially when using inline formsets

2022-01-22 Thread bnmng
I think I found a fix to a bug that I don't know was affecting anyone other than me. You can see a better formatted version of what I've typed below at https://bnmng.wordpress.com/2022/01/22/make-sure-the-widget-is-correct-in-a-django-inline-model-formset/ TL;DR: For a DateTimeInput widget wher

Re: How to avoid select lists on formsets and ManyToMany?

2021-04-01 Thread Ryan Nowakowski
Django admin does something like this with raw_id_fields[1]. I think it works by just swapping out the form widget. But you could take a look at the admin code to see for sure. [1] https://docs.djangoproject.com/en/3.1/ref/contrib/admin/#django.contrib.admin.ModelAdmin.raw_id_fields On April 1

How to avoid select lists on formsets and ManyToMany?

2021-04-01 Thread Clive Bruton
I have a ManyToMany model set, that on the edit uses a formset to add/ edit rows. I have this working, but the unfortunate part of it is that the select that results from the ManyToMany relationship populates with 16,000 records. What I would like to do is, once the records are added, just h

Re: Serializing forms and formsets to pass to Celery task

2020-02-29 Thread Integr@te System
Hi Bernd, You could take a look at serializers section on Note part, for more information, and may be your own answer. http://docs.celeryproject.org/en/master/userguide/calling.html#calling-serializers On Sat, Feb 29, 2020, 23:56 Naveen Arora wrote: > Yes that would work well. You can alwa

Re: Serializing forms and formsets to pass to Celery task

2020-02-29 Thread Naveen Arora
Yes that would work well. You can always find a completely different way of achieving what you are trying to achieve. On Saturday, 29 February 2020 18:52:24 UTC+5:30, Jason wrote: > > As said before, you really can't do that too well with celery. Its a good > practice to keep the message body b

Re: Serializing forms and formsets to pass to Celery task

2020-02-29 Thread Jason
As said before, you really can't do that too well with celery. Its a good practice to keep the message body between django -> broker -> worker to be as small as possible because we don't know what your configuration for the broker is. In addition, you should never, ever, put sensitive informat

Re: Serializing forms and formsets to pass to Celery task

2020-02-28 Thread Naveen Arora
e has any experience to share here. Essentially I see two > possible solutions: > >1. Serialize the form or formsets somehow. Anything better than dill >out there that might? >2. Serialize some part of the form or formsets (eg the POST data) and >re-inst

Serializing forms and formsets to pass to Celery task

2020-02-28 Thread Bernd Wechner
ce to share here. Essentially I see two possible solutions: 1. Serialize the form or formsets somehow. Anything better than dill out there that might? 2. Serialize some part of the form or formsets (eg the POST data) and re-instantiate a form or formset at the other end using it. E

Testing the validity of a form which has inline formsets from a View subclass

2019-09-03 Thread Shaheed Haque
form.is_valid() then form.save(commit=False)", and then proceeds to save the contents of the formsets after testing them with formset "is_valid" logic, before returning an HttpResponse. AFAICS, no exceptions are raised to signal the error. Let's say I now want to do some addition

Re: Multiple formsets and when posting associating them with an instance

2018-08-21 Thread David
Changing all modelformset factories to inlineformsets and then specifying an instance on both the post and get methods resolved this issue. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Multiple formsets and when posting associating them with an instance

2018-08-21 Thread David
added using inlineformset factory. On the subsequent page, and the one with the problem, I need to query my Client model to see how many clients are associated with the Case. That determines how many formsets I should show. ie. 1 for 1 client, or 2 for 2 clients. I chose to use modelformset fact

Re: Updating TimeField in forms/formsets returns value without microseconds

2018-03-26 Thread Tim Graham
I want to edit > objects using forms/formsets the input field on my site is always cutting > microseconds. > I made ex. class with TimeField: > > class Participant(models.Model): > surname = models.CharField(max_length = 256) > name = models.CharField(ma

Updating TimeField in forms/formsets returns value without microseconds

2018-03-25 Thread Rafał Szymczuk
I have problem with updating TimeField in my models - when I want to edit objects using forms/formsets the input field on my site is always cutting microseconds. I made ex. class with TimeField: class Participant(models.Model): surname = models.CharField(max_length = 256) name

Unable to save forms to the database for inline formsets using form wizard

2017-12-02 Thread Vishal Vincent
I am currently working on building a survey. The parent model 'Person' is linked to a 'Question' model via ManytoMany relationship. Both Question and Person model are linked to an 'Answer' model via foreign key. Currently, I am having issues using the Form Wizard which consists of two steps:

Re: Problm using FileField with inline formsets (inlineformset_factory)

2017-10-05 Thread YusufSalahAdDin
You saved my ass, thanks!!! El miércoles, 10 de septiembre de 2008, 13:46:20 (UTC+4), Daniel Roseman escribió: > > On Sep 10, 9:50 am, "c.poll...@bangor.ac.uk" > wrote: > > Hi > > > > I'm having a problem with inline formsets containing file field

Re: Hidden fields in formsets

2015-03-31 Thread aRkadeFR
Hello, I read very quickly, but you sure you want to *render* and get the value of "user_create" from the client? It can be modified by any client... aRkadeFR On 03/31/2015 10:45 AM, François GUÉRIN wrote: Hi, I'm using multiple formsets in Create / Update views, and I wa

Hidden fields in formsets

2015-03-31 Thread François GUÉRIN
Hi, I'm using multiple formsets in Create / Update views, and I want to set some *hidden* fields in it : user_create, date_create on creation, user_update, date_update on update. I've created a MultiFormsetMixin, which provide machinery to initialize those formsets in my

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: Django Class-Based CreateView and UpdateView with multiple inline formsets

2015-01-10 Thread Edgar Gabaldi
Use the django-extra-views[1]. You can easily manage multiple inline formsets with CreateViews and UpdateViews. [1] https://github.com/AndrewIngram/django-extra-views On Sat, Jan 10, 2015 at 11:23 AM, Dan Gentry wrote: > I would suggest that in the UpdateView you should set the object to

Re: Django Class-Based CreateView and UpdateView with multiple inline formsets

2015-01-10 Thread Dan Gentry
reateView and UpdateView with > multiple inline formsets > > CreateView works fine but UpdateView is not working properly, If anyone > tried UpdateView with multiple inline formsets, please point me right > approach. > > *models.py* > from django.db import models > >

Django Class-Based CreateView and UpdateView with multiple inline formsets

2015-01-10 Thread Ranjith Kumar
Hello all, I have been trying to do Django class-based CreateView and UpdateView with multiple inline formsets CreateView works fine but UpdateView is not working properly, If anyone tried UpdateView with multiple inline formsets, please point me right approach. *models.py* from django.db import

Re: FormSets with arbitary number of forms

2015-01-02 Thread Some Developer
On 01/01/15 19:52, Edgar Gabaldi wrote: The formset allow you create many instances of an object. What you need is the inline formset. When you create a Album, you can create one or more songs. Ah! Thank you. I must have missed that. I'll check it out. -- You received this message because yo

Re: FormSets with arbitary number of forms

2015-01-01 Thread Edgar Gabaldi
The formset allow you create many instances of an object. What you need is the inline formset. When you create a Album, you can create one or more songs. On Wed, Dec 31, 2014 at 4:59 PM, Some Developer wrote: > I've been reading the documentation on FormSets and must admit that I am

FormSets with arbitary number of forms

2014-12-31 Thread Some Developer
I've been reading the documentation on FormSets and must admit that I am a bit confused. I have a model called Album that contains many Songs. But when a user creates a new album I have no idea how many songs the Album will contain. So I want to create a FormSet that has an Album for

Re: Slow page load performance with a large number of formsets (over 25)

2014-09-22 Thread Collin Anderson
Yes, if you want speed, using javascript and ajax is probably your best bet. It will probably also reduce merge-conflicts. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: Slow page load performance with a large number of formsets (over 25)

2014-09-21 Thread bobhaugen
are currently building an > application in PythonAnywhere. We have a couple of html pages where the > volume of formsets that we are loading up varies from 25 to 100. We find > that when we use a small number of formsets, the page loads very quickly. > However, performance seems to degrade

Slow page load performance with a large number of formsets (over 25)

2014-09-20 Thread Jason
We are new to the Django framework and are currently building an application in PythonAnywhere. We have a couple of html pages where the volume of formsets that we are loading up varies from 25 to 100. We find that when we use a small number of formsets, the page loads very quickly. However

Re: Formsets, adding new forms and autocomplete/ajax selects

2014-05-28 Thread Sanjay Bhangar
hey Lachlan, So this had driven me a bit crazy some years ago .. On Wed, May 28, 2014 at 8:42 AM, Lachlan Musicman wrote: > Hola, > > I am trying to get two different "extras" to work. > > I have a form with an inline_formset, which I would like to be able to > add

Formsets, adding new forms and autocomplete/ajax selects

2014-05-27 Thread Lachlan Musicman
Hola, I am trying to get two different "extras" to work. I have a form with an inline_formset, which I would like to be able to add multiple formsets of on the fly. Each of those formsets has another FK to a model with a very large dataset, so I would also like to implement so

Re: Django Dynamic Formsets

2014-04-12 Thread Venkatraman S
oproject.com/en/1.6/topics/forms/formsets/ > > Then I followed the documentation and included the django-formset-js: > https://pypi.python.org/pypi/django-formset-js/ > > But I can't get the buttons "Add another" neither "Delete" working. > And I'm s

Re: Django Dynamic Formsets

2014-04-09 Thread Leandro Alves
Hi again, So I followed the documentation and created a formset as we have there. https://docs.djangoproject.com/en/1.6/topics/forms/formsets/ Then I followed the documentation and included the django-formset-js: https://pypi.python.org/pypi/django-formset-js/ But I can't get the buttons

Re: Django Dynamic Formsets

2014-04-08 Thread Venkatraman S
Actually, there is nothing more to it. Include the js and create the formset_factory and start using it in the template by iterating over it. In the view, post-POST, again iterate over the formsets. Bulk of the work is done by the js and you dont have to do much in django. There is a minor bug in

Re: Django Dynamic Formsets

2014-04-08 Thread Leandro Alves
Hello Venkatraman, Yes.. I saw this one was well... and I want to try it.. but I'm still learning about Formsets... Would you have any basic simple foo example to share? :) Best, Leandro On Tuesday, April 8, 2014 2:48:15 AM UTC+2, Venkatraman.S. wrote: > > Have you tried the jqu

Re: Django Dynamic Formsets

2014-04-08 Thread Leandro Alves
Hello Alejandro!!! Man...I swear, if I had it I would be sooo happy to share... :) I still couldn't get a normal Formset example to work.. Do you have any simple foo example to share? hehehe I'm trying from https://docs.djangoproject.com/en/1.6/topics/forms/formsets/. I also tried t

Re: Django Dynamic Formsets

2014-04-08 Thread Alejandro Perez
>>>>> Any freelance available for this? >>>>> >>>>> Thanks for the feedback! >>>>> >>>>> Leandro >>>>> >>>>> >>>>> On Mon, Apr 7, 2014 at 7:33 PM, Gladson Simplício

Re: Django Dynamic Formsets

2014-04-07 Thread Venkatraman S
Have you tried the jquery formset - works like a breeze for me. On Mon, Apr 7, 2014 at 10:43 PM, Leandro Alves wrote: > Hi, > > I wonder if anyone knows of any example of django-dynamic-formsets [1] > that works with Django 1.6? > > So far all I found on the internet are ov

Re: Django Dynamic Formsets

2014-04-07 Thread Leandro Alves
t;>> Leandro >>>> >>>> >>>> On Mon, Apr 7, 2014 at 7:33 PM, Gladson Simplício Brito < >>>> gladso...@gmail.com> wrote: >>>> >>>>> The project was migrated to another repository: >>>>> >>>&g

Re: Django Dynamic Formsets

2014-04-07 Thread Gladson Simplício Brito
Thanks for the feedback! >>> >>> Leandro >>> >>> >>> On Mon, Apr 7, 2014 at 7:33 PM, Gladson Simplício Brito < >>> gladso...@gmail.com> wrote: >>> >>>> The project was migrated to another repository: >>>> >>

Re: Django Dynamic Formsets

2014-04-07 Thread Leandro Alves
e project was migrated to another repository: >>> >>> https://github.com/elo80ka/django-dynamic-formset >>> >>> >>> 2014-04-07 13:13 GMT-04:00 Leandro Alves >>> >: >>> >>>> Hi, >>>> >>>> I wonder i

Re: Django Dynamic Formsets

2014-04-07 Thread Gladson Simplício Brito
namic-formset >> >> >> 2014-04-07 13:13 GMT-04:00 Leandro Alves : >> >>> Hi, >>> >>> I wonder if anyone knows of any example of django-dynamic-formsets [1] >>> that works with Django 1.6? >>> >>> So far all I found

Re: Django Dynamic Formsets

2014-04-07 Thread Leandro Alves
her repository: > > https://github.com/elo80ka/django-dynamic-formset > > > 2014-04-07 13:13 GMT-04:00 Leandro Alves : > >> Hi, >> >> I wonder if anyone knows of any example of django-dynamic-formsets [1] >> that works with Django 1.6? >> >> So far all

Re: Django Dynamic Formsets

2014-04-07 Thread Gladson Simplício Brito
The project was migrated to another repository: https://github.com/elo80ka/django-dynamic-formset 2014-04-07 13:13 GMT-04:00 Leandro Alves : > Hi, > > I wonder if anyone knows of any example of django-dynamic-formsets [1] > that works with Django 1.6? > > So far all I found o

Django Dynamic Formsets

2014-04-07 Thread Leandro Alves
Hi, I wonder if anyone knows of any example of django-dynamic-formsets [1] that works with Django 1.6? So far all I found on the internet are over 3 years old and they don't work with Django version 1.6. I am willing to pay for any example that works if necessary. :) Thanks in ad

Re: Django 1.5.1 and formsets with more than 1000 initials

2013-04-25 Thread Carsten Fuchs
Hi Xavier, thank you very much for your reply! :) Am 25.04.2013 07:31, schrieb Xavier Ordoquy: I'm not sure whether the FormSet could extends itself this number if the initial_data is larger than 1000. If I understand the documentation correctly, the purpose of the `max_num` parameter is t

Re: Django 1.5.1 and formsets with more than 1000 initials

2013-04-24 Thread Xavier Ordoquy
Carsten Fuchs a écrit : > Hi all, > > using Django 1.5.1, having read > <https://docs.djangoproject.com/en/1.5/topics/forms/formsets/#limiting-the-maximum-number-of-forms>, > I still have trouble creating a formset with more than 1000 initial forms: > > Following the

Django 1.5.1 and formsets with more than 1000 initials

2013-04-24 Thread Carsten Fuchs
Hi all, using Django 1.5.1, having read <https://docs.djangoproject.com/en/1.5/topics/forms/formsets/#limiting-the-maximum-number-of-forms>, I still have trouble creating a formset with more than 1000 initial forms: Following the example at that page, what I'd like to do is, with

Re: cleaned_data returning empty in formsets

2013-04-09 Thread Tom Evans
On Tue, Apr 9, 2013 at 6:09 AM, Nora Olsen wrote: > > The following snippet is returning an empty dictionary for the 2nd form: > > … > > How does initial work with data= in a formset? Without the initial, there > will be cleaned data for the 2nd form. > I see you found your error, but to answer

Re: cleaned_data returning empty in formsets

2013-04-08 Thread Nora Olsen
Just found the culprit: 'form-INITIAL_FORMS': u'1', it must be 2. On Tuesday, April 9, 2013 1:09:10 PM UTC+8, Nora Olsen wrote: > > > The following snippet is returning an empty dictionary for the 2nd form: > > > >> dct = {'form-0-attachment': u'', >> 'form-0-id': u'1', >> 'form-0-name': u'

cleaned_data returning empty in formsets

2013-04-08 Thread Nora Olsen
The following snippet is returning an empty dictionary for the 2nd form: > dct = {'form-0-attachment': u'', > 'form-0-id': u'1', > 'form-0-name': u'1', > 'form-1-attachment': u'', > 'form-1-id': u'2', > 'form-1-name': u'2', > 'form-INITIAL_FORMS': u'1', > 'form-MAX_NUM_FORMS': u'1000',

Re: Understanding UpdateView with forms and formsets

2013-04-08 Thread Rainy
Sorry, I answered before reading your full message. It looks like you understand post loads the object in get_object(). I just want to add that combined create/update can be done in different ways; I have an implementation in mcbv.edit module but I'm not sure if it's the best approach in all cases

Re: Understanding UpdateView with forms and formsets

2013-04-08 Thread Rainy
rflow: > http://stackoverflow.com/questions/15877199/using-formset-with-contenttype > > I am trying to save Item with multiple Pictures in a single form. > > I can easily save the item form in the Post method of the view but I can't > save the formsets without the p

Understanding UpdateView with forms and formsets

2013-04-08 Thread Nora Olsen
res in a single form. I can easily save the item form in the Post method of the view but I can't save the formsets without the pk. In my template, I have the following: {% for field in form %} # do something {% endfor %} {{ picture_formset.management_form }} {% for form in picture_

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
;>> kwargs['initial'] = [{ 'name': 'eth1', }, {'name': 'eth2'},] >>> super(DirectIfaceInlineFormSet, self).__init__(*args, **kwargs) >>> >>> >>> In this case 2 Direct ifaces with names eth1 a

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
.__init__(*args, **kwargs) >> >> >> In this case 2 Direct ifaces with names eth1 and eth2. >> >> The problem is that those ifaces doesn't get stored when I hit the save >> button, that's because has_changed == False. >> So is there a way to tell Dja

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
.__init__(*args, **kwargs) >> >> >> In this case 2 Direct ifaces with names eth1 and eth2. >> >> The problem is that those ifaces doesn't get stored when I hit the save >> button, that's because has_changed == False. >> So is there a way to tell Django t

Re: Django inline formsets, force initial data to be saved.

2013-03-04 Thread Russell Keith-Magee
kwargs['initial'] = [{ 'name': 'eth1', }, {'name': 'eth2'},] > super(DirectIfaceInlineFormSet, self).__init__(*args, **kwargs) > > > In this case 2 Direct ifaces with names eth1 and eth2. > > The problem is that those ifaces doesn

Django inline formsets, force initial data to be saved.

2013-03-04 Thread Marc Aymerich
InlineFormSet, self).__init__(*args, **kwargs) In this case 2 Direct ifaces with names eth1 and eth2. The problem is that those ifaces doesn't get stored when I hit the save button, that's because has_changed == False. So is there a way to tell Django to save formsets with only i

Re: Tutorials for formsets using PKs as checkboxes

2013-02-08 Thread Rafael E. Ferrero
s or guides for using formsets, with > PKs as checkboxes? Something not to dissimilar to the functionality found > in the django admin when listing records belonging to a model. > > I have tried looking through Django's code but can't find what I need. > > Thanks for any help

Tutorials for formsets using PKs as checkboxes

2013-02-08 Thread David
Hi Does anyone know of any good tutorials or guides for using formsets, with PKs as checkboxes? Something not to dissimilar to the functionality found in the django admin when listing records belonging to a model. I have tried looking through Django's code but can't find what I nee

Re: Formsets and auto_id's

2013-02-07 Thread David
I've kinda managed to achieve what I want but I can't help but think it's a bit of a fudge: Especially this part: form.id.html_name -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from

Formsets and auto_id's

2013-02-07 Thread David
Hi I have a formset. Each form will only contain a checkbox. This checkbox needs to indicate which PK the form applies to. The idea is that a user can scroll through this formset. Check which records they wish to delete and then remove them through a delete view. auto_id's always seem to show

Django Formsets - How to build a formset correctly and validade it?

2013-01-11 Thread Andre Lopes
Hi all, I'm struggling with Formsets. I've read the documentation and lots of information on the web, but I'm experiencing some difficulties on get them working. I've wrote a StackOverflow question that explains my difficulties. http://stackoverflow.com/questions/14280875/dj

Re: Management form in Model Formsets

2012-07-01 Thread Knight Samar
check this snippet out: djangosnippets.org/snippets/1389 > */* > Le 1 juil. 2012 06:27, "Knight Samar" a écrit : > >> Hi, >> >> I am using Django 1.2 and developing using Model formsets. Using >> JavaScript, I am allowing the user to dynamically "

Re: Management form in Model Formsets

2012-07-01 Thread Thomas Orozco
You might want to check this snippet out: djangosnippets.org/snippets/1389*/ * Le 1 juil. 2012 06:27, "Knight Samar" a écrit : > Hi, > > I am using Django 1.2 and developing using Model formsets. Using > JavaScript, I am allowing the user to dynamically "Add another

Management form in Model Formsets

2012-06-30 Thread Knight Samar
Hi, I am using Django 1.2 and developing using Model formsets. Using JavaScript, I am allowing the user to dynamically "Add another" formset on the template, but I can't figure out what exactly I have to modify in the management forms, for all the formsets to be successfu

labels for check-boxes in formsets?

2012-06-06 Thread matru...@googlemail.com
Hey, currently, I puzzling on a solution to do the following: I've got a list of objects defined by a model, e.g persons. I'd like to put a form together to select some of those objects to do something with them (e.g. send an email). The view, which should be created is something like in the adm

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

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 vi

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

Struggling with formsets

2012-05-18 Thread David
with the ORM and Django Formsets. Any help would be greatly appreciated, I've been stumped on this for ages. 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.goo

Re: Altering object order in formsets with can_order

2012-05-06 Thread Boris Shemigon
The best I've found is this <http://stackoverflow.com/a/8417283/187171>. On Wednesday, May 5, 2010 11:56:02 PM UTC+7, palmeida wrote: > > Hi, > > I'm having a hard time grasping the concept of the can_order argument, > when creating formsets. Once objects ar

ListView, Formsets and Model formsets

2012-05-02 Thread Steve Kilbane
It seems like formsets are the solution here, but neither Formset nor ModelFormset seems to be quite right: I want a reference to my original model, so that each form in the set is related to an object, but I don't want *any* of the model's fields in the form - just the checkbox. Nor do I w

How to do form validation for inline formsets?

2012-04-18 Thread Derek
Working with Django 1.3 I can create and run an inline formset without problems using Approach 1. However, when I try Approach 2, then I get the error below, triggered by the line shown. TypeError at /uploads/details/1 __init__() got an unexpected keyword argument 'instance' Clearly, my syntax

Need help with Django formsets

2012-04-11 Thread BeriK
e = survey_data.surveytype questions = Question.objects.all().filter(surveytype = survey_type).order_by('order') I have read the django documentation about formsets but I don't understand what I have to write in forms.py, so I can't call the form in views.py to re

Re: Nested formsets at Django 1.3

2011-11-08 Thread Ilya
The validation error happens when the formset is passed an empty dictionary. The docs (release notes for 1.3) suggest passing None instead. So doing this should fix the problem: > > TenantFormset(data=self.data or None, instance=instance, prefix='TENANTS_%s' % pk_value) In my case, which is sim

Re: Nested formsets at Django 1.3

2011-07-31 Thread Kev Dwyer
Kev Dwyer wrote: > Hello List, > > I've been upgrading an old Django 1.1.x app to use Django 1.3, and am > having a problem with nested formsets. > ... > > > I omitted one important fact in this write-up. In Nathan's original code, the lowest

Nested formsets at Django 1.3

2011-07-30 Thread Kev Dwyer
Hello List, I've been upgrading an old Django 1.1.x app to use Django 1.3, and am having a problem with nested formsets. The structure of my formsets is based on the structure outline in Nathan Yerger's blog post http://yergler.net/blog/2009/09/27/nested- formsets-with-django/, i.e

Re: [formsets] Initial Values to an inline_formset() instance

2011-06-17 Thread Nikhil Somaru
thout using Javascript > (because I > don't know it) > > My Solution: Inline Formset via inline_formset() > > However, > >- inline_formset() does not accept initial as an argument >- This is after the form has been submitted once and I want to create >new f

[formsets] Initial Values to an inline_formset() instance

2011-06-17 Thread Nikhil Somaru
- This is after the form has been submitted once and I want to create new forms in the formsets while still keeping the data already entered, waiting to be edited I am using the following workaround in the mean time: (the entire view may be found here: http://dpaste.com/hold/555463/

Dynamic Nested Formsets?

2011-06-10 Thread Sontek
I have 3 Models: class Workflow(models.Model): name = models.CharField(max_length=255) company = models.ForeignKey(Company) class Meta: unique_together = ('name', 'company') class Milestone(models.Model): workflow = models.ForeignKey(Workflow) tasks = models.ManyToMany

Embedded Inline Formsets

2011-05-28 Thread John Anderson
I have 3 Models: class Workflow(models.Model): name = models.CharField(max_length=255) company = models.ForeignKey(Company) class Meta: unique_together = ('name', 'company') class Milestone(models.Model): workflow = models.ForeignKey(Workflow) tasks = models.ManyToMan

Multiple formsets in a view

2011-05-22 Thread ekms
Hello, in my view, I create dinamically multiple formsets, and I put a dinamic prefix to all of them (ex, formset1, formset2, ...), then I pack all the formsets in a list and pass it to the template. Later, how I can retrieve all the formsets from request.POST? I know that I've to do some

  1   2   3   >