This question is a follow-up to one I asked earlier here.
I have a Django model as follows:
class MyModel(models.Model):
my_field1 = models.DateTimeF
Using init is discouraged. According to Django docs:
https://docs.djangoproject.com/en/1.9/ref/models/instances/#creating-objects
from django.db import models
class Book(models.Model):
title = models.CharField(max_length=100)
@classmethod
def create(cls, title):
book = cls(title=title)
# do something with the book
return book
book = Book.create("Pride and Prejudice")