Skip to content

Instantly share code, notes, and snippets.

@Tendrid
Created January 14, 2014 16:51
Show Gist options
  • Save Tendrid/8421551 to your computer and use it in GitHub Desktop.
Save Tendrid/8421551 to your computer and use it in GitHub Desktop.
class TabSchema(fes.Schema):
name = fev.UnicodeString(not_empty=True)
tabs = fev.Set(if_empty=[], if_missing=[])
lifespan = fev.Int(if_missing=0)
class Tab(SimpleDoc, mongoengine.Document):
name = mongoengine.StringField(default='')
tabs = mongoengine.ListField(mongoengine.DictField())
lifespan = mongoengine.IntField(default=0)
def __repr__(self):
return "%s Object <%s>" % (self.__class__.__name__, self.name)
def save(self, *args, **kwargs):
from SimpleSeer.realtime import ChannelManager
super(TabContainer, self).save(*args, **kwargs)
ChannelManager().publish('meta/', self)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment