Last active
August 29, 2015 14:16
-
-
Save puentesarrin/3d14f739f8c0b0d16201 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BadgeManager(Manager) # This equals your BaseBadgeManager | |
def get_by_id(self, roar_id, id_or_ids): | |
pass | |
def drop(self, roar_id, badge_id): | |
pass | |
class BaseBadge(models.Model): | |
objects = BadgeManager() | |
class Meta: | |
abstract = True | |
class PostBadgeManager(Manager): | |
def get_by_roar_id(self, roar_id): | |
pass | |
def invalidate_key(self): | |
self._model.CACHE_TEMPLATE # This should be the way to use the cache attributes from the model | |
pass | |
@classmethod | |
def get_cache_key(cls): | |
cls._model.CACHE_TEMPLATE # Not possible, model is None for classmethods | |
pass | |
class PostBadge(BaseBadge): | |
CACHE_TEMPLATE = '' | |
posts_objects = PostBadgeManager() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment