Re: [Django] #10196: width/height_field not being set on ImageField

2009-02-15 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  1 |  
---+
Changes (by kmtracey):

  * needs_better_patch:  0 => 1

Comment:

 Oh, yeah, that needs to be fixed.  I had noticed that at one point but
 forgot about it, and ran out of time today before testing on a PIL-less
 box.  Thanks, I do believe it'll blow up there as now coded.

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-15 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Comment (by Alex):

 Karen, correct me if I'm wrong but won't all the tests using the
 OptionalImage model break if the user doesn't have PIL since they access
 attrs that won't exist?

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-15 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  0  

Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

  * needs_better_patch:  1 => 0
  * needs_tests:  1 => 0

Comment:

 Attached patch with integrated tests.  Tests verify width/height are set
 and re-set properly (and rely on a 2nd .png file with different size which
 I don't think can be included in the attached diff since it's binary, but
 I have it).  Tests pass on 1.0.X branch, fail on current trunk, pass with
 the fix in the patch.

 There really should be one more test, that verifies for a blank=True
 !ImageField, once a value for the !ImageField has been set, editing the
 instance without re-uploading an image does not affect the already-set
 image (nor the auto-set width/height properties), but that test cannot
 pass on trunk until a fix for #10121 has been checked in so I have not
 included that test here yet.

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-15 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  1 |  
---+
Comment (by kmtracey):

 I believe the patch does fix the error here.  The difficulty with the
 tests is that there are also tests in the file that make the file field
 optional, and test saving with no file, and in that case you run into
 trouble if you do not allow for the width and height fields to be null.
 (Given the way doctests do not identify the actual line number of the
 failure, and the fact that the test keep re-using the same variable names,
 it is a bit difficult to spot the exact problem.  But the problem in the
 tests if null=True is not specified is in fact for the save with no file,
 not for the case where the file is included.)

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-05 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  1 |  
---+
Comment (by vicvicvic):

 Okay, this is weird. The tests fail with null=False in width and height
 fields, but it works in my admin as it should. I might have to review the
 tests I made.

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-05 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  1 |  
---+
Changes (by vicvicvic):

  * needs_better_patch:  0 => 1

Comment:

 I'm completely new to writing tests, so I don't really know where to put
 this. Since this problem seems to arise when using ModelForms, I tried
 adding some checks to the modeltests/model_forms test of the ImageFile
 model. Should I create a separate test for this?

 Unfortunately, the tests I did run showed that the problem is '''not'''
 fixed by my patch. The width and height fields are not set until the model
 is saved, which somehow is causing an IntegrityError because they are
 apparently NULL at the time of INSERT/UPDATE. Using a width_field that has
 null=True appears to fix this (somehow the width is seemingly recorded to
 the database as well).

 I'm attaching the tests I made, which fail as is, but work if lines
 114-115 are changed to (add null=True to ImageFile's width and height
 fields):
 {{{
 width = models.IntegerField(editable=False, null=True)
 height = models.IntegerField(editable=False, null=True)
 }}}

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-04 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  0 |  
---+
Comment (by Alex):

 I don't see anything that leads me to believe it would, but since that
 problem applies to ImageFields only my guess is it's either this or
 something similar.

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-04 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  0 |  
---+
Comment (by kmtracey):

 Any idea if this will also fix #10121?

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-04 Thread Django
#10196: width/height_field not being set on ImageField
---+
  Reporter:  vicvicvic | Owner:  nobody 

Status:  new   | Milestone: 

 Component:  File uploads/storage  |   Version:  SVN

Resolution:|  Keywords:  imagefield, 
width_field
 Stage:  Accepted  | Has_patch:  1  

Needs_docs:  0 |   Needs_tests:  1  

Needs_better_patch:  0 |  
---+
Changes (by Alex):

  * needs_better_patch:  => 0
  * stage:  Unreviewed => Accepted
  * needs_tests:  => 1
  * needs_docs:  => 0

Comment:

 This fix looks to be correct, could you please add a testcase?

-- 
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] #10196: width/height_field not being set on ImageField

2009-02-04 Thread Django
#10196: width/height_field not being set on ImageField
-+--
 Reporter:  vicvicvic|   Owner:  nobody
   Status:  new  |   Milestone:
Component:  File uploads/storage | Version:  SVN   
 Keywords:  imagefield, width_field  |   Stage:  Unreviewed
Has_patch:  1|  
-+--
 [9766] broke (width|height)_field for ImageField. They are not being
 updated properly because ImageField.save is not being called.

 This was reported both in #10044 and on http://groups.google.com/group
 /django-
 users/browse_thread/thread/6fb4b1e8ec37fda3/eaf739b883e66fcf#eaf739b883e66fcf
 but I can't seem to find a ticket for it.

 At any rate, I believe I have found the problem and am submitting a patch
 which restores functionality.

-- 
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
-~--~~~~--~~--~--~---