Re: Understanding Baseinlineformset and inlineformset_factory.

2020-08-05 Thread NIKHIL RAJGARHIA
Any hint on the above doubt will work fine. On Wednesday, August 5, 2020 at 12:32:23 AM UTC+5:30, NIKHIL RAJGARHIA wrote: > > Hi All, > > I am unable to understand the below logic for '*BaseInlineFormSet*' and ' > *inlineformset_factory*'. > > 1. What i

Understanding Baseinlineformset and inlineformset_factory.

2020-08-04 Thread NIKHIL RAJGARHIA
Hi All, I am unable to understand the below logic for '*BaseInlineFormSet*' and ' *inlineformset_factory*'. 1. What is the use of 'formset' in 'inlineformset_factory'? 2. What is the use of validation inside 'BaseInlineFormSet'? How it works? I haven't seen any implementation like

How to iterate over inlineformset_factory fields only?

2020-02-02 Thread Tal Bar-Or
Hello, I am trying to figure out how to access *inlineformset_factory* ,i set to represent my ForeignKey fields to present them in html i would like to iterate over those inlineformset_factory only in html, but i can't figure out how to achieve it, i can get display only field manually like

Re: forms with get_or_create and inlineformset_factory

2019-01-26 Thread Elias Coutinho
could be but in the context of my client's need this would be inversely to what the project proposes. When he needs to choose the questions he must choose a form and when he wishes all he chooses another. so there are two way and two Views. Em sáb, 26 de jan de 2019 14:31, Mohammad Etemaddar <

forms with get_or_create and inlineformset_factory

2019-01-26 Thread Mohammad Etemaddar
I think the answer is in your signal-connected function in your question query which you choosed all() questions. I did not understand the project, but you should choose questions in signal and not all questions I think. -- You received this message because you are subscribed to the Google

forms with get_or_create and inlineformset_factory

2019-01-26 Thread Elias Coutinho
', ) class SearchForm(forms.ModelForm): class Meta: model = Search fields = '__all__' exclude = () layout = Layout( Fieldset("Responda com Calma.", Row('person', 'search_key'), Row('researched',),)) SearchItemFormSet = inlineformset_fact

Formset created with inlineformset_factory doesn't render labels on page

2018-03-23 Thread kradem
I've got a formset: I've got a formset: down votefavorite <https://stackoverflow.com/questions/49367485/formset-created-with-inlineformset-factory-doesnt-render-labels-on-page#> FormSet = inlineformset_factory( User, Profile, fields=('mychoice',), widgets={ 'my

Re: Problm using FileField with inline formsets (inlineformset_factory)

2017-10-05 Thread YusufSalahAdDin
blem is that when django > > comes to validate the inline form education it reports that the field > > is empty, if i tell the model to allow empty feilds then the file is > > not saved > > > > Is it possible to use file fields with the inlineformset_factory or do

Re: Can't get error to display when using inlineformset_factory.

2017-04-26 Thread Andrew Michael
] *On Behalf Of *Andrew Michael > *Sent:* Tuesday, April 25, 2017 2:29 PM > *To:* Django users > *Subject:* Can't get error to display when using inlineformset_factory. > > > > I am trying to get validation errors to appear on my web page when using > an inlineformset_factory

RE: Can't get error to display when using inlineformset_factory.

2017-04-25 Thread Matthew Pava
25, 2017 2:29 PM To: Django users Subject: Can't get error to display when using inlineformset_factory. I am trying to get validation errors to appear on my web page when using an inlineformset_factory. I have a main form called PersonalInformation form and 3 inline forms (Relative, PositionHeld

Can't get error to display when using inlineformset_factory.

2017-04-25 Thread Andrew Michael
I am trying to get validation errors to appear on my web page when using an inlineformset_factory. I have a main form called PersonalInformation form and 3 inline forms (Relative, PositionHeld and Phone). I am receiving the main form errors on my page, but I can't get the 3 inline forms

inlineformset_factory Tutorial

2016-07-11 Thread Paul
I'm searching for a good tutrial regarding "inlineformset_factory". the information about it od Django site is very scarce. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving

Re: inlineformset_factory with multiple foreignKeys

2015-10-14 Thread jupiter
No longer need it, please ignore it. On Wed, Oct 14, 2015 at 9:35 AM, jupiter <jupiter@gmail.com> wrote: > Hi, > > How can the inlineformset_factory be used for multiple following > foreignKeys at following an example? > > class Recipe(models.Model): > pub_

Re: inlineformset_factory with multiple foreignKeys

2015-10-13 Thread Nkansah Rexford
With multiple inlineformset_factory, Ive not tried, but perhaps this could help: http://stackoverflow.com/questions/3945435/adding-multiple-models-to-inlineformset-factory Mine was just one inlineform -- You received this message because you are subscribed to the Google Groups "Django

inlineformset_factory with multiple foreignKeys

2015-10-13 Thread jupiter
Hi, How can the inlineformset_factory be used for multiple following foreignKeys at following an example? class Recipe(models.Model): pub_date = models.DateTimeField('Date Published', auto_now_add = True) title = models.CharField(max_length=200) instructions = models.TextField

inlineformset_factory displays only inline formset, doesn't show parent model

2015-04-19 Thread Nkansah Rexford
I have this: # consider all importations done right. def add_noodle(request):NoodleFormSet = inlineformset_factory(Noodle, tutImages, form=NoodleForm, fields=('title', 'image'))if request.method == 'POST':formset = NoodleFormSet(request.POST, request.FILES

Re: Multiple django inlineformset_factory problem

2014-10-09 Thread Collin Anderson
lforms/#modelform-factory-function How do I have my views.py interpret the submitted Implementation form data > from the user? I think your case is pretty complicated. Does this seem right? ControlImplementationSet = inlineformset_factory(Controls, Implementation, fields=['impleme

Multiple django inlineformset_factory problem

2014-10-09 Thread Farhan Khan
Hi all, I am writing a tool that implements NIST security controls and having trouble implementing inlineformset_factory, which I think is the solution to this problem. Background: I have two models, one is called 'Controls' and the other is 'Implementation'. When the user goes to a page

Many-to-many with inlineformset_factory - row for each possible value?

2014-02-04 Thread Miles Gard
ionSubForm = inlineformset_factory(Site, Site.items.through, form=AllocationForm) aform = AllocationSubForm() return render(request, 'allocations.html', { 'subform': aform}) Which seems to work, in that it it shows 3 blank rows - each row prompts the user to select an Item from a dropdown and fill the qty in

Formset from inlineformset_factory for the model who has multiple foreign key?

