Re: Issue in rendering of Inline forms on Django Admin site

2021-12-01 Thread Gabo LaTo
l > fields = ['text', ] > inlines = [RelatedModelInlineTabular] > > > > El lun, 29 de nov. de 2021 a la(s) 20:28, 'Andrea Arighi' via Django users > (django-users@googlegroups.com) escribió: > >> Good evening, >> I am encountering a weird bug wh

Re: Issue in rendering of Inline forms on Django Admin site

2021-12-01 Thread Gabo LaTo
via Django users ( django-users@googlegroups.com) escribió: > Good evening, > I am encountering a weird bug when rendering Inline forms on the "Add" > view of a ModelAdmin. > > Here is a minimum example with Django version 2.2.4 > > - - - - - - - > > in models.py:

Issue in rendering of Inline forms on Django Admin site

2021-11-29 Thread 'Andrea Arighi' via Django users
Good evening, I am encountering a weird bug when rendering Inline forms on the "Add" view of a ModelAdmin. Here is a minimum example with Django version 2.2.4 - - - - - - - in models.py: class MyModel(models.Model): text = models.CharField(max_length=100) class RelatedModel(mo

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Please forget about the persisting data part. The problem is that inside the parent form i dont have access to the related data and the formsets new related data is validated after the parent models data. Inside the formset every related data model does not have access to the other related inst

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
I still don't understand why you want to persist unvalidated data to the db then? if a user requests the data in mid-update, that's something that can be handled with transaction locks on the db. so when that happens, the request will wait till the locks are released before executing the db qu

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Am Sonntag, 26. August 2018 18:29:49 UTC+2 schrieb Jason: > > I think we're missing a few things. how fast does this query with updated > values execute after the form submits? > a neglectable amount of milliseconds > if you need to return the value back to the view, can't you do some sort

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
I think we're missing a few things. how fast does this query with updated values execute after the form submits? if you need to return the value back to the view, can't you do some sort of post-save retrieval and form populate? -- You received this message because you are subscribed to the Go

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
Am Sonntag, 26. August 2018 18:07:25 UTC+2 schrieb Jason: > > why would you want to persist unvalidated data to your db? > >> >> Well, i dont necessarily have to, but i somehow need to be able to perform a query with all updated data taken into account. The easiest solution i came up with is pu

Re: How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Jason
why would you want to persist unvalidated data to your db? On Sunday, August 26, 2018 at 10:42:28 AM UTC-4, Andy wrote: > > I want to execute a check after the related data from the admin has been > saved, but the default clean methods get executed before the formsets are > saved. Where could i

How to clean a model after the related models inline forms have been saved?

2018-08-26 Thread Andy
I want to execute a check after the related data from the admin has been saved, but the default clean methods get executed before the formsets are saved. Where could i place my check to have access to a full version of what has been changed on the admin page? -- You received this message becau

Django admin inline forms

2014-03-26 Thread Andreas Kuhne
Hi all, I have 2 models that look something like this: class Address(models.Model): address_row1 = models.CharField(max_length=200, null=True, blank=True) address_row2 = models.CharField(max_length=200, null=True, blank=True) postal_code = models.CharField(max_length=30, null=True, bl

Re: Inline forms

2010-07-21 Thread Ramesh
gt; >> formset.http://docs.djangoproject.com/en/1.2/topics/forms/formsets/#topics-fo... > > >> If you want those forms to represent models, then you want a model > >> formset.http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/#id1 > > >> Hope that he

Re: Inline forms

2010-07-21 Thread Alex Robbins
dels, then you want a model >> formset.http://docs.djangoproject.com/en/1.2/topics/forms/modelforms/#id1 >> >> Hope that helps! >> Alex >> >> On Jul 20, 1:00 pm, Ramesh wrote: >> >> >> >> > Hi, >> >> > I would like to h

Re: Inline forms

2010-07-21 Thread Ramesh
! > Alex > > On Jul 20, 1:00 pm, Ramesh wrote: > > > > > Hi, > > > I would like to have inline forms for my project (not admin site) as > > shown in django tutorials "Writing your first Django app, part > > 2",http://docs

Re: Inline forms

2010-07-21 Thread Alex Robbins
that helps! Alex On Jul 20, 1:00 pm, Ramesh wrote: > Hi, > > I would like to have inline forms for my project (not admin site) as > shown in django tutorials "Writing your first Django app, part > 2",http://docs.djangoproject.com/en/dev/intro/tutorial02/ > > Her

Inline forms

2010-07-20 Thread Ramesh
Hi, I would like to have inline forms for my project (not admin site) as shown in django tutorials "Writing your first Django app, part 2", http://docs.djangoproject.com/en/dev/intro/tutorial02/ Here is the form image url: http://docs.djangoproject.com/en/dev/_images/admin12.png

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-05 Thread mrts
Patch has been uploaded to http://code.djangoproject.com/ticket/12780 . After applying the patch you can override def formsets_are_valid(self, formsets, form, form_is_valid, instance, request): and do any complex validation you like. As it's rather arcane, I've provided an exampl

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-02-04 Thread mrts
See http://code.djangoproject.com/ticket/12780 . I will upload a patch and provide an example, but I can't yet say when. Best, Mart Sõmermaa On Jan 15, 8:10 pm, Gabriel Reis wrote: > Hey Marcos, > > In the clean() method of my ClipModelForm class I couldn't manage how to > reach the ClipDescrip

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-01-15 Thread Gabriel Reis
Hey Marcos, In the clean() method of my ClipModelForm class I couldn't manage how to reach the ClipDescriptions that are coming from the inline ClipDescriptionInline. I think I can't validate there. I spent the whole day trying and I couldn't fix. Any help would be very handy! Thanks for your ate

Re: Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-01-15 Thread Marco Rogers
I've never had to do this but it sounds you want to work with Form.clean() in stead of Form.clean_is_approved(). From the docs: "The Form subclass’s clean() method. This method can perform any validation that requires access to multiple fields from the form at once." So in your clean method

Problem when trying to validate a field in a ModelAdmin which has inline forms

2010-01-14 Thread Gabriel Reis
Hi people, I am having some problem to validate a data in my application. I will try to simply the model in here to help you guys to understand the problem. I have 2 models: class Clip(models.Model): is_approved = models.BooleanField(default=False) language = models.ForeignKey(Language)

Custom widgets in the admin for inline forms

2009-01-09 Thread AndyB
Hi, Has anyone got any pointers? I'm not even sure where to begin. For non- inlines I'm doing: def formfield_for_dbfield(self, db_field, **kwargs): if db_field.name == 'photo': kwargs['widget'] = AdminImageWidget() return db_field.formfield(**kwargs) r

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') > >>> formset = BookFormSet(instance=author >

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 > a foreign key. T

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

2008-11-29 Thread Brian Rosner
On Sat, Nov 29, 2008 at 4:00 AM, Dominic Ashton <[EMAIL PROTECTED]> wrote: > I have been searching this mailing list, and google, all day and have > come up with very little. I read through the form chapter in Apress > Practical Django Projects (chapter 9) and unbeleivbly in tha

inline forms/subforms: how to use inlineformset_factory ?

2008-11-29 Thread Dominic Ashton
I am attempting to do this on my pages aimed at users. I have been searching this mailing list, and google, all day and have come up with very little. I read through the form chapter in Apress Practical Django Projects (chapter 9) and unbeleivbly in that book inline forms/sub forms are not covered outsi

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
Thank you thank you thank you! I knew I was doing something simple wrong. :) I've been enjoying my experience using Django so far, but one thing I have noticed is that the error messages (or in this case lack of error messages) can be frustrating. It sometimes takes me quite a while to figure out

Re: Frustration with custom Inline forms

2008-11-17 Thread Daniel Roseman
On Nov 17, 2:01 pm, Ben Gerdemann <[EMAIL PROTECTED]> wrote: > Ok, so I just noticed that the a55_id field which is the primary key, > was declared as an IntegerField instead of an AutoField which is why > it was showing up on the inline form, but I still can't get any of the > other fields exclud

Re: Frustration with custom Inline forms

2008-11-17 Thread Kip Parker
There's a problem with the exclude statements above, you've got tuple- trouble, missing trailing commas: exclude = ('a55_id') should be ('a55_id',) or ['a55_id'] easy mistake, search for "tuple" in this group and you'll see you have company. Kip. On Nov 17, 2:01 pm, Ben Gerdemann <[EMAIL PR

Re: Custom Inline Forms with InlineFormsets

2008-11-17 Thread Ben Gerdemann
I'm having a similar problem that I posted about here: http://groups.google.com/group/django-users/browse_thread/thread/bb4c792f13b2eceb# Did you find a solution that works for you? Sorry, I couldn't figure out from your post exactly what you did. I tried using inlineformset_factory() like you d

Re: Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
Ok, so I just noticed that the a55_id field which is the primary key, was declared as an IntegerField instead of an AutoField which is why it was showing up on the inline form, but I still can't get any of the other fields excluded from the inline form so the problem is still there. Also, if it h

Frustration with custom Inline forms

2008-11-17 Thread Ben Gerdemann
I'm trying to customize the inline forms of a model that are displayed when I'm editing it's parent, but I can't get anything to work! Can someone help? First, here are my models: class T22Pais(models.Model): a22_id = models.AutoField(primary_key=True) a22_nome_1 = mo

Re: Custom Inline Forms with InlineFormsets

2008-11-10 Thread John Boxall
I take it back. I over thought it - Instead of using a custom inline form model just pass the parameters directly to inlineformset_factory as per it's spec: def inlineformset_factory(parent_model, model, form=ModelForm, formset=BaseInlineFormSet, fk_name=None,

Custom Inline Forms with InlineFormsets

2008-11-10 Thread John Boxall
Heyo Django Users, I'm in a bit of a pickle with InlineFormsets - I'm following the example at the Django Docs: http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#using-inlineformset-factory I've got two models: class Author(models.Model): name = models.CharF