2011/1/25 bvdb <[email protected]> > A developer sometimes has to access and present data that existed > before his application. Common practice is for a database > administrator to define a database view (with a CREATE VIEW sql > command, not to be confused with the V in MVC) and give the Django > developer access to this. This is only a read access because in most > cases it is not possible or desireable to allow an UPDATE on a view. > > Now I am new to Django, have some experience with databases - and > couldn't find a "read-only attribute" when defining a model. > Without knowing that a view - that is accessed with the same SELECT > syntax as a table - is read-only Django would for example generate an > admin interface that produces errors, and leave the user wondering > why. > It makes also sense in some cases to define a table read-only for a > model even it is fully accessible by the Django team. > > Is it really not possible to define read-only access in Djangos ORM? > Or maybe I just overlooked the description?
Define a model for your db view and set the meta option managed=False http://docs.djangoproject.com/en/dev/ref/models/options/#managed -- Simo - Registered Linux User #395060 - Software is like sex, it is better when it is free --> Linus B. Torvalds -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

