Skip to content Skip to sidebar Skip to footer

Getting A Form In Django DetailView

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

Post a Comment for "Getting A Form In Django DetailView"