Raise NotSupportedError when creating models with expressions

XMLWordPrintableJSON

    • None
    • Python Drivers
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      Instead of a failure like this:

      >>> Article.objects.create(pub_date=Now())

      bson.errors.InvalidDocument: Invalid document: cannot encode object: Now(), of type: <class 'django.db.models.functions.datetime.Now'>

      Django MongoDB Backend canraise an exception:

      django.db.utils.NotSupportedError: MongoDB does not support creating models with expressions: got Now() for field pub_date.

            Assignee:
            Tim Graham
            Reporter:
            Tim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: