Warn that using an actual date or datetime value is probably wrong; it's only evaluated on server startup.
(self)
| 1618 | # __init__ is inherited from DateField |
| 1619 | |
| 1620 | def _check_fix_default_value(self): |
| 1621 | """ |
| 1622 | Warn that using an actual date or datetime value is probably wrong; |
| 1623 | it's only evaluated on server startup. |
| 1624 | """ |
| 1625 | if not self.has_default(): |
| 1626 | return [] |
| 1627 | |
| 1628 | value = self.default |
| 1629 | if isinstance(value, (datetime.datetime, datetime.date)): |
| 1630 | return self._check_if_value_fixed(value) |
| 1631 | # No explicit date / datetime value -- no checks necessary. |
| 1632 | return [] |
| 1633 | |
| 1634 | def get_internal_type(self): |
| 1635 | return "DateTimeField" |
nothing calls this directly
no test coverage detected