mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-11 07:04:54 -05:00
Add Cassandra thing _date property for use by JSON templates.
Cassandra things name their date property "date", while tdb_sql things name it "_date". This property alias allows the existing JSON template code to access the timestamp without caring about what type of thing it is.
This commit is contained in:
@@ -790,6 +790,11 @@ class ThingBase(object):
|
||||
class Thing(ThingBase):
|
||||
_timestamp_prop = 'date'
|
||||
|
||||
# alias _date property for consistency with tdb_sql things.
|
||||
@property
|
||||
def _date(self):
|
||||
return self.date
|
||||
|
||||
class UuidThing(ThingBase):
|
||||
_timestamp_prop = 'date'
|
||||
_extra_schema_creation_args = {
|
||||
|
||||
Reference in New Issue
Block a user