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
Hey guys, I am writeing a feature and meting a problem. here is the situation below, user fill the userinfo form and admin can Review the form and jump to the add acount view. I don't know how and where to add the jump button. I have tried the code below, it only show the text not the html.
class MySubmissions(AbstractFormSubmission):
def get_data(self):
"""
Returns dict with form data.
You can override this method to add additional data.
"""
form_data = super(MySubmissions, self).get_data()
form_data["add_account_href"] = "<button><a href='/admin/users/add?info=xxx'</a></button>"
return form_data
class JoinUsFormPage(CoderedFormPage):
class Meta:
verbose_name = "成为会员表单页"
template = "coderedcms/pages/form_page.html"
def get_submission_class(self):
return MySubmissions
def get_data_fields(self):
"""
Returns a list of tuples with (field_name, field_label).
"""
data_fields = super().get_data_fields() + [("add_account_href", "添加账户")]
return data_fields
Please help me, thank you
The text was updated successfully, but these errors were encountered:
If not can you share what the template looks like? Instead of putting the html inside the form_data, might be better to store the href and do something like this in the template. <button><a href="{{ add_account_url }}"></a></button> where add_account_ url is the /admin/users/add?info=xxx you are storing in form_data
Hey guys, I am writeing a feature and meting a problem. here is the situation below, user fill the userinfo form and admin can Review the form and jump to the add acount view. I don't know how and where to add the jump button. I have tried the code below, it only show the text not the html.
Please help me, thank you
The text was updated successfully, but these errors were encountered: