Re: [Django] #10244: FileFields can't be set to NULL in the db

2023-09-04 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  Ondrej
 |  Pudiš
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by daway0):

 the one who didn't path this after 15 years...
 
[[Image(https://images.genius.com/84fe15e61ad5563e8fa1e315a1385f79.892x926x1.png)]]

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018a6056e031-8202a4d8-5470-48c4-a2cb-398cef4a0c63-00%40eu-central-1.amazonses.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2022-09-24 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  Ondrej
 |  Pudiš
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ondrej Pudiš):

 * has_patch:  0 => 1


Comment:

 
[https://code.djangoproject.com/attachment/ticket/10244/nullable_file_field.diff
 My proposed patch] is to not create an instance of `FieldFile` when the
 file is `None`. However, this is a significant breaking change as people
 might be accessing the `FileField` and checking for `name` or `path` being
 an empty string.

 Many tests would need to be adjusted to this new logic.

 As suggested earlier, another possibility would be to store `None` on the
 DB level while interpreting it as  an empty `FieldFile` on the application
 level. This cloud introduce more confusion to the whole mechanics of the
 files storing.

 I believe that the first approach with not creating the `FieldFile` object
 when the file doesn't actually exists is a cleaner solution which is
 consistent with other types of database fields.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701837001c710-94745d3e-29de-4260-a714-7af04cca3fd1-00%40eu-central-1.amazonses.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2022-09-24 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  Ondrej
 |  Pudiš
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ondrej Pudiš):

 * Attachment "nullable_file_field.diff" added.


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701836ffc0922-34c386fe-d678-4016-bcfe-71b3c64082a8-00%40eu-central-1.amazonses.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2022-09-24 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  Ondrej
 |  Pudiš
 Type:  Bug  |   Status:  assigned
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  0|  Needs documentation:  1
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Ondrej Pudiš):

 * owner:  nobody => Ondrej Pudiš
 * status:  new => assigned
 * has_patch:  1 => 0
 * needs_tests:  1 => 0


