Exemplo n.º 1
0
 def create(self, validated_data):
     task = Task(**validated_data)
     task.owner = User.objects.first()
     task.due_to = datetime.datetime.now() + datetime.timedelta(days=1,
                                                                hours=3)
     task.created = datetime.datetime.now()
     task.save()
     return task
Exemplo n.º 2
0
 def create(self, validated_data):
     task = Task(**validated_data)
     task.owner = User.objects.first()
     task.save()
     return task