Merge lp:~stefanor/ibid/memo-date-426341 into lp:~ibid-core/ibid/old-trunk-pack-0.92

Proposed by Stefano Rivera
Status: Merged
Approved by: Stefano Rivera
Approved revision: 755
Merged at revision: 755
Proposed branch: lp:~stefanor/ibid/memo-date-426341
Merge into: lp:~ibid-core/ibid/old-trunk-pack-0.92
Diff against target: None lines
To merge this branch: bzr merge lp:~stefanor/ibid/memo-date-426341
Reviewer Review Type Date Requested Status
Michael Gorven Approve
Jonathan Hitchcock Approve
Review via email: mp+11374@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jonathan Hitchcock (vhata) :
review: Approve
Revision history for this message
Michael Gorven (mgorven) wrote :

 review approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ibid/models.py'
2--- ibid/models.py 2009-08-29 17:53:30 +0000
3+++ ibid/models.py 2009-09-08 16:04:20 +0000
4@@ -1,3 +1,4 @@
5+from datetime import datetime
6 import logging
7 import re
8
9@@ -391,7 +392,7 @@
10 Column('account_id', Integer, ForeignKey('accounts.id'), index=True),
11 Column('source', Unicode(32), nullable=False, index=True),
12 Column('identity', UnicodeText, nullable=False, index=True),
13- Column('created', DateTime, default=func.current_timestamp()),
14+ Column('created', DateTime),
15 UniqueConstraint('source', 'identity'),
16 useexisting=True)
17
18@@ -411,6 +412,7 @@
19 self.source = source
20 self.identity = identity
21 self.account_id = account_id
22+ created = datetime.uctnow()
23
24 def __repr__(self):
25 return '<Identity %s on %s>' % (self.identity, self.source)
26
27=== modified file 'ibid/plugins/factoid.py'
28--- ibid/plugins/factoid.py 2009-08-29 23:05:02 +0000
29+++ ibid/plugins/factoid.py 2009-09-08 16:04:20 +0000
30@@ -32,7 +32,7 @@
31 Column('name', Unicode(64), nullable=False, unique=True, index=True),
32 Column('factoid_id', Integer, ForeignKey('factoids.id'), nullable=False, index=True),
33 Column('identity_id', Integer, ForeignKey('identities.id'), index=True),
34- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
35+ Column('time', DateTime, nullable=False),
36 Column('factpack', Integer, ForeignKey('factpacks.id'), index=True),
37 useexisting=True)
38
39@@ -55,6 +55,7 @@
40 self.name = name
41 self.factoid_id = factoid_id
42 self.identity_id = identity_id
43+ self.time = datetime.utcnow()
44 self.factpack = factpack
45
46 def __repr__(self):
47@@ -66,7 +67,7 @@
48 Column('value', UnicodeText, nullable=False),
49 Column('factoid_id', Integer, ForeignKey('factoids.id'), nullable=False, index=True),
50 Column('identity_id', Integer, ForeignKey('identities.id'), index=True),
51- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
52+ Column('time', DateTime, nullable=False),
53 Column('factpack', Integer, ForeignKey('factpacks.id'), index=True),
54 useexisting=True)
55
56@@ -84,6 +85,7 @@
57 self.value = value
58 self.factoid_id = factoid_id
59 self.identity_id = identity_id
60+ self.time = datetime.utcnow()
61 self.factpack = factpack
62
63 def __repr__(self):
64@@ -92,7 +94,7 @@
65 class Factoid(Base):
66 __table__ = Table('factoids', Base.metadata,
67 Column('id', Integer, primary_key=True),
68- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
69+ Column('time', DateTime, nullable=False),
70 Column('factpack', Integer, ForeignKey('factpacks.id'), index=True),
71 useexisting=True)
72
73@@ -108,6 +110,7 @@
74 __table__.versioned_schema = FactoidSchema(__table__, 3)
75
76 def __init__(self, factpack=None):
77+ self.time = datetime.utcnow()
78 self.factpack = factpack
79
80 def __repr__(self):
81
82=== modified file 'ibid/plugins/karma.py'
83--- ibid/plugins/karma.py 2009-07-18 07:40:41 +0000
84+++ ibid/plugins/karma.py 2009-09-08 16:04:20 +0000
85@@ -1,3 +1,4 @@
86+from datetime import datetime
87 import re
88 import logging
89
90@@ -5,7 +6,7 @@
91 from sqlalchemy.sql import func
92
93 from ibid.plugins import Processor, match, handler, authorise
94-from ibid.config import Option, BoolOption, IntOption, ListOption
95+from ibid.config import BoolOption, IntOption, ListOption
96 from ibid.models import Base, VersionedSchema
97
98 help = {'karma': u'Keeps track of karma for people and things.'}
99@@ -18,7 +19,7 @@
100 Column('subject', Unicode(64), unique=True, nullable=False, index=True),
101 Column('changes', Integer, nullable=False),
102 Column('value', Integer, nullable=False),
103- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
104+ Column('time', DateTime, nullable=False),
105 useexisting=True)
106
107 class KarmaSchema(VersionedSchema):
108@@ -33,6 +34,7 @@
109 self.subject = subject
110 self.changes = 0
111 self.value = 0
112+ self.time = datetime.utcnow()
113
114 class Set(Processor):
115 u"""<subject> (++|--|==|ftw|ftl) [[reason]]"""
116
117=== modified file 'ibid/plugins/memo.py'
118--- ibid/plugins/memo.py 2009-08-29 23:05:02 +0000
119+++ ibid/plugins/memo.py 2009-09-08 16:04:20 +0000
120@@ -1,3 +1,4 @@
121+from datetime import datetime
122 import logging
123
124 from sqlalchemy import Column, Integer, DateTime, ForeignKey, Boolean, UnicodeText, Table
125@@ -27,7 +28,7 @@
126 Column('memo', UnicodeText, nullable=False),
127 Column('private', Boolean, nullable=False),
128 Column('delivered', Boolean, nullable=False, index=True),
129- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
130+ Column('time', DateTime, nullable=False),
131 useexisting=True)
132
133 class MemoSchema(VersionedSchema):
134@@ -44,6 +45,7 @@
135 self.memo = memo
136 self.private = private
137 self.delivered = False
138+ self.time = datetime.utcnow()
139
140 Identity.memos_sent = relation(Memo, primaryjoin=Identity.id==Memo.from_id, backref='sender')
141 Identity.memos_recvd = relation(Memo, primaryjoin=Identity.id==Memo.to_id, backref='recipient')
142
143=== modified file 'ibid/plugins/seen.py'
144--- ibid/plugins/seen.py 2009-08-29 23:05:02 +0000
145+++ ibid/plugins/seen.py 2009-09-08 16:04:20 +0000
146@@ -1,3 +1,4 @@
147+from datetime import datetime
148 import logging
149
150 from sqlalchemy import Column, Integer, Unicode, DateTime, ForeignKey, UnicodeText, UniqueConstraint, Table
151@@ -20,7 +21,7 @@
152 Column('type', Unicode(8), nullable=False, index=True),
153 Column('channel', Unicode(32)),
154 Column('value', UnicodeText),
155- Column('time', DateTime, nullable=False, default=func.current_timestamp()),
156+ Column('time', DateTime, nullable=False),
157 Column('count', Integer, nullable=False),
158 UniqueConstraint('identity_id', 'type'),
159 useexisting=True)
160@@ -39,6 +40,7 @@
161 self.type = type
162 self.channel = channel
163 self.value = value
164+ self.time = datetime.utcnow()
165 self.count = 0
166
167 def __repr__(self):
168
169=== modified file 'scripts/ibid-plugin'
170--- scripts/ibid-plugin 2009-07-31 15:27:22 +0000
171+++ scripts/ibid-plugin 2009-09-08 16:00:06 +0000
172@@ -84,7 +84,7 @@
173
174 session = ibid.databases.ibid()
175
176-identity = session.query(Identity).filter_by(identity=username).first()
177+identity = session.query(Identity).filter_by(identity=username, source=u'test_source').first()
178 if not identity:
179 identity = Identity(u'test_source',username)
180 session.save(identity)

Subscribers

People subscribed via source and target branches