Changes between Version 7 and Version 8 of Ticket #10244, comment 19
- Timestamp:
- Jun 7, 2022, 7:39:37 AM (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #10244, comment 19
v7 v8 29 29 - `MyModel.objects.create(my_filefield=None).my_filefield is not None` 30 30 - `my_model_instance.my_filefield` is always "truthy", so we need to check e.g. `my_filefield.name` ([https://stackoverflow.com/q/8850415 example]) 31 - we cannot use the `__isnull` field lookup, but have to check for equality with the empty string `''` ([https://stackoverflow.com/q/4771464 example])31 - we cannot use the `__isnull` field lookup, but have to check for equality with the empty string `''`, or even `not in ['', None]` ([https://stackoverflow.com/q/4771464 example]) 32 32 - `FileField(null=True, unique=True)` is broken, because the database entry is `''` instead of `null`, so we get a unique-constraint violation if we try to create another instance with `None` 33 33