misc
This commit is contained in:
parent
d1514852e3
commit
3ce34d602a
2 changed files with 7 additions and 4 deletions
|
@ -184,7 +184,6 @@ class DateTimeFieldRenderer(formalchemy.fields.DateTimeFieldRenderer):
|
|||
if isinstance(value, datetime.datetime):
|
||||
value = edbob.local_time(value)
|
||||
return value.strftime(self.format)
|
||||
print type(value)
|
||||
return ''
|
||||
|
||||
FieldSet.default_renderers[formalchemy.types.DateTime] = DateTimeFieldRenderer
|
||||
|
|
|
@ -39,13 +39,17 @@ __all__ = ['getset_factory', 'table_with_uuid', 'current_time']
|
|||
|
||||
def getset_factory(collection_class, proxy):
|
||||
"""
|
||||
Helper function, useful for SQLAlchemy's "association proxy" configuration.
|
||||
Get/set factory for SQLAlchemy association proxy attributes.
|
||||
"""
|
||||
|
||||
def getter(obj):
|
||||
if obj is None: return None
|
||||
if obj is None:
|
||||
return None
|
||||
return getattr(obj, proxy.value_attr)
|
||||
setter = lambda obj, val: setattr(obj, proxy.value_attr, val)
|
||||
|
||||
def setter(obj, val):
|
||||
setattr(obj, proxy.value_attr, val)
|
||||
|
||||
return getter, setter
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue