django form without any fields -
what trying achieve is:
- user fills in form
- user has option see preview if content provided
- user can accept preview or work on form
my problem when user clicks on preview can pass modelform data , show him. since there no fields in can click on accept publish content. need form deny/accept dialog still related model because have make changes before saving database.
i tried exclude fields , fields=none
i read this solution looks little hacky. formpreview not want because different approach.
is there way create form consists of button? able pass data view view, in worst case hasnt modelform.
i found solution fits needs: take any_field
, make hidden field:
from django.forms import hiddeninput class mymodelform(modelform): class meta: model = mymodel widgets = {'any_field': hiddeninput(),}
dont forget exclude other fields.
Comments
Post a Comment