gerosalesc
gerosalesc

Reputation: 3063

Create new in a Flask-admin foreign key field like Django-Admin

Let's say we have models A and B and the relation 1 - N therefore model B has an foreign key field named 'a'. Then I write a model view with this configuration:

class BAdmin(ModelView):
    ...
    form_rules = ('a',)

Having this configured I see that a select list is generated with all the entries of entity A but I would be a handful to have a link to create view for entity A next to the list pretty much like Django admin's default behavior.

Django admin select

Upvotes: 2

Views: 168

Answers (0)

Related Questions