#2259: Primary keys should be readonly by default in admin -------------------------------+------------------------------------------- Reporter: ed@… | Owner: Prashant Pandey Type: Bug | Status: assigned Component: contrib.admin | Version: dev Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 -------------------------------+-------------------------------------------
Comment (by Prashant Pandey): Replying to [comment:28 Bouke Haarsmay]: Hi, I was following your solution and it gives same errors that you are getting(regression error for inline). I just need help in that area. Is there a way to access the context of the form inside the get_readonly_fields, means when we do: 1. Create new object where primary key field will be in editing state. 2. If we hit the change behaviour it should be readonly. we can add a condition in the get_readonly_fields function where it will send pk as a readonly if user wants to modify the object. -- Ticket URL: <https://code.djangoproject.com/ticket/2259#comment:50> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018bf816685c-39b6a4fb-9164-4091-8b3a-a34797e71295-000000%40eu-central-1.amazonses.com.