Commit bba85e80 by Ben McMorran

Merge pull request #4154 from edx/benmcmorran/remove-datetuple

Removes DateTuple field type
parents b7eea135 a8817b83
"""
Mixin defining common Studio functionality
"""
import datetime
from xblock.fields import Scope, Field, Integer, XBlockMixin
class DateTuple(Field):
"""
Field that stores datetime objects as time tuples
"""
def from_json(self, value):
return datetime.datetime(*value[0:6])
def to_json(self, value):
if value is None:
return None
return list(value.timetuple())
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment