Hi! Mat wrote: > Okay so I am trying to figure out how to do the following. I have some > data in a table that users don't need to see but they need to see > other data in the same table. So I am trying to figure out if there is > any way to do a "global" filter so i don't have to do an exclude on > every query of that table. Is there a way to do this?
Make your own manager and assign it to "objects". In that manager apply all necessary filters. Here is an example from my models: class TYPO3UserManager(models.Manager): '''A special model manager that returns only available users''' def get_query_set(self): query_set = super(TYPO3UserManager, self).get_query_set() return query_set.exclude(models.Q(disabled = 1) | models.Q(deleted = 1)) class TYPO3User ... objects = TYPO3UserManager() -- Dmitry Dulepov Twitter: http://twitter.com/dmitryd/ Web: http://dmitry-dulepov.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.