Changeset 439
- Timestamp:
- 09/09/08 13:24:50 (5 years ago)
- File:
-
- 1 edited
-
trunk/forks/tracpasteplugin/tracpaste/model.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/forks/tracpasteplugin/tracpaste/model.py
r17 r439 16 16 cursor.execute('select id, title, author, mimetype, data, time from pastes order by ' 17 17 'id desc limit 0, %s', (n,)) 18 18 19 result = [] 19 20 for row in cursor: … … 23 24 author = row[2], 24 25 mimetype = row[3], 25 data = row[4], 26 time = datetime.fromtimestamp(row[5], utc) 26 data = row[4].count("\n")>10 and "\n".join(row[4].splitlines()[:10]+["[ ... ]"]) or row[4], 27 time = datetime.fromtimestamp(row[5], utc), 28 fetch = False 27 29 ) 28 30 ) … … 36 38 37 39 def __init__(self, env, id=None, title=u'', author=u'', 38 mimetype='text/plain', data=u'', time=None ):40 mimetype='text/plain', data=u'', time=None, fetch=True): 39 41 self.env = env 40 42 self.id = id … … 45 47 self.time = time 46 48 47 if id is not None :49 if id is not None and fetch: 48 50 db = env.get_db_cnx() 49 51 cursor = db.cursor()
Note: See TracChangeset
for help on using the changeset viewer.
