Skip to content

Commit

Permalink
PEP8ify
Browse files Browse the repository at this point in the history
  • Loading branch information
Ask Solem committed Nov 8, 2010
1 parent 1c900d1 commit a5fa0ee
Showing 1 changed file with 21 additions and 17 deletions.
38 changes: 21 additions & 17 deletions sqlakombu/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,43 @@


class Queue(ModelBase):
__tablename__ = 'kombu_queue'
__tablename__ = "kombu_queue"
__table_args__ = {"sqlite_autoincrement": True}

id = Column(Integer, Sequence('queue_id_sequence'), primary_key=True,
id = Column(Integer, Sequence("queue_id_sequence"), primary_key=True,
autoincrement=True)
name = Column(String(200), unique=True)
messages = relation("Message", backref='queue', lazy='noload')
name = Column(String(200), unique=True)
messages = relation("Message", backref="queue", lazy="noload")

def __init__(self, name):
self.name = name

def __str__(self):
return "<Queue(%s)>" % (self.name)


class Message(ModelBase):
__tablename__ = 'kombu_message'
__tablename__ = "kombu_message"
__table_args__ = {"sqlite_autoincrement": True}

id = Column(Integer, Sequence('message_id_sequence'), primary_key=True,
autoincrement=True)
visible = Column(Boolean, default=True, index=True)
sent_at = Column('timestamp', DateTime, nullable=True, index=True,
onupdate = datetime.datetime.now)
payload = Column(Text, nullable=False)
queue_id = Column(SmallInteger, ForeignKey('kombu_queue.id', name='FK_kombu_message_queue'))
version = Column(SmallInteger, nullable=False, default=1)
id = Column(Integer, Sequence("message_id_sequence"), primary_key=True,
autoincrement=True)
visible = Column(Boolean, default=True, index=True)
sent_at = Column('timestamp', DateTime, nullable=True, index=True,
onupdate=datetime.datetime.now)
payload = Column(Text, nullable=False)
queue_id = Column(SmallInteger, ForeignKey("kombu_queue.id",
name="FK_kombu_message_queue"))
version = Column(SmallInteger, nullable=False, default=1)

__mapper_args__ = {'version_id_col': version}
__mapper_args__ = {"version_id_col": version}

def __init__(self, payload, queue):
self.payload = payload
self.payload = payload
self.queue = queue

def __str__(self):
return "<Message(%s, %s, %s, %s)>" % (self.visible, self.sent_at, self.payload, self.queue_id)

return "<Message(%s, %s, %s, %s)>" % (self.visible,
self.sent_at,
self.payload,
self.queue_id)

0 comments on commit a5fa0ee

Please sign in to comment.