I think this is my issue:
class BookCategory(Category):
....
parent = models.ForeignKey('AuthorCategory')
...

The field "parent" already exists in Category, and I'm trying to
replace it with a subclass of Category.  That is, a Category can have
a Category as a parent, but I want a BookCategory to limit the choice
of parents to AuthorCategories.  I think there is probably a better
way to do this.

On Mar 23, 9:23 pm, Jon <[email protected]> wrote:
> Here's the error.  What I mean by a built-in query is that this is all
> inside the Django admin.   When I add a new BookCategory through the
> admin and hit save, I get this error.  Thanks again for all your help
> in trying to pin down what's going on.
> Environment:
>
> Request Method: POST
> Request URL:http://localhost:8081/admin/custom_satchmo/bookcategory/add/
> Django Version: 1.0-final-SVN-unknown
> Python Version: 2.5.2
> Installed Applications:
> ['django.contrib.admin',
>  'django.contrib.admindocs',
>  'django.contrib.auth',
>  'django.contrib.contenttypes',
>  'django.contrib.comments',
>  'django.contrib.sessions',
>  'django.contrib.sitemaps',
>  'django.contrib.sites',
>  'satchmo',
>  'satchmo.caching',
>  'satchmo.configuration',
>  'satchmo.shop',
>  'satchmo.contact',
>  'satchmo.product',
>  'satchmo.shipping',
>  'satchmo.payment',
>  'satchmo.discount',
>  'satchmo.giftcertificate',
>  'satchmo.supplier',
>  'satchmo.thumbnail',
>  'satchmo.l10n',
>  'satchmo.tax',
>  'satchmo.recentlist',
>  'satchmo.wishlist',
>  'satchmo.upsell',
>  'satchmo.productratings',
>  'store.site',
>  'store.custom_satchmo']
> Installed Middleware:
> ('django.middleware.common.CommonMiddleware',
>  'django.contrib.sessions.middleware.SessionMiddleware',
>  'django.middleware.locale.LocaleMiddleware',
>  'django.contrib.auth.middleware.AuthenticationMiddleware',
>  'django.middleware.doc.XViewMiddleware',
>  'satchmo.shop.SSLMiddleware.SSLRedirect',
>  'satchmo.recentlist.middleware.RecentProductMiddleware')
>
> Traceback:
> File "/var/lib/python-support/python2.5/django/core/handlers/base.py"
> in get_response
>   86.                 response = callback(request, *callback_args,
> **callback_kwargs)
> File "/var/lib/python-support/python2.5/django/contrib/admin/sites.py"
> in root
>   158.                 return self.model_page(request, *url.split('/',
> 2))
> File "/var/lib/python-support/python2.5/django/views/decorators/
> cache.py" in _wrapped_view_func
>   44.         response = view_func(request, *args, **kwargs)
> File "/var/lib/python-support/python2.5/django/contrib/admin/sites.py"
> in model_page
>   177.         return admin_obj(request, rest_of_url)
> File "/var/lib/python-support/python2.5/django/contrib/admin/
> options.py" in __call__
>   191.             return self.add_view(request)
> File "/var/lib/python-support/python2.5/django/db/transaction.py" in
> _commit_on_success
>   238.                 res = func(*args, **kw)
> File "/var/lib/python-support/python2.5/django/contrib/admin/
> options.py" in add_view
>   502.                 self.save_model(request, new_object, form,
> change=False)
> File "/var/lib/python-support/python2.5/django/contrib/admin/
> options.py" in save_model
>   376.         obj.save()
> File "/usr/lib/python2.5/site-packages/satchmo/product/models.py" in
> save
>   223.             self.slug = slugify(self.name, instance=self)
> File "/usr/lib/python2.5/site-packages/satchmo/utils/unique_id.py" in
> slugify
>   95.         while get_query():
> File "/var/lib/python-support/python2.5/django/db/models/query.py" in
> __nonzero__
>   185.             iter(self).next()
> File "/var/lib/python-support/python2.5/django/db/models/query.py" in
> _result_iter
>   179.                 self._fill_cache()
> File "/var/lib/python-support/python2.5/django/db/models/query.py" in
> _fill_cache
>   612.                     self._result_cache.append(self._iter.next
> ())
> File "/var/lib/python-support/python2.5/django/db/models/query.py" in
> iterator
>   269.         for row in self.query.results_iter():
> File "/var/lib/python-support/python2.5/django/db/models/sql/query.py"
> in results_iter
>   206.         for rows in self.execute_sql(MULTI):
> File "/var/lib/python-support/python2.5/django/db/models/sql/query.py"
> in execute_sql
>   1700.         cursor.execute(sql, params)
> File "/var/lib/python-support/python2.5/django/db/backends/util.py" in
> execute
>   19.             return self.cursor.execute(sql, params)
> File "/var/lib/python-support/python2.5/django/db/backends/sqlite3/
> base.py" in execute
>   167.         return Database.Cursor.execute(self, query, params)
>
> Exception Type: OperationalError at /admin/custom_satchmo/bookcategory/
> add/
> Exception Value: no such column:
> custom_satchmo_authorcategory.category_ptr_id
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Satchmo users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/satchmo-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to