AndrewIngram / django-extra-views

Django's class-based generic views are awesome, let's have more of them.
MIT License
1.39k stars 172 forks source link

ModelFormSetView "sometimes" deletes row? #211

Open faulander opened 4 years ago

faulander commented 4 years ago

i have a flat table with only one row, which represent the settings of my app. this is the declaration:

class SettingsFormSetView(ModelFormSetView):
    model = Setting
    fields = ['profile', 'addmonitored', 'seasonfolders']
    template_name = 'settings.html'
    factory_kwargs = {'extra': 0}

i have another field in the table called "page" which is updated in one other place:

    page -= 2
    S = Setting.objects.get(pk=1)
    S.page = page
    S.save()

So nothing wrong there, it works. I can open the form, change values, the page works as intended. All other references to the Settings table are "get" only.

But sometimes suddenly the table row is empty and i cannot figure out why?