API change. Removed managers for Attributes and Tags - these are instead incoorporated into the TypedObjectManager which all Typeclassed object handlers inherit from. This concludes the refactor started in #529. This means that access to Attributes/Permissions/Aliases and Tags/nicks are done directly through e.g. ObjectDB.objects.get_by_tag() (or ev.managers.objects.get_by_tag) rather than using Tag.get_obj_with_tag and specifying the model type manually. The create_tag() method was also moved into the TypedObjectManager as part of removing the Tagmanager. As part of this change, Tag and Attribute was also removed from the ev interface.

This commit is contained in:
Griatch 2014-10-25 22:40:38 +02:00
parent 08b18524fd
commit 5b42b31240
6 changed files with 123 additions and 216 deletions

View file

@ -4,7 +4,7 @@ These managers handles the
from django.db import models
from django.db.models import Q
from src.typeclasses.managers import returns_typeclass_list, returns_typeclass
from src.typeclasses.managers import TypedObjectManager, returns_typeclass_list, returns_typeclass
_GA = object.__getattribute__
_PlayerDB = None
@ -251,7 +251,7 @@ class MsgManager(models.Manager):
# Channel manager
#
class ChannelManager(models.Manager):
class ChannelManager(TypedObjectManager):
"""
This ChannelManager implements methods for searching
and manipulating Channels directly from the database.