Convert a string representation to a `datetime` object (the object you will manipulate). This is the reverse function of `_convert_from_datetime`. >>> a = '2011,06,08,20,26,24,092284' >>> ComplexDateTimeField()._convert_from_string(a) datetime.dateti
(self, data)
| 653 | return val.strftime(self.format) |
| 654 | |
| 655 | def _convert_from_string(self, data): |
| 656 | """ |
| 657 | Convert a string representation to a `datetime` object (the object you |
| 658 | will manipulate). This is the reverse function of |
| 659 | `_convert_from_datetime`. |
| 660 | |
| 661 | >>> a = '2011,06,08,20,26,24,092284' |
| 662 | >>> ComplexDateTimeField()._convert_from_string(a) |
| 663 | datetime.datetime(2011, 6, 8, 20, 26, 24, 92284) |
| 664 | """ |
| 665 | values = [int(d) for d in data.split(self.separator)] |
| 666 | return datetime.datetime(*values) |
| 667 | |
| 668 | def __get__(self, instance, owner): |
| 669 | if instance is None: |