Exemplo n.º 1
0
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)
Exemplo n.º 2
0
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
Exemplo n.º 3
0
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
Exemplo n.º 4
0
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
Exemplo n.º 5
0
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()
Exemplo n.º 6
0
class Projects(Document):
	name = StringProperty()
	version = StringProperty()
Exemplo n.º 7
0
class ProjectTimes(Document):
	started = StringProperty()
	completed = StringProperty()
	project = StringProperty()
Exemplo n.º 8
0
class SlotTimes(Document):
	platform = StringProperty()
	time = StringProperty()
Exemplo n.º 9
0
class Project(Document):
    author = StringProperty()
    title = StringProperty()
    start_date = DateProperty()
    due_date = DateProperty()
    text = StringProperty()
Exemplo n.º 10
0
class UserRecord(Document):
   user_name = StringProperty()
   creation_time = DateTimeProperty()
   
   def contains(self, key):
      return self.__contains__(key)
Exemplo n.º 11
0
class Slot_Conf(Document):
	name = StringProperty()
	build_id = IntegerProperty()
	projects = ListProperty(default = [])
	platforms = ListProperty(default = [])
Exemplo n.º 12
0
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')
Exemplo n.º 13
0
class PasteEntry(Document):
    endpoint = StringProperty()
    querystr = StringProperty()
    timestamp = DateTimeProperty()
Exemplo n.º 14
0
class Comment(Document):
    author = StringProperty()
    text = StringProperty()
    date = DateTimeProperty()
    task_id = StringProperty()
Exemplo n.º 15
0
class Entry(Document):
	author = StringProperty()
	date = DateTimeProperty()
	title = StringProperty()
	text = StringProperty()
Exemplo n.º 16
0
class Email(Document):
    email = StringProperty()
Exemplo n.º 17
0
class TimeInfo(Document):
	type = StringProperty(default="TimeInfo")
	max = IntegerProperty()
Exemplo n.º 18
0
class Job(Document):
	platforms = ListProperty()
	slot = StringProperty()
	value = StringProperty()
	doc_type = StringProperty(default="Job")
Exemplo n.º 19
0
class Results(Document):
	project = StringProperty()
	platform = StringProperty()
	started = StringProperty()
	completed = StringProperty()
	set = StringProperty()
Exemplo n.º 20
0
class Thing(Document):
    owner = StringProperty(required=True)
    name = StringProperty(required=True)

    __repr__ = doc_repr
Exemplo n.º 21
0
class slotStartEnd(Document):
	platform = StringProperty()
	time = IntegerProperty()
Exemplo n.º 22
0
class DictionaryRecord(Document):
   source = StringProperty()
   target = StringProperty()
   query = StringProperty()
   word_source = StringProperty()
   date_written = DateTimeProperty()
Exemplo n.º 23
0
class User(Document):
    username = StringProperty()
    real_name = StringProperty()
    salt = StringProperty()
    password = StringProperty()
    email = StringProperty()