Part 1 of initial database population re-factor, along with a comsys model change. DO NOT UPDATE TO THIS IN PRODUCTION ENVIRONMENTS YET! Wait for the all-clear.

This commit is contained in:
Greg Taylor 2009-01-18 03:14:52 +00:00
parent 8ebea8c22e
commit c0ebbc3967
6 changed files with 29 additions and 10 deletions

View file

@ -240,16 +240,17 @@ def get_cobj_from_name(cname):
"""
return CommChannel.objects.get(name=cname)
def create_channel(name, owner):
def create_channel(name, owner, description=None):
"""
Create a new channel.
name: (string) Name of the new channel
owner: (Object) Objec that owns the channel
owner: (Object) Object that owns the channel
"""
new_chan = CommChannel()
new_chan.name = ansi.parse_ansi(name, strip_ansi=True)
new_chan.ansi_name = "[%s]" % (ansi.parse_ansi(name),)
new_chan.set_owner(owner)
new_chan.description = description
new_chan.save()
return new_chan