Ticket #2189: optimize_auth.diff

File optimize_auth.diff, 644 bytes (added by konrad@…, 18 years ago)

patch for trunk/django/contrib/auth/models.py

  • models.py

     
    160160    def get_all_permissions(self):
    161161        if not hasattr(self, '_perm_cache'):
    162162            import sets
    163             self._perm_cache = sets.Set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.all()])
     163            self._perm_cache = sets.Set(["%s.%s" % (p.content_type.app_label, p.codename) for p in self.user_permissions.select_related()])
    164164            self._perm_cache.update(self.get_group_permissions())
    165165        return self._perm_cache
    166166
Back to Top