class User(Document): email = StringProperty() name = StringProperty() password = StringProperty() @property def id(self): if self.new_document: return None return self._doc['_id'] def is_authenticated(self): return True def is_active(self): return True def is_anonymous(self): return False def get_id(self): return unicode(self.name) def __repr__(self): return '<User %r>' % (self.name)
class Lending(Document): thing = StringProperty(required=True) owner = StringProperty(required=True) to_user = StringProperty(required=True) lent = DateTimeProperty(default=datetime.now) returned = DateTimeProperty() __repr__ = doc_repr
class Post(Document): author_id = StringProperty() content = StringProperty() content_hidden = StringProperty() date = DateTimeProperty() comments = ListProperty() @property def author(self): #return self.author_id #TODO: Check whats happends user is non existing return User.get(self.author_id).name
class AuthContext(DocumentSchema): authenticated = BooleanProperty(default=False) domain = StringProperty(required=True) user_id = StringProperty() def _auth_required(self): domain_requires_auth(self.domain) def is_valid(self): try: return self.authenticated or not self._auth_required() except ResourceNotFound: return False
class Task(Document): author = StringProperty() assigned = StringProperty() priority = StringProperty() title = StringProperty() text = StringProperty() tags = StringProperty() status = StringProperty() project = StringProperty() comments = SetProperty() create_date = DateTimeProperty() update_date = DateTimeProperty() due_date = DateProperty()
class Projects(Document): name = StringProperty() version = StringProperty()
class ProjectTimes(Document): started = StringProperty() completed = StringProperty() project = StringProperty()
class SlotTimes(Document): platform = StringProperty() time = StringProperty()
class Project(Document): author = StringProperty() title = StringProperty() start_date = DateProperty() due_date = DateProperty() text = StringProperty()
class UserRecord(Document): user_name = StringProperty() creation_time = DateTimeProperty() def contains(self, key): return self.__contains__(key)
class Slot_Conf(Document): name = StringProperty() build_id = IntegerProperty() projects = ListProperty(default = []) platforms = ListProperty(default = [])
class RDFEntity(Document): g = StringProperty() # the graph this entity belongs to s = StringProperty() # the one and only subject p = StringListProperty() # list of predicates o = StringListProperty() # list of objects o_in = StringListProperty() # list of back-links (read: 'object in')
class PasteEntry(Document): endpoint = StringProperty() querystr = StringProperty() timestamp = DateTimeProperty()
class Comment(Document): author = StringProperty() text = StringProperty() date = DateTimeProperty() task_id = StringProperty()
class Entry(Document): author = StringProperty() date = DateTimeProperty() title = StringProperty() text = StringProperty()
class Email(Document): email = StringProperty()
class TimeInfo(Document): type = StringProperty(default="TimeInfo") max = IntegerProperty()
class Job(Document): platforms = ListProperty() slot = StringProperty() value = StringProperty() doc_type = StringProperty(default="Job")
class Results(Document): project = StringProperty() platform = StringProperty() started = StringProperty() completed = StringProperty() set = StringProperty()
class Thing(Document): owner = StringProperty(required=True) name = StringProperty(required=True) __repr__ = doc_repr
class slotStartEnd(Document): platform = StringProperty() time = IntegerProperty()
class DictionaryRecord(Document): source = StringProperty() target = StringProperty() query = StringProperty() word_source = StringProperty() date_written = DateTimeProperty()
class User(Document): username = StringProperty() real_name = StringProperty() salt = StringProperty() password = StringProperty() email = StringProperty()