Changes between Version 1 and Version 2 of Ticket #28950


Ignore:
Timestamp:
Dec 20, 2017, 10:56:08 AM (6 years ago)
Author:
tejinderss
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #28950 – Description

    v1 v2  
    11I have models Foo and Bar for example:
    22
     3{{{
    34    class Foo(models.Model):
    45        ....
     
    78        foo = models.OneToOneField(Foo)
    89        required_field = models.CharField(blank=False)
    9 
     10}}}
    1011
    1112and in the admin.py i have:
    1213
     14{{{
    1315    class BarInline(admin.StackedInline):
    1416        model = Bar
     
    1719    class FooAdmin(admin.ModelAdmin):
    1820        inlines = [BarInline]
    19 
     21}}}
    2022
    2123Now the issue is on the save form in admin, if i try to create foo instance without providing any bar data in barinline form, i get error that bar's required field is required and if i make all fields optional, it creates the bar instance anyway without any data. I have played with min_num and max_num but in vain.
Back to Top