google-code-export / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Photo Size Throwing Error on save #159

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. add photologue to installed_apps
2. run syncdb
3. run plinit OR add photo size from admin

django's fields.py has a __cmp__ method comparing two fields. photologue's 
PhotoSize model is passing 1 field and a None to this method at some point.

using photologue 2.3 and django 1.2.2

I have pip installed / uninstalled / re-installed both django and photologue, 
deleted the database, multiple times. This happens every time.

[TRACEBACK]

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/photologue/photosize/add/
Django Version: 1.2.1
Python Version: 2.6.6
Installed Applications:
['debug_toolbar',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'django.contrib.flatpages',
 'django.contrib.sitemaps',
 'django.contrib.comments',
 'codedependant.core',
 'codedependant.publisher',
 'django_extensions',
 'registration',
 'django_messages',
 'maintenancemode',
 'djapian',
 'pagination',
 'sorl.thumbnail',
 'photologue',
 'south',
 'queryset_transform',
 'hotsauce']
Installed Middleware:
('django.middleware.gzip.GZipMiddleware',
 'django.middleware.cache.UpdateCacheMiddleware',
 'django.middleware.common.CommonMiddleware',
 'django.middleware.http.ConditionalGetMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'pagination.middleware.PaginationMiddleware',
 'django.contrib.flatpages.middleware.FlatpageFallbackMiddleware',
 'maintenancemode.middleware.MaintenanceModeMiddleware',
 'django.middleware.cache.FetchFromCacheMiddleware',
 'debug_toolbar.middleware.DebugToolbarMiddleware')

Traceback:
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\core\handler
s\base.py" in get_response
  100.                     response = callback(request, *callback_args, **callback_kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\contrib\admi
n\options.py" in wrapper
  239.                 return self.admin_site.admin_view(view)(*args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\utils\decora
tors.py" in _wrapped_view
  76.                     response = view_func(request, *args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\views\decora
tors\cache.py" in _wrapped_view_func
  69.         response = view_func(request, *args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\contrib\admi
n\sites.py" in inner
  190.             return view(request, *args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\utils\decora
tors.py" in _wrapper
  21.             return decorator(bound_func)(*args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\utils\decora
tors.py" in _wrapped_view
  76.                     response = view_func(request, *args, **kwargs)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\utils\decora
tors.py" in bound_func
  17.                 return func(self, *args2, **kwargs2)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\transacti
on.py" in _commit_on_success
  299.                     res = func(*args, **kw)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\contrib\admi
n\options.py" in add_view
  795.                 self.save_model(request, new_object, form, change=False)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\contrib\admi
n\options.py" in save_model
  597.         obj.save()
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\photologue\models.p
y" in save
  694.         self.clear_cache()
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\photologue\models.p
y" in clear_cache
  682.             for obj in cls.objects.all():
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\models\qu
ery.py" in _result_iter
  106.                 self._fill_cache()
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\models\qu
ery.py" in _fill_cache
  760.                     self._result_cache.append(self._iter.next())
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\models\qu
ery.py" in iterator
  231.             pk_idx = self.model._meta.pk_index()
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\models\op
tions.py" in pk_index
  484.         return self.fields.index(self.pk)
File 
"c:\Users\Eric\postix\django-codedependant\lib\site-packages\django\db\models\fi
elds\__init__.py" in __cmp__
  124.         return cmp(self.creation_counter, other.creation_counter)

Exception Type: AttributeError at /admin/photologue/photosize/add/
Exception Value: 'NoneType' object has no attribute 'creation_counter'

Original issue reported on code.google.com by e3satter...@gmail.com on 25 Nov 2010 at 4:08

GoogleCodeExporter commented 9 years ago
I also have this same problem. I have to add Photo Sizes directly in the data 
base.
plinit command also fails for the same reason

Original comment by e3satter...@gmail.com on 12 Mar 2011 at 2:31