2013-09-22 Thread Trung Nguyen
() def __unicode__(self): return u"%s - %s - %s" % (self.student, self.course, self.score) In the view def grading_student(request, school_id=1, student_id=1): student = Student.objects.get(pk=student_id) ContestInlineFormSet = inlineformset_factory(Student, Score,

inlineformset_factory and predefined fields

2012-02-25 Thread eng.Ilian Iliev
I have something like this class Project(models.Model): name = models.CharField() class ProjectFileType(models.Model): name = models.FileField() required = models.BooleanField() class ProjectFile(models.Model): my_file = models.FileField() project =

noob struggling with inlineformset_factory

2011-10-11 Thread trubliphone
er, using the default behavior: class PersonForm(forms.ModelForm): class Meta: model = PersonModel I wind up with the "job" field corresponding to a combobox. I thought that using an inlineformset_factory could solve my problem, but this code: def index(request): Person

custom save method - inlineformset_factory

2011-05-27 Thread rayfidelity
Invoices get saved first... views.py def edit(request, id = None): InvoiceFormSet = inlineformset_factory(Invoices, InvoicesItems) if id == None: initial_data = '' data = Invoices() else: data = get_object_or_404(Invoices, pk=id) initial_data = '' if request.method == 'POST

Re: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Kenny Meyer
Hi Rosemarie, Try a quick google search with terms like "django has no ForeignKey to " and you'll get a bunch of results. I promise. Here's only one of those results: http://stackoverflow.com/questions/609556/django-admin-inlining-foreign-key-issue AFAICS this issue has been discussed various

Re: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
ahh, and class MemberForm(ModelForm): class Meta: model = member exclude = ('password','date_joined','username','is_staff','is_active','last_login','is_superuser','firstAid') it has the class Meta: that's not the problem. Sorry, I'm all over the place here! -- You received this

Re: inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
Oh yeah, and the exact error I am currently getting is Exception at /members/edit/ has no ForeignKey to -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from

inlineformset_factory and many-to-many relationships

2011-04-27 Thread Rosemarie
g, I found info on using inlineformset_factory -Now I'm getting a new error about how the member model doesn't have any fk to the firstAid model (firstAid being the m2m table that I'm trying to relate to) -I'm using a custom intermediate model for firstAid -However, even when I try this with a dif

Re: inlineformset_factory default values

2011-03-30 Thread Nick
that cannot be updated via the form (i.e. {{form.field.value}}) Then it will blank out the value of that field. I don't, however, know how to access these values for use in the template any other way. Here is my view code: CampaignFormSet = inlineformset_factory(Race, Campaign, can_delete=False

inlineformset_factory default values

2011-03-30 Thread Nick
I am using inlineformsets_factory on a form and every time I save those fields that are not made available in the form are overridden to null values on save. How do i get it just to update those fields that are specifically listed in the form? -- You received this message because you are

How to create a dynamic form queryset on using inlineformset_factory?

2010-08-13 Thread carson
#views.py from django.forms.models import inlineformset_factory import models,forms internationalInlineFormSet = inlineformset_factory(models.Listing, models.ListingShippingInternational, max_num=3, form=forms.ListingShippingInternationalForm(site_id='xx')) ### here is my pro

Re: inlineformset_factory - minimum number of completed forms and custom validation

2010-06-19 Thread ALJ
... sorry ... I forgot to use formset.non_form_errors() -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to

inlineformset_factory - minimum number of completed forms and custom validation

2010-06-19 Thread ALJ
Can anyone point me in the right direction regarding customer validation of forms via an inlineformset_factory? I want to make sure at least one form is completed and that no two forms have the same date. (I have to admit, I'm getting confused by how all the different classes relate to each other

Re: How to manually render a Django template for an inlineformset_factory with can_delete = True / False

2010-04-15 Thread chefsmart
Makes sense. Thanks. On Apr 15, 7:03 pm, Tom Evans wrote: > On Thu, Apr 15, 2010 at 2:00 PM, chefsmart wrote: > > Thanks for that tip. > > > I can guess what empty_permitted is, but could you explain how > > empty_permitted is related to

Re: How to manually render a Django template for an inlineformset_factory with can_delete = True / False

2010-04-15 Thread Tom Evans
On Thu, Apr 15, 2010 at 2:00 PM, chefsmart wrote: > Thanks for that tip. > > I can guess what empty_permitted is, but could you explain how > empty_permitted is related to can_delete? I couldn't find it in the > docs, and such relationship is not apparent from the code. >

Re: How to manually render a Django template for an inlineformset_factory with can_delete = True / False

2010-04-15 Thread chefsmart
t; On Thu, Apr 15, 2010 at 6:45 AM, chefsmart <moran.cors...@gmail.com> wrote: > > Hi, > > > I have an inlineformset with a custom Modelform. So it looks something > > like this: > > > MyInlineFormSet = inlineformset_factory(MyMainModel, MyInlineModel, > >

Re: How to manually render a Django template for an inlineformset_factory with can_delete = True / False

2010-04-15 Thread Tom Evans
On Thu, Apr 15, 2010 at 6:45 AM, chefsmart <moran.cors...@gmail.com> wrote: > Hi, > > I have an inlineformset with a custom Modelform. So it looks something > like this: > > MyInlineFormSet = inlineformset_factory(MyMainModel, MyInlineModel, > form=MyCustomInlineMo

How to manually render a Django template for an inlineformset_factory with can_delete = True / False

2010-04-14 Thread chefsmart
Hi, I have an inlineformset with a custom Modelform. So it looks something like this: MyInlineFormSet = inlineformset_factory(MyMainModel, MyInlineModel, form=MyCustomInlineModelForm) I am rendering this inlineformset manually in a template so that I have more control over widgets

Re: Use admin widgets in inlineformset_factory

2010-03-30 Thread Paulo Almeida
orms.py file > > > --- > # -*- coding: utf-8 -*- > from django.contrib.admin.widgets import FilteredSelectMultiple > from django.forms.models import inlineformset_factory > from django.forms.models import BaseInlineFormSet > > from django.forms import ModelForm > from django import forms &

Use admin widgets in inlineformset_factory

2010-03-29 Thread Fredrik
Hi, I have this forms.py file --- # -*- coding: utf-8 -*- from django.contrib.admin.widgets import FilteredSelectMultiple from django.forms.models import inlineformset_factory from

Re: inlineformset_factory widgets

2010-02-19 Thread FadeOUT
rmset_factoryto generate a > form for the "child" of the pair - which is all well and good, but the > text fields that it produces are too large to fit on the screen. > Surely this should be simple?? > > I tried passing a form, thus: > >     companycontactformsetf

inlineformset_factory widgets

2010-02-17 Thread FadeOUT
Hi, Is it possible to override the default widgets generated by an inlineformset_factory? I have a couple of models and an inlineformset_factory to generate a form for the "child" of the pair - which is all well and good, but the text fields that it produces are too large to fit on

Re: Inlineformset_factory and User model

2009-12-02 Thread Frank DiRocco
ame :] -Frank On Dec 2, 2009, at 8:06 AM, saved...@gmail.com wrote: > Hello All! > I am trying to have my users post multiple books via > Inlineformset_factory. Basically, I am unable to do that > automatically via the following code without having them select their > name. I ge

Inlineformset_factory and User model

2009-12-02 Thread saved...@gmail.com
Hello All! I am trying to have my users post multiple books via Inlineformset_factory. Basically, I am unable to do that automatically via the following code without having them select their name. I get an error saying that 'User has no attribute 'get''. Any help is much appreciated. Ken

Re: Passing Parameter to form in inlineformset_factory

2009-10-25 Thread Andew Gee
Thanks for the help. I did find this as a solution ad it seems to work Formset = inlineformset_factory(ModelA, ModelB form=MyForm) Formset.form = staticmethod(curry(MyForm, reaOnly=readOnlyvalue)) myFormset = Formset(request.Files, instance=modelAInst) Regards Andrew Andew Gee wrote: >

Re: Passing Parameter to form in inlineformset_factory

2009-10-23 Thread chefsmart
= inlineformset_factory(ModelA, ModelB , form=yourdynamicform) # # # On Oct 23, 4:30 am, Andew Gee <gee.webm...@gmail.com> wrote: > Hi, > > I have the following Form defined > > class MyForm(ModelForm) > >   def __init__(self, readOnly=False, *args, **kwargs): >  

Re: Passing Parameter to form in inlineformset_factory

2009-10-23 Thread pjrhar...@gmail.com
Try using a lambda function. The problem is that the factory wants a callable that creates a form, not a form instance (ie it wants to be able to execute MyForm() for each form in the formset. Formset = inlineformset_factory(ModelA, ModelB form=lambda: MyForm (readOnly=True)) Note I've

Passing Parameter to form in inlineformset_factory

2009-10-22 Thread Andew Gee
=ModelA) but when I try to use it in the inlineformset_factory I get the error NoneType object is not callable. I know the problem id the way I am using the MyForm in the inline call because I get the same error if I do either of the following Formset = inlineformset_factory(ModelA, ModelB form=MyForm

Re: inlineformset_factory and changing data set in form

2009-09-14 Thread dimitri pater - serpia
view: > publ = Publisher.object.get(pk=publisher_id) > BooksInlineFormSet = inlineformset_factory(Publisher, Book, extra=1) > formset = BooksInlineFormSet(instance=publ) > > formset returns the saved formset(s) and an empty form > ie formset.forms[1]['author'] returns a html with all authors. &g

Re: inlineformset_factory and changing data set in form

2009-09-14 Thread V
0) > > class Book(models.Model): >     publisher = models.ForeignKey(Publisher)     >     author = models.CharField(max_length=1, choices=CH_AUTH) >     title = models.CharField(max_length=100) > > in a view: > publ = Publisher.object.get(pk=publisher_id) > BooksInlin

inlineformset_factory and changing data set in form

2009-09-14 Thread dimitri pater - serpia
, choices=CH_AUTH) title = models.CharField(max_length=100) in a view: publ = Publisher.object.get(pk=publisher_id) BooksInlineFormSet = inlineformset_factory(Publisher, Book, extra=1) formset = BooksInlineFormSet(instance=publ) formset returns the saved formset(s) and an empty form ie

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 7:36 PM, Geraldo wrote: > > No, I mean two or more different forms.  I'd like Parent, Child1 AND > Child2 all in the same formset.  What you've suggested though, should > get me where I want to go. > Well, you can easily show the input fields from

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Geraldo
009 at 12:51 AM, Geraldo<quakingd...@gmail.com> wrote: > > > Excellent, Matthias...  That should work nicely.  It does appear, > > however, that there is no way to have more than 2 forms in a single > > formset.  If inlineformset_factory had an append method things might

Re: More Than Two Models With inlineformset_factory

2009-08-12 Thread Matthias Kestenholz
On Wed, Aug 12, 2009 at 12:51 AM, Geraldo<quakingd...@gmail.com> wrote: > > Excellent, Matthias...  That should work nicely.  It does appear, > however, that there is no way to have more than 2 forms in a single > formset.  If inlineformset_factory had an append method thing

Re: More Than Two Models With inlineformset_factory

2009-08-11 Thread Geraldo
Excellent, Matthias... That should work nicely. It does appear, however, that there is no way to have more than 2 forms in a single formset. If inlineformset_factory had an append method things might be a bit cleaner. Thanks again for your help. geraldo On Aug 11, 3:55 pm, Matthias

Re: More Than Two Models With inlineformset_factory

2009-08-11 Thread Matthias Kestenholz
.ForeignKey(Author) >    address = models.CharField(max_length=100) > > class Child2(models.Model): >    name = models.ForeignKey(Author) >    gender = models.CharField(max_length=8) > > # so I can do this to get a formset with Parent and Child1 > Formset1 = inlineforms

More Than Two Models With inlineformset_factory

2009-08-11 Thread Geraldo
rField(max_length=8) # so I can do this to get a formset with Parent and Child1 Formset1 = inlineformset_factory(Parent, Child1) dad = Parent.objects.get(name=u'Popeye') formset = Formset1(instance=dad) # or this to get a formset with Parent and Child2 Formset2 = inlineformset_factory(Parent, Child

Re: inlineformset_factory multiple models error.

2009-07-09 Thread Karen Tracey
d(max_length=500) > > class Attachment(models.Model): >ticket_id = models.ForeignKey(Ticket) >attach_title = models.CharField("Title", max_length=30, > blank=True, null=True) > > Views > -- > def edit(request, ticket_id): > ticket = get_object_or_4

inlineformset_factory multiple models error.

2009-07-09 Thread jai_python
ngth=30, blank=True, null=True) Views -- def edit(request, ticket_id): ticket = get_object_or_404(Ticket, pk=ticket_id) TickFomset=inlineformset_factory(Ticket,Comment,Attachment)# error arise in this line. formset=TickFomset(instance=ticket) Error:

Re: inlineformset_factory and modelforms

2009-06-28 Thread chefsmart
Thanks, that clears my doubts! I was thinking that somehow the inlineformset_factory would be able to take in the modelform for the parent model as well as the modelform for the model we intend to edit inline; and then I would be able to display them together like in the admin. I was obviously

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
ModelForm). > > I can do MyFormSet = inlineformset_factory(Author, Book, > form=BookModelForm) > > But is it possible to use the AuthorModelForm also? > > Regards, > CM. > > On Jun 29, 9:40 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > > On Sun, Jun

Re: inlineformset_factory and modelforms

2009-06-28 Thread chefsmart
Hi Alex, If we take the example from the documentation, let's say I have modelforms for both Author and Book. So there is an AuthorModelForm (ModelForm) and also a BookModelForm(ModelForm). I can do MyFormSet = inlineformset_factory(Author, Book, form=BookModelForm) But is it possible to use

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
> > Regards, > CM. > > > > On Jun 29, 9:24 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > > On Sun, Jun 28, 2009 at 11:23 PM, chefsmart <moran.cors...@gmail.com> > wrote: > > > > > Hi, > > > > > The Django document

Re: inlineformset_factory and modelforms

2009-06-28 Thread chefsmart
at 11:23 PM, chefsmart <moran.cors...@gmail.com> wrote: > > > Hi, > > > The Django documentation gives the following example for > > inlineformset_factory: - > > > BookFormSet = inlineformset_factory(Author, Book) > > > This can be found on > &

Re: inlineformset_factory and modelforms

2009-06-28 Thread Alex Gaynor
On Sun, Jun 28, 2009 at 11:23 PM, chefsmart <moran.cors...@gmail.com> wrote: > > Hi, > > The Django documentation gives the following example for > inlineformset_factory: - > > BookFormSet = inlineformset_factory(Author, Book) > > This can be found on > http://

inlineformset_factory and modelforms

2009-06-28 Thread chefsmart
Hi, The Django documentation gives the following example for inlineformset_factory: - BookFormSet = inlineformset_factory(Author, Book) This can be found on http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#inline-formsets However, if I have custom modelforms for Author and Book

inlineformset_factory causing some KeyError whackiness.

2009-06-14 Thread Bartek
Hi, I am trying to use the inlineformset_factory on an odd model I have created. Here's the best way I can describe it: class Base(models.Model): title = models.CharField(max_length=55) def save(self, *args, **kwargs): if self.is_editable(): # do a bunch of things

inlineformset_factory ordering

2009-04-01 Thread Paddy Joy
Is it possible to order the forms in an inlineformset_factory? I have tried ordering the forms in the template using the following but I still see a different order everytime I refresh the page. {% for form in formset.initial_forms|dictsort:"id" %} I'm on SVN 10361. Anyone any ide

Re: inlineformset_factory. how to get pk of parent model without saving.

2009-03-26 Thread igor.potapenko
btw, if I leave instance = None, I got an list index out of range here: http://dpaste.com/hold/19039/ full example. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

inlineformset_factory. how to get pk of parent model without saving.

2009-03-26 Thread igor.potapenko
() question = models.TextField() class Choice(models.Model): question = models.ForeignKey('Question') description = models.CharField(max_length=255) class QuestionForm(forms.ModelForm): class Meta: model = Question ChoiceQuestionFormSet = inlineformset_factory (Question

Re: I may have found a bug in inlineformset_factory vicinity

2009-02-10 Thread Karen Tracey
## The mostly relevent part of views.py: > > from django.forms.models import inlineformset_factory > @login_required > def pickup(request): >try: >profile = request.user.get_profile() >except: >return HttpResponseRedirect('/profile/') >

Re: inlineformset_factory KeyError after updating

2009-01-06 Thread Alistair Marshall
2009/1/6 : > The problem is this bit in main_form.html, around line 37: > > {% ifnotequal field.label "Id" %} > {{ field }} > {% endifnotequal %} > > The omitted ID is causing your KeyError; leave it in the form. > Excellent, It had been removed to

Re: inlineformset_factory KeyError after updating

2009-01-06 Thread john
On Jan 6, 2009, at 4:18 AM, Alistair Marshall wrote: > When creating a new feed unit the system works fine. However if you go > and edit an existing feed unit, an error gets thrown when saving the > form. The problem is this bit in main_form.html, around line 37: {% ifnotequal field.label

Re: inlineformset_factory KeyError after updating

2009-01-06 Thread Alistair Marshall
I have created a cut down version of my project and placed it on my website [1] The project was part of a pinax project, though I have ripped out the main app and made it stand alone. As a result there is no facility to login or manage accounts. I have commented out or removed all parts of

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Alistair Marshall : Upgraded to 1.0.2 I'll try and create a cut down version-that may take some time (it is getting to be a large project) Thanks -- Alistair Marshall www.thatscottishengineer.co.uk

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 11:33 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > 2009/1/5 Karen Tracey : > > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead > of > > 1.0. There have been additional fixes in this area that you may need, > >

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
2009/1/5 Karen Tracey : > First, I would try 1.0.2 release or current trunk or 1.0.X branch instead of > 1.0. There have been additional fixes in this area that you may need, > depending on what you are doing. > Just upgraded now - no difference > If that doesn't fix it,

Re: inlineformset_factory KeyError after updating

2009-01-05 Thread Karen Tracey
On Mon, Jan 5, 2009 at 10:01 AM, Alistair Marshall < runninga...@googlemail.com> wrote: > > I appear to be having the same trouble as explained in a previous > thread [1] (and for some reason cant find the button to reply to the > last thread ???) > > The other thread points to a bug that was

inlineformset_factory KeyError after updating

2009-01-05 Thread Alistair Marshall
I appear to be having the same trouble as explained in a previous thread [1] (and for some reason cant find the button to reply to the last thread ???) The other thread points to a bug that was fixed before django 1.0 (which is what I am running) I am not (intentionally) doing anything funny

Re: inlineformset_factory with a custom widget for a field

2008-12-18 Thread Cortland Klein
> answer: > > def my_formfield_cb(field): >if isinstance(field, models.FileField) and field.name == 'file': >return fields.FileField(widget = AdminFileWidget(attrs={'url': > "/my/url/"})) >return field.formfield() > > FileFormSet = inlineforms

Re: inlineformset_factory with a custom widget for a field

2008-12-18 Thread Daniel Roseman
On Dec 18, 7:18 pm, Cortland Klein <cortl...@apple.com> wrote: > I'm using inlineformset_factory in one of my views, which is working   > great, except now I'd like to change the widget for one of the fields   > (in case anyone's curious, an AdminFileWidget). For clarification thi

Re: inlineformset_factory with a custom widget for a field

2008-12-18 Thread panta
.formfield() FileFormSet = inlineformset_factory(Version, File, extra=1, formfield_callback = my_formfield_cb) formSet = FileFormSet() Marco On Dec 18, 8:18 pm, Cortland Klein <cortl...@apple.com> wrote: > I'm using inlineformset_factory in one of my views, which is working > great, except

Re: inlineformset_factory with a custom widget for a field

2008-12-18 Thread panta
I've never used inlineformset_factory(), but I guess you can use the formfield_callback parameter. For example: def my_formfield_cb(field): if condition_on_field(field): return SuitableFormField(widget = MyCustomWidget()) return field.formfield() FileFormSet

inlineformset_factory with a custom widget for a field

2008-12-18 Thread Cortland Klein
I'm using inlineformset_factory in one of my views, which is working great, except now I'd like to change the widget for one of the fields (in case anyone's curious, an AdminFileWidget). For clarification this is my own view and has nothing to do with contrib/admin. I see

Possible to use raw_admin_fields with inlineformset_factory for a create page?

2008-12-03 Thread Paul Childs
h=30) <><><><><><><><><> Forms - DocumentForm(ModelForm): class Meta: model = Document <><><><><><><><><><><> If the user visits the

Re: inline forms/subforms: how to use inlineformset_factory ?

2008-12-02 Thread Dominic Ashton
> > I did read this documentation, and was confused because I read this: > > >>> from django.forms.models import inlineformset_factory > >>> BookFormSet = inlineformset_factory(Author, Book) > >>> author = Author.objects.get(name=u'Orson Scott Card'

Re: inline forms/subforms: how to use inlineformset_factory ?

2008-12-02 Thread Dominic Ashton
> > Did you happen to read the official Django documentation on model > formsets? In model formsets there are two factory functions. > modelformset_factory and inlineformset_factory. The latter is a subset > of the former and makes it easier to work with related objects through

Re: inline forms/subforms: how to use inlineformset_factory ?

2008-11-29 Thread Brian Rosner
t book > inline forms/sub forms are not covered outside of the Admin. In fact, > when I tend to find any information it is usually somebody trying to > extend the functionality in the admin, which I am not trying to do. > > What I did come up with was to find inlineformset_factory. Thi

inline forms/subforms: how to use inlineformset_factory ?

2008-11-29 Thread Dominic Ashton
of the Admin. In fact, when I tend to find any information it is usually somebody trying to extend the functionality in the admin, which I am not trying to do. What I did come up with was to find inlineformset_factory. This seems to be what i'm after, but it's proving tricky to find a clear and simple

Re: problem with inlineformset_factory

2008-11-27 Thread Karen Tracey
On Thu, Nov 27, 2008 at 3:14 PM, Yanik <[EMAIL PROTECTED]> wrote: > > I'm using MySQL and running 1.0.2 and the bug is still there. > > This ticket: > http://code.djangoproject.com/ticket/9039 > > is closed, but the code still hasn't been fixed and the mentioned > patch doesn't seem to work. > >

Re: problem with inlineformset_factory

2008-11-27 Thread Yanik
I'm using MySQL and running 1.0.2 and the bug is still there. This ticket: http://code.djangoproject.com/ticket/9039 is closed, but the code still hasn't been fixed and the mentioned patch doesn't seem to work. Has anyone gotten this to work? On Nov 24, 8:23 pm, boardman <[EMAIL PROTECTED]>

Re: problem with inlineformset_factory

2008-11-24 Thread boardman
As noted in a duplicate post over on django-devs this problem is not evident when using the sqlite backend. The problem seems to be limited to the postgres backend and is cuurently still failing for me on trunk at revision 9526. Roger. On Nov 8, 3:51 pm, Petry <[EMAIL PROTECTED]> wrote: > Hi

Re: inlineformset_factory: shows only 1 extra even extra=5

2008-11-24 Thread Rajesh Dhawan
> I'm trying to make use inlineformset_factory to add several data on an > object at the sime time. I want to show 5 extra forms but when I view > it in browser it only shows 1formsets instead of 5. > > Here's my view code: > formset = inlineformset_factory(PackagingRep

inlineformset_factory: shows only 1 extra even extra=5

2008-11-23 Thread izzy
I'm trying to make use inlineformset_factory to add several data on an object at the sime time. I want to show 5 extra forms but when I view it in browser it only shows 1formsets instead of 5. Here's my view code: formset = inlineformset_factory(PackagingReport, PeopleProblem, max_num=0

Re: problem with inlineformset_factory

2008-11-08 Thread Petry
Hi Karen! I use the version of SVN, I am currently with version 1.1 pre- alpha-9335 SVN and the error still remains! On 8 nov, 12:02, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Sat, Nov 8, 2008 at 8:56 AM, Petry <[EMAIL PROTECTED]> wrote: > > > somebody can help me? > > I didn't

Re: problem with inlineformset_factory

2008-11-08 Thread Karen Tracey
On Sat, Nov 8, 2008 at 8:56 AM, Petry <[EMAIL PROTECTED]> wrote: > > somebody can help me? > I didn't recommend changing your code, I recommending trying with current SVN level of the 1.0.X branch or trunk, in order to ensure you have a fix that might be relevant (I still have not had time to

Re: problem with inlineformset_factory

2008-11-08 Thread Petry
somebody can help me? On 7 nov, 13:24, Petry <[EMAIL PROTECTED]> wrote: > I changed my template model to use OneToOneField and remove the > Blank=True, but the same error appears... > > On 7 nov, 12:30, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > > > On Fri, Nov 7, 2008 at 9:10 AM, Daniel

Re: problem with inlineformset_factory

2008-11-07 Thread Petry
gt; > > On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > I'm having a weird problem when using inlineformset_factory, he can > > > only register up to 2 records, after that causes a validation error > > > > "(Hidden field i

Re: problem with inlineformset_factory

2008-11-07 Thread Karen Tracey
On Fri, Nov 7, 2008 at 9:10 AM, Daniel Roseman < [EMAIL PROTECTED]> wrote: > > On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I'm having a weird problem when using inlineformset_factory, he can > > only register up to 2 rec

Re: problem with inlineformset_factory

2008-11-07 Thread Daniel Roseman
On Nov 4, 6:02 pm, Petry <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm having a weird problem when using inlineformset_factory, he can > only register up to 2 records, after that causes a validation error > > "(Hidden field id) User phone with this None already exi

Re: problem with inlineformset_factory

2008-11-07 Thread Petry
anyone? On 4 nov, 16:02, Petry <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm having a weird problem when usinginlineformset_factory, he can > only register up to 2 records, after that causes a validation error > > "(Hidden field id) User phone with this None already exists." > > Here is my forms

  1   2   >