mirror of
https://github.com/evennia/evennia.git
synced 2026-03-30 20:47:17 +02:00
Merge from Kelketek's clone. Added fixes to migrations of Tags. Issues with ContentTypes meaning that this revision is not possible to start.
This commit is contained in:
commit
acdea41a67
19 changed files with 601 additions and 468 deletions
|
|
@ -8,7 +8,7 @@ class Migration(DataMigration):
|
|||
|
||||
def forwards(self, orm):
|
||||
"Write your forwards methods here."
|
||||
# Note: Don't use "from appname.models import ModelName".
|
||||
# Note: Don't use "from appname.models import ModelName".
|
||||
# Use orm.ModelName to refer to models in this application,
|
||||
# and orm['appname.ModelName'] for models in other applications.
|
||||
ChannelDB = orm['comms.ChannelDB']
|
||||
|
|
@ -28,8 +28,12 @@ class Migration(DataMigration):
|
|||
new_channel.db_attributes.add(keep_log)
|
||||
for name in [alias.strip() for alias in
|
||||
channel.db_aliases.split(',')]:
|
||||
tag = Tag(db_key=name, db_category='comm_alias')
|
||||
tag.save()
|
||||
tag = Tag.objects.filter(db_key=name.lower().strip(), db_category='comm_alias')
|
||||
if tag:
|
||||
tag = tag[0]
|
||||
else:
|
||||
tag = Tag(db_key=name.lower().strip(), db_category='comm_alias')
|
||||
tag.save()
|
||||
new_channel.db_tags.add(tag)
|
||||
new_channel.save()
|
||||
|
||||
|
|
|
|||
|
|
@ -342,10 +342,6 @@ class ChannelDB(TypedObject):
|
|||
_typeclass_paths = settings.COMM_TYPECLASS_PATHS
|
||||
_default_typeclass_path = settings.BASE_COMM_TYPECLASS or "src.comms.comms.Comm"
|
||||
|
||||
class Meta:
|
||||
"Define Django meta options"
|
||||
verbose_name = "Channel"
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
TypedObject.__init__(self, *args, **kwargs)
|
||||
_SA(self, "tags", TagHandler(self, category_prefix="comm_"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue