Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create button in modal #11

Open
markfinger opened this issue Jul 30, 2018 · 2 comments
Open

Create button in modal #11

markfinger opened this issue Jul 30, 2018 · 2 comments

Comments

@markfinger
Copy link

Hi.

Just wondering if you'd be open to a PR that added control over the display and href of a "Create" button within the instance-selection modal? Off the top of my head, I'm thinking of something like

def create_url(request):
    return '...'

@register_model_chooser(create_url=create_url)
class Foo(models.Model):
    # ...

I'm totally open to any suggestions you might have around the API, etc.

We'll need this functionality on a project, so if you're open to it, I can justify spending another hour or two to make it less hacky and send a PR. No worries, if you're reluctant or not enthused by the idea.

Cheers,
Mark.

@markfinger
Copy link
Author

markfinger commented Jul 30, 2018

Small aside: my implementation suggestion was made under the assumption that the modal would have a "Create" button, but it's entirely feasible that it might appear elsewhere within the UI. If so, I'd imagine that the wiring may occur at the field definition within the panel declaration.

@seb-b
Copy link
Member

seb-b commented Nov 25, 2020

Hey I know I'm entirely too late, I just stumbled across your instance-selector which brought me back here. Looks like a good project!

If anyone else is looking into this, I'm definitely open to the idea of a create new link, they can usually be inferred if modeladmin is being used too which makes it nice and easy to generate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants