Exemplo n.º 1
0
class TweetTag(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String)
    userid = db.Column(db.Integer)
    created = db.Column(db.String)
    ColInt = ("id", "userid")
    ColStr = ("name", "created")

    def add_cb(self):
        self.created = str(
            datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S"))

    def update_cb(self):
        pass
Exemplo n.º 2
0
class User(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    name = db.Column(db.String)
    ColInt = ("id")
    ColStr = ("name")

    def __repr__(self):
        return '<User %s>' % self.name

    def add_cb(self):
        pass

    def update_cb(self):
        pass
Exemplo n.º 3
0
class Spec(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    guid = db.Column(db.String)
    name = db.Column(db.String)
    definition = db.Column(db.String)
    userid = db.Column(db.Integer)
    #updated    = db.Column(db.String)
    ColInt = ("id", "userid")
    ColStr = ("name", "guid", "definition")

    def __repr__(self):
        return '<Spec %s>' % self.name

    def add_cb(self):
        #self.updated = datetime.datetime.strftime("%Y/%m/%d %H:%M")
        self.guid = str(uuid.uuid4())

    def update_cb(self):
        #self.updated = datetime.datetime.strftime("%Y/%m/%d %H:%M")
        if self.guid == "" or self.guid is None:
            self.guid = str(uuid.uuid4())
Exemplo n.º 4
0
class Tweet(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    tags = db.Column(db.String)
    tweet = db.Column(db.String)
    userid = db.Column(db.Integer)
    toid = db.Column(db.Integer)
    eene = db.Column(db.Integer)
    created = db.Column(db.String)
    ColInt = ("id", "kind", "userid", "toid", "eene")
    ColStr = ("tweet", "created")

    def __repr__(self):
        return '<Spec %s>' % self.name

    def add_cb(self):
        self.created = str(
            datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S"))

    def update_cb(self):
        pass