Karen, Good point - I will certainly use dpaste in the future. Here's the traceback, I should have copied that in right from the start:
Traceback: File "/home/queryclick/webapps/django/lib/python2.5/django/core/ handlers/base.py" in get_response 86. response = callback(request, *callback_args, **callback_kwargs) File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ admin/sites.py" in root 157. return self.model_page(request, *url.split('/', 2)) File "/home/queryclick/webapps/django/lib/python2.5/django/views/ decorators/cache.py" in _wrapped_view_func 44. response = view_func(request, *args, **kwargs) File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ admin/sites.py" in model_page 176. return admin_obj(request, rest_of_url) File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ admin/options.py" in __call__ 197. return self.change_view(request, unquote(url)) File "/home/queryclick/webapps/django/lib/python2.5/django/db/ transaction.py" in _commit_on_success 238. res = func(*args, **kw) File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ admin/options.py" in change_view 580. self.save_model(request, new_object, form, change=True) File "/home/queryclick/webapps/django/lib/python2.5/django/contrib/ admin/options.py" in save_model 376. obj.save() File "/home/queryclick/webapps/django/bullet/invoices/models.py" in save 79. # self.customer.outstanding_amount = Decimal('100.00') File "/home/queryclick/webapps/django/lib/python2.5/django/db/models/ base.py" in save 311. self.save_base(force_insert=force_insert, force_update=force_update) File "/home/queryclick/webapps/django/lib/python2.5/django/db/models/ base.py" in save_base 361. values = [(f, None, f.get_db_prep_save(raw and getattr(self, f.attname) or f.pre_save(self, False))) for f in non_pks] File "/home/queryclick/webapps/django/lib/python2.5/django/db/models/ fields/__init__.py" in get_db_prep_save 192. return self.get_db_prep_value(value) File "/home/queryclick/webapps/django/lib/python2.5/django/db/models/ fields/__init__.py" in get_db_prep_value 610. self.max_digits, self.decimal_places) File "/home/queryclick/webapps/django/lib/python2.5/django/db/backends/ __init__.py" in value_to_db_decimal 345. return util.format_number(value, max_digits, decimal_places) File "/home/queryclick/webapps/django/lib/python2.5/django/db/backends/ util.py" in format_number 130. return u'%s' % str(value.quantize(decimal.Decimal(".1") ** decimal_places, context=context)) Exception Type: TypeError at /admin/invoices/customerinvoice/1/ Exception Value: unsupported operand type(s) for ** or pow(): 'Decimal' and 'NoneType' Thanks for any help there. Al On Feb 18, 7:44 pm, Karen Tracey <kmtra...@gmail.com> wrote: > On Wed, Feb 18, 2009 at 2:30 PM, Alfonso <allanhender...@gmail.com> wrote: > > > I've got an invoice model that foreign key's to a customer model, when > > the invoice is saved I'm update a few fields in that related customer > > model to make other code in my setup work. I keep getting > > "unsupported operand type(s) for ** or pow(): 'Decimal' and > > 'NoneType'" whenever I try to save the foreignkey model: > > > [snip] > > I'm thinking I'm looking too closely at something there where the > > problem might be in the related model: > > > I'm missing something simple but what!? BTW these models are created > > in separate apps if that makes any difference. > > Your models wrap rather badly in email, someplace like dpaste.com would be > far better for viewing them. One really significant thing you've missed is > posting the traceback (again, probably better viewed on dpaste.com). The > traceback shows what exact line of code is trying to ** incompatible types, > which would be an incredibly useful bit of information to have when > diagnosing the problem. > > Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---