I'm importing some contacts from an old system, so I wrote a custom
management command called satchmo_contacts. But trying to do a
from satchmo_ext.newsletter.models import Subscription
somehow ends up giving:
ImportError: cannot import name OrderPayment
Here's the full error message:
./manage.py satchmo_contacts
/usr/local/lib/python2.6/dist-packages/registration/models.py:4:
DeprecationWarning: the sha module is deprecated; use the hashlib
module instead
import sha
^CTraceback (most recent call last):
File "./manage.py", line 27, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 191, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
base.py", line 220, in execute
output = self.handle(*args, **options)
File "/srv/bernunzio/bernunzio/../bernunzio/oldbern/management/
commands/satchmo_contacts.py", line 103, in handle
address.save()
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_store/contact/models.py", line 321, in save
super(AddressBook, self).save(**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
base.py", line 460, in save
self.save_base(using=using, force_insert=force_insert,
force_update=force_update)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
base.py", line 526, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 491, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
compiler.py", line 869, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
compiler.py", line 734, in execute_sql
cursor = self.connection.cursor()
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
__init__.py", line 250, in cursor
cursor = self.make_debug_cursor(self._cursor())
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
mysql/base.py", line 299, in _cursor
if not self._valid_connection():
File "/usr/local/lib/python2.6/dist-packages/django/db/backends/
mysql/base.py", line 291, in _valid_connection
self.connection.ping()
KeyboardInterrupt
luke@mountain:/srv/bernunzio/bernunzio$ ./manage.py satchmo_contacts
/usr/local/lib/python2.6/dist-packages/registration/models.py:4:
DeprecationWarning: the sha module is deprecated; use the hashlib
module instead
import sha
Traceback (most recent call last):
File "./manage.py", line 27, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 438, in execute_manager
utility.execute()
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 261, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/usr/local/lib/python2.6/dist-packages/django/core/management/
__init__.py", line 67, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name,
name))
File "/usr/local/lib/python2.6/dist-packages/django/utils/
importlib.py", line 35, in import_module
__import__(name)
File "/srv/bernunzio/bernunzio/../bernunzio/oldbern/management/
commands/satchmo_contacts.py", line 7, in <module>
from satchmo_ext.newsletter.models import Subscription
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_ext/newsletter/models.py", line 110, in <module>
import listeners
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_ext/newsletter/listeners.py", line 3, in <module>
from satchmo_store.contact.forms import ContactInfoForm
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_store/contact/forms.py", line 8, in <module>
from satchmo_store.shop.models import Config
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_store/shop/models.py", line 1230, in <module>
class OrderPaymentBase(models.Model):
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
satchmo_store/shop/models.py", line 1232, in OrderPaymentBase
max_length=25, blank=True)
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
payment/fields.py", line 18, in __init__
kwargs['choices'] = labelled_gateway_choices()
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
payment/config.py", line 114, in labelled_gateway_choices
for module, group in active_gateways():
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
payment/__init__.py", line 7, in active_gateways
for app in models.get_apps():
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 115, in get_apps
self._populate()
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 64, in _populate
self.load_app(app_name)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
loading.py", line 78, in load_app
models = import_module('.models', app_name)
File "/usr/local/lib/python2.6/dist-packages/django/utils/
importlib.py", line 35, in import_module
__import__(name)
File "/usr/local/lib/python2.6/dist-packages/Satchmo-0.9.2-py2.6.egg/
payment/models.py", line 15, in <module>
from satchmo_store.shop.models import OrderPayment
ImportError: cannot import name OrderPayment
What gives? I've been able to import other Satchmo models just fine,
this is the first one that gives me problems.
Thanks much!
Luke
--
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.