Exemplo n.º 1
0
class IndexerMeta(BaseModel):
    """Represents the indexer meta data created during the indexing process."""
    path = peewee.CharField(unique=True,
                            help_text='The absolute path of the item.')
    mod_date = peewee.DateTimeField(
        help_text='The date it was modified on the file system.')
    date_added = peewee.DateTimeField(
        help_text='The date this record was added to the index.')

    def __unicode__(self):
        return u'<IndexerMeta: %d:%s>' % (self.id, self.path)
Exemplo n.º 2
0
class User(BaseModel):
    username = peewee.CharField(max_length=80)
    password = peewee.CharField(max_length=250)
    email = peewee.CharField(max_length=120)

    # Flask-Login integration
    def is_authenticated(self):
        return True

    def is_active(self):
        return True

    def is_anonymous(self):
        return False

    def get_id(self):
        return self.id

    def __unicode__(self):
        return self.username