You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, new to python/wagtail/django, probably a silly question, but maybe someone could give an advice.
For example, I have a page model, that has foreign key to another model, which acts as a template for the page (slug, title, other fields...). When user creates a page, they must select a template, and on save, default values from the template are set to the page. Is there a simple way of doing that? Somehow hook into (or override) CreateView Form, and on POST request (before form validation), check that template is selected and set values from it to the page. Or maybe there is more proper way of doing this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, new to python/wagtail/django, probably a silly question, but maybe someone could give an advice.
For example, I have a page model, that has foreign key to another model, which acts as a template for the page (slug, title, other fields...). When user creates a page, they must select a template, and on save, default values from the template are set to the page. Is there a simple way of doing that? Somehow hook into (or override) CreateView Form, and on POST request (before form validation), check that template is selected and set values from it to the page. Or maybe there is more proper way of doing this?
Beta Was this translation helpful? Give feedback.
All reactions