Re: generic.UpdateView and readonly ForeignKeys

2014-02-26 Thread Lachlan Musicman
Ok, I worked it quick and dirty. Do not try this at home, kids. The field isn't strictly read only anymore, but I no longer mention the field in question in forms.py In the template, I've replaced the {{ forms.fk_model }} with {{ object.fk_model }}. And now the field is plain text (the fk_model.

generic.UpdateView and readonly ForeignKeys

2014-02-26 Thread Lachlan Musicman
I'm looking for a quick and easy way to implement readonly ForeignKeys when using the generic.UpdateView. I can't see anything that looks simpler than just ditching the UpdateView and writing a function based view that sets the FK queryset to a single object. Or have I missed something? cheers L