Giter VIP home page Giter VIP logo

Comments (3)

sdolemelipone avatar sdolemelipone commented on July 17, 2024
from extra_views import FormSetView

Hi. The above can be used to render a single formset which is not connected to a model.
Inline formsets only exist for models, as it is the parent model which links the child formsets together.

There isn't a class in this library to do what you've asked.

In order to create a generic view which just has a single form and a few different formsets, create a subclass of django.views.generic.edit.FormView which has all the same methods as ProcessFormWithInlinesView and ModelFormWithInlinesMixin, with all references to models removed.

Formsets would be represented using BaseFormSetFactory instances. If access to the request object was needed, you'd need to do something like InlineFormSetFactory.

from django-extra-views.

typonaut avatar typonaut commented on July 17, 2024

Thanks. Would a class, as my request, be useful in Extra Views, or is it a little too niche?

from django-extra-views.

sdolemelipone avatar sdolemelipone commented on July 17, 2024

In my opinion, it probably is too niche. The objective of this package is to replicate the functionality of the Django Admin in generic views and it is outside of that. I also think the formsetfactory constructor classes like BaseFormSetFactory and InlineFormSetFactory aren't intuitive to new users and adding more would make the package less comprehensible.

From my personal experience in writing django apps, this has only come up once and it's just simpler to write either a one-off CBV or even a functional view to handle multiple formsets.

from django-extra-views.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.