Forest,
I've tried the following:

for s in s2:
        s.price *= s.price * .9

However, I still get the following error:

TypeError at /plush/chandra/antara/108/multi/
unsupported operand type(s) for *: 'Price' and 'float'

////////////////

How can I tell what type my s.price is?  In order to successfully do a
times I currently have to do the following 'int(str(s2[0].price)) * .
9'.



On Dec 16, 10:08 am, Forest Bond <[EMAIL PROTECTED]> wrote:
> Hi,
>
> On Sun, Dec 16, 2007 at 07:59:52AM -0800, Greg wrote:
> > I've added that code into my view.  However, now I'm getting the
> > following error:
>
> > TypeError at /manu/coll/style/
> > unsupported operand type(s) for *=: 'Price' and 'float'
>
> > ////////////////
>
> > I can't do a int(s.price), because then I get a 'Can't assign to
> > function call' error.
>
> How about:
>
> for s in s2:
>     s.price = s.price * 0.9
>
> Haven't tried it, but I think that will work.
>
> Maybe django's FloatField and DecimalField should support *=, but it appears
> that they currently don't ... ?
>
> -Forest
> --
> Forest Bondhttp://www.alittletooquiet.net
>
>  signature.asc
> 1KDownload
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to