python - Permission to view, but not to change! - Django -


What users are allowed to see, but it is possible to change or delete them.

I have "add", "change" and "delete" in only one permission ... but there is no "reading / view" in it.

I need this because some users will be able to consult the admin panel to see what has been added.

In the admin.py to see only the # main reusable for ViewAdmin (admin.ModelAdmin) Admin Class: "" "Custom has been changed for viewing purpose only The template requires you to copy it / django / contrib / admin / templates / admin / change_form and then specified in that setting in your template folder TEMPLATE_DIR "" change_form_template = 'view_form.html' # Admin Admin for this model works Withdrawal = A DH def_add_permission (self, requested): Return Fal Safe DF Had Adilitation (Self, Request, OzZ = None): Return Deaf Save_ Model (Own, Request, OBJ, Form, Transformation): # Can not update data pass even, return nothing # Example Usage: Class SomeAdmin (ViewAdmin): # Put your admin stuff here # or use

to change it :

  {{adminform.form.non_fie Ld_errors}}  

with this:

  & lt; Table & gt; In {% For adminform.form%} & lt; Tr & gt; & Lt; Td> {{Field.label_tag}}: & lt; / Td> & Lt; TD & gt; {{Field.value}} & lt; / Td> & Lt; / TR & gt; {% Endfor%} & lt; / Table & gt;  

Then delete this row and delete the submit button:

  {% submit_row%}  
< / Html>

Comments