On Feb 23, 9:10 pm, soFh <ahmed...@gmail.com> wrote:
> Well i was already  thinking that i am not so clear in my question.
> so better let me post my model and what i want here .
>
> http://dpaste.com/163776/
>
> sorry I missed by mistake "C" of class Rates while pasting it on
> dpaste.
>
> Anyways there are two models.
> there is one field billsec in model named "Ast" which is duration of
> call. there is one field named "dst" which is "dialed Number " .
> What i want is is to compare this dialed number by the prefix given in
> Rates Model and then multiply that Rate with duration to show  the
> cost of call.
> hope i am bit  clear now .
> Thanks in advance for any tip..
> regards

I don't see where you are having a problem. Your logic, as you give it
above, is quite clear:

    my_prefix = my_ast.dst[:5] # or however long the prefix is
    my_rate = Rate.objects.get(prefix=my_prefix)
    cost = my_rate.rate * my_ast.billsec

--
DR.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@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.

Reply via email to