0

I do not add one post. Write me it: Exception Type: IntegrityError Exception Value: NOT NULL constraint failed: video_url.p_id

I use it in admin.py:

....
....
def save_formset(self, request, form, formset, change):
    ...
    super(ArticlesAdmin, self).save_formset(request, form, formset, change)

if clear super(ArticlesAdmin, self).save_formset(request, form, formset, change), then job good.

Help me, please? (Sorry, i bad speak english)

karthikr
  • 97,368
  • 26
  • 197
  • 188
Grey
  • 21
  • 2

2 Answers2

1

I solved it. Just clear:

def save_model(self, request, obj, form, change):
pass
AstroCB
  • 12,337
  • 20
  • 57
  • 73
Grey
  • 21
  • 2
0

This question is answered here Not NULL and here Models NULL

In summary , add these fields to your model

You must create a migration, where you will specify default value for a new field, since you don't want it to be null. If null is not required, simply add null=True and create and run migration.

Community
  • 1
  • 1
user3404455
  • 420
  • 1
  • 3
  • 9