Comment:

 As I understand the issue, if the file field is specified as nullable, it
 should accept `None` and in that case, store `NULL` on the database level
 instead of an empty string. In fact, it shouldn't even create an instance
 of `FieldFile` when creating a new `NullableDocument` object.

 The tests listed below are broken now but the patch should fix all of them
 giving a solution to all the issues enumerated in the comment above.

 {{{
 def test_create_empty(self):
 # when I create a new document with no file provided
 d = NullableDocument.objects.create(myfile=None)
 # I expect that the attribute itself is None
 self.assertIs(d.myfile, None)
 # I expect that I can filter the documents and find the one
 query = NullableDocument.objects.filter(myfile__isnull=True).exists()
 self.assertTrue(query)
 # I expect that the object remains None even after refreshing from the
 DB
 d.refresh_from_db()
 self.assertIs(d.myfile, None)

 def test_create_empty_multiple(self):
 # when the files are expected to be unique but nullable, I expect that
 I'm
 # allowed to create multiple records
 NullableDocument.objects.create(myfile=None)
 NullableDocument.objects.create(myfile=None)
 # and both are created
 query = NullableDocument.objects.filter(myfile__isnull=True).count()
 self.assertEqual(query, 2)

 def test_create_empty_on_not_null(self):
 # when I try to store an empty file on non-nullable model, I expect to
 get an
 # integrity error
 with self.assertRaises(IntegrityError):
 Document.objects.create(myfile=None)
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701836f8500b5-5cf902f8-b912-4de0-afb2-df6fcb1b0d1d-00%40eu-central-1.amazonses.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2022-06-02 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by dvg):

 From ten years ago:

 > ... only for people who set null=True on a FileField. The docs
 discourage that heavily ...

 As far as I can see, there is no mention of `null`, at all, in the
 *current* documentation for
 [https://docs.djangoproject.com/en/4.0/ref/models/fields/#filefield
 FileField].

 Yet Django's `FileField` behavior is still plainly inconsistent, compared
 to other fields, when it comes to `null=True`.

 A short summary:

 We can specify `null=True`, and we can assign `None` to the field, but
 this is stored as a `FieldFile` with `name=None` on the python side, and
 it is stored as an empty string `''` in the database.

 Some resulting inconveniences:

 - `MyModel.objects.create(my_filefield=None).my_filefield is not None`
 - `my_model_instance.my_filefield` is always "truthy", so we need to check
 e.g. `my_filefield.name` ([https://stackoverflow.com/q/8850415 example])
 - we cannot use the `__isnull` field lookup, but have to check for
 equality with the empty string `''` ([https://stackoverflow.com/q/4771464
 example])
 - `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`

 The latter is basically what is described in the
 
[https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.Field.null
 model field reference] (my emphasis):

 > ... One exception is when a `CharField` has both `unique=True` and
 `blank=True` set. In this situation, `null=True` is *required to avoid
 unique constraint violations when saving multiple objects with blank
 values*.

 So, currently, we cannot make a `FileField` unique and optional at the
 same time.

 Why not just bite the bullet and make a backward incompatible change, for
 the sake of consistency?


 [1]:
 
https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.FileField.storage
 [2]: https://docs.djangoproject.com/en/4.0/ref/models/fields/#filefield
 [3]: https://stackoverflow.com/q/8850415
 [4]:
 
https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.Field.null
 [5]: https://stackoverflow.com/q/4771464
 [7]:
 
https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.fields.files.FieldFile

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018124e515ab-17f7291a-7abb-4798-923d-fe37b46e2ddc-00%40eu-central-1.amazonses.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2021-02-01 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Description changed by Raffaele Salmaso:

Old description:

> Hi,

New description:

 Saving FileFields with a none value sets the field to a empty string in
 the db and not NULL as it should.

--

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.2bff4ea6fd59abf7959d730714dcd074%40djangoproject.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2021-02-01 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Old description:

> Saving FileFields with a none value sets the field to a empty string in
> the db and not NULL as it should.

New description:

 Hi,

--

Comment (by Raffaele Salmaso):

 Hi all, what is the status of this ticket?
 `FileField` behaviour is not really clear right now and `flake8-django`
 just made a change to allow `FileField(null=True)` (see
 https://github.com/rocioar/flake8-django/issues/82), which seems wrong to
 me.

 I'm for option 2  `make FileField behave exactly like CharField wrt.
 null`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f0e18e86ce9921ae90aee6c2860fc22c%40djangoproject.com.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2015-10-08 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  filefield NULL   | Triage Stage:  Accepted
  empty  |
Has patch:  1|  Needs documentation:  1
  Needs tests:  1|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by claudep):

 #25528 was a duplicate.

--
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.af7d314641194988360a565ef52e45b0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-11-01 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  1
  empty  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-

Comment (by anonymous):

 So? :-)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.5d63acd7141a00028b485a2ee7a23e75%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-22 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  1
  empty  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-

Comment (by siroky@…):

 I bumped into a problem. If `instance.null_file_field` is None then
 methods like `save()` will not work (AttributeError: 'NoneType' object has
 no attribute 'save'). I'm thinking about 2 solutions:
 1) Make the descriptor return value comparable to None (via `__eq__`).
 This is not very clean because the best practise is to use operator `is`
 (`is_none = x is None`).
 2) Keep the empty string ("") on the Python side as a representation of
 file's database NULL. Not very consistent but it has better backward
 compatibility if someone already uses the string comparison (`has_no_file
 = filefield.name == ""`).

 Any suggestions?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f759c7f6c751ddb7041701c594733bb6%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-21 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  1
  empty  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-

Comment (by timo):

 See https://docs.djangoproject.com/en/dev/internals/contributing/writing-
 code/unit-tests/#running-only-some-of-the-tests

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.f3e597a87e02ad49c393662785f3d793%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-21 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  1
  empty  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-

Comment (by anonymous):

 How can I run the FileFieldTests without the whole suite?

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.6a9f2a957602b030658bbd47b96408a7%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-21 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  1
  empty  |  Patch needs improvement:  0
Has patch:  1|UI/UX:  0
  Needs tests:  1|
Easy pickings:  0|
-+-
Changes (by claudep):

 * needs_docs:  0 => 1
 * has_patch:  0 => 1
 * needs_tests:  0 => 1


Comment:

 Thanks, it's a first step :-) However, tests are crucial with such a
 change. That will be the next step. See `FileFieldTests`in
 `tests/model_fields/tests.py`.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.9fe95208c1d4912623ae2258e9707129%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-19 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  0
  empty  |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by siroky@…):

 How about the filefield_null.patch? It follows solution 2.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.dd75529058c00775c164fffee68d404f%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-12 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  0
  empty  |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by aaugustin):

 It's waiting for someone to write a patch.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.e20844ba1b9c8593cbfce3befa55b63a%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2013-10-12 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  0
  empty  |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-

Comment (by siroky@…):

 Hi! What is the status of this ticket? I see it is 5 years old ticket and
 the problem is still present at least in 1.5.1.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.fd17901ba15cb61279eee8b65d517d35%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #10244: FileFields can't be set to NULL in the db

2011-12-17 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
 Reporter:  oyvind   |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Database layer   |  Version:  1.0
  (models, ORM)  |   Resolution:
 Severity:  Normal   | Triage Stage:  Accepted
 Keywords:  filefield NULL   |  Needs documentation:  0
  empty  |  Patch needs improvement:  0
Has patch:  0|UI/UX:  0
  Needs tests:  0|
Easy pickings:  0|
-+-
Changes (by aaugustin):

 * ui_ux:   => 0
 * easy:   => 0
 * stage:  Design decision needed => Accepted


Comment:

 I see two possible solutions:
 - 1. document that `FileField` ignores the `null` keyword argument; this
 is the most backwards compatible solution;
 - 2. make `FileField` behave exactly like `CharField` wrt. `null`; this is
 the most consistent solution.

 Option 2. will be backwards incompatible only for people who set
 `null=True` on a `FileField`. The docs discourage that heavily, and it
 doesn't behave as expected, actually it doesn't even do anything, so there
 isn't much reason to have such code. That's why I think the change would
 be acceptable.

 I have a slight preference for option 2, which is better in the long term.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10244: FileFields can't be set to NULL in the db

2011-04-01 Thread Django
#10244: FileFields can't be set to NULL in the db
-+-
   Reporter:  oyvind |Owner:  nobody
   Type:  Bug|   Status:  new
  Milestone: |Component:  Database layer
Version:  1.0|  (models, ORM)
 Resolution: | Severity:  Normal
   Triage Stage:  Design | Keywords:  filefield NULL empty
  decision needed|Has patch:  0
Needs documentation:  0  |  Needs tests:  0
Patch needs improvement:  0  |
-+-
Changes (by SmileyChris):

 * type:   => Bug
 * severity:   => Normal


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #10244: FileFields can't be set to NULL in the db

2009-05-06 Thread Django
#10244: FileFields can't be set to NULL in the db
---+
  Reporter:  oyvind| Owner:  nobody 
 
Status:  new   | Milestone: 
 
 Component:  Database layer (models, ORM)  |   Version:  1.0
 
Resolution:|  Keywords:  filefield 
NULL empty
 Stage:  Design decision needed| Has_patch:  0  
 
Needs_docs:  0 |   Needs_tests:  0  
 
Needs_better_patch:  0 |  
---+
Changes (by thejaswi_puthraya):

  * component:  Uncategorized => Database layer (models, ORM)

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10244: FileFields can't be set to NULL in the db

2009-04-06 Thread Django
#10244: FileFields can't be set to NULL in the db
-+--
  Reporter:  oyvind  | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Uncategorized   |   Version:  1.0  
   
Resolution:  |  Keywords:  filefield NULL 
empty
 Stage:  Design decision needed  | Has_patch:  0
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Comment (by kmtracey):

 Dev list discussion: http://groups.google.com/group/django-
 developers/browse_thread/thread/cf37abc95e49f0e/

 Also, #10749 reported surprise at searching for None not working when
 looking for empty !ImageFields.  I still think changing this now breaks
 backwards-compatibility, though.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10244: FileFields can't be set to NULL in the db

2009-02-26 Thread Django
#10244: FileFields can't be set to NULL in the db
-+--
  Reporter:  oyvind  | Owner:  nobody   
   
Status:  new | Milestone:   
   
 Component:  Uncategorized   |   Version:  1.0  
   
Resolution:  |  Keywords:  filefield NULL 
empty
 Stage:  Design decision needed  | Has_patch:  0
   
Needs_docs:  0   |   Needs_tests:  0
   
Needs_better_patch:  0   |  
-+--
Changes (by Alex):

  * stage:  Unreviewed => Design decision needed

Comment:

 needs to be decided whether the CharField behavior should be used
 throughout, or NULL where explicitly requested

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10244: FileFields can't be set to NULL in the db

2009-02-20 Thread Django
#10244: FileFields can't be set to NULL in the db
+---
  Reporter:  oyvind | Owner:  nobody  
Status:  new| Milestone:  
 Component:  Uncategorized  |   Version:  1.0 
Resolution: |  Keywords:  filefield NULL empty
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Comment (by oyvind):

 Example to test this issue:

 {{{
 #!python

 class File(models.Model):

 file = models.FileField(null=True, upload_to='files')
 }}}

 {{{
 #!python

 from models import File

 f = File()
 f.file = None
 f.save()

 from django.db import connection
 print connection.queries

 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



Re: [Django] #10244: FileFields can't be set to NULL in the db

2009-02-12 Thread Django
#10244: FileFields can't be set to NULL in the db
+---
  Reporter:  oyvind | Owner:  nobody  
Status:  new| Milestone:  
 Component:  Uncategorized  |   Version:  1.0 
Resolution: |  Keywords:  filefield NULL empty
 Stage:  Unreviewed | Has_patch:  0   
Needs_docs:  0  |   Needs_tests:  0   
Needs_better_patch:  0  |  
+---
Changes (by oyvind):

  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * needs_docs:  => 0

Comment:

 Patch does not seem to work quite like I expected. So the problem
 persists.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---



[Django] #10244: FileFields can't be set to NULL in the db

2009-02-12 Thread Django
#10244: FileFields can't be set to NULL in the db
--+-
 Reporter:  oyvind|   Owner:  nobody
   Status:  new   |   Milestone:
Component:  Uncategorized | Version:  1.0   
 Keywords:  filefield NULL empty  |   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 Saving FileFields with a none value sets the field to a empty string in
 the db and not NULL as it should.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---