ApplicationError: 2 nonnumeric port: ''

2009-04-09 Thread Jarred Bishop
Hello, I'm getting a nonnumeric port error and was wondering if anyone could shed some light on it? I'm running python 2.5.1 and trying to use this (http:// www.djangosnippets.org/snippets/1353/) django snippet to add oauth functionality to my app. The line that it doesn't like is: ' response = c

Ordering by ManyToManyField length

2008-09-06 Thread Jarred Bishop
Hello. How would I do this? Say I have a model 'Tag' that has a ManyToManyField called 'entries', can I order a query by total entries? something like this is how I imagine it would work: Tag.objects.all().order_by("entries.count") but I cannot find a proper example. Thanks for your help. --~--

Re: python strings containing backslashes

2008-06-28 Thread Jarred Bishop
Haha. so obvious. Thanks Malcolm On Jun 28, 9:25 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sat, 2008-06-28 at 01:17 -0700, Jarred Bishop wrote: > > hello, I'm trying to get the index of the last backslash from a string > > in python. > > > The p

python strings containing backslashes

2008-06-28 Thread Jarred Bishop
hello, I'm trying to get the index of the last backslash from a string in python. The problem I have is that the backslash before the last quotation mark, cancels out the quote. eg: string.rfind("\") will error, because technically the string isn't closed (as a backslash before a quote escapes i

Re: simple python math help.

2008-06-15 Thread Jarred Bishop
Thanks James. I typed the above post before I saw your response. disregard it. On Jun 15, 10:02 pm, Jarred Bishop <[EMAIL PROTECTED]> wrote: > Thanks for that, i see now. However it doesn't solve my problem. Is > there a way to force it to return a decimal when whole numbe

Re: simple python math help.

2008-06-15 Thread Jarred Bishop
ratio = dimensions[0]/dimensions[1] return ratio On Jun 15, 9:49 pm, Sebastian Bauer <[EMAIL PROTECTED]> wrote: > size = [200.0, 400.0] > return size[0]/size[1] > > Jarred Bishop pisze: > > > Hi, this is driving me crazy. I'm sure there is a VERY simple solutio

simple python math help.

2008-06-15 Thread Jarred Bishop
Hi, this is driving me crazy. I'm sure there is a VERY simple solution but can't seem to find it. thanks for you help. if I have size = 200, 400 return size[0]/size[1] it returns '0'. which isnt much help. how do i get '0.5' or '.5' ? Thanks. --~--~-~--~~---

Re: images in templates?

2008-06-01 Thread Jarred Bishop
Hi, the problem is (like you mentioned) django has no reference to where your images are. A way i got around this was, adding a line to my urls.py that contained a 'static' folder. for example: (r'^static/(?P.*)$', 'django.views.static.serve', {'document_root': 'C:/path-to-project/templates/stat