Getting A Form In Django DetailView November 24, 2022 Post a Comment I am currently trying to show a custom form where I alter the form in the corresponding view in the .html ].label = "Primary purpose/business use" form.fields['secondary_purpose_business_uses'].label = "Secondary purpose/business uses" return form def get_context_data(self, **kwargs): context = super(SystemDetailView, self).get_context_data(**kwargs) context.update({ 'system_update_form': self.get_form(), # get the form instance 'object_name': self.object.name, 'user_can_edit': self.request.user.has_perm( 'services.change_system'), 'user_can_delete': self.request.user.has_perm( 'services.delete_system'), 'object_events': self.object.events.all(), }) return context Copy Share You may like these postsHow To Create A Profile Registration Form In Django?Python Django Unsalted Md5 Password Hash FormatDjango Admin Error 'WSGIRequest' Object Has No Attribute 'userHow To Restrict My Students To Don't Access Teacher Area In Django? Post a Comment for "Getting A Form In Django DetailView"
Post a Comment for "Getting A Form In Django DetailView"