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

Move logic to view level instead forms #2

Open
jarus opened this issue Feb 23, 2014 · 1 comment
Open

Move logic to view level instead forms #2

jarus opened this issue Feb 23, 2014 · 1 comment

Comments

@jarus
Copy link

jarus commented Feb 23, 2014

Hi,

maybe it would be useful to move the logic from the form into views for example with a class-based-view mixin. This would allow to use the request object to build full urls etc. How do you feel about this?

@arneb
Copy link
Owner

arneb commented Feb 24, 2014

Providing mixins for CBVs generally sounds like a good idea, but ...

I'll have to think a bit more about this whole idea, because having all the logic at the form makes it possibible to use the DeferedForms in other apps, without modifying the apps. For example: You can use one these forms in the Django Admin. Moving the logic into View-Mixins means a lot of modifications for all applications, which are not CBV based ...

Can the construction of fully qualified urls be solved with: Site.objects.get_current_site()?

Maybe the form save() method should accept kwargs and pass them to the notification method/handler, so that you can decide to pass a request object into it and have access to it during notification construction?

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

No branches or pull requests

2 participants