Last active
December 5, 2018 16:17
-
-
Save sdcasas/a5e9e386f8ac885d1502058a702dad13 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # django orm DateTimeField = DateField +TimeField | |
| # models.py | |
| class Sesion(models.Model): | |
| fecha = models.DateField(null=True, blank=True) | |
| hora = models.TimeField(null=True, blank=True) | |
| class ProyectoEstado(models.Model): | |
| fecha_cambio_estado = models.DateTimeField() | |
| # shell | |
| pc = Sesion.objects.get(pk = 1) | |
| ProyectoEstado.objects.create( | |
| fecha_cambio_estado = pc.sesion.fecha + pc.sesion.hora, # error | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment