How to filter arithmetic seires in loop?

2011-10-22 Thread Tsung-Hsien
I want to filter a loop when the number comes to 1,5,9,13,17... I use this but fail {% if forloop.counter |divisibleby range(1,100,4)%}{% endif %} How to fix it, thanks a lot !! -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: custom queryset with calculated field

2011-10-22 Thread Pedro Vasconcelos
If you post the relevant part of your code in http://dpaste.com/ will be more easy to help you! On Saturday, October 22, 2011, dr.phil wrote: > Thank you for the response. I added a function to the model to convert > a datetime field into the needed format (def

How to do string operations in Templates?

2011-10-22 Thread Lee
New to template language. I've perused the docs but can't find how to do basic string operations like regex match/replace on {{ string variables }} within a template. Can someone please steer me to the right docs? Thanks much- Lee -- You received this message because you are subscribed to the

Re: Django as a Standalone Desktop Application

2011-10-22 Thread Alex Mandel
On 10/21/2011 07:35 PM, kenneth gonsalves wrote: > On Sat, 2011-10-22 at 00:02 +0200, Ivo Brodien wrote: >> I think with django this is an easy tast. >> >> This might loos like a typical Excel/VBA and maybe Word thing, but I >> don’t want to use non open source software for this and since I like

Re: custom queryset with calculated field

2011-10-22 Thread Casey Greene
The database isn't going to know about your property because that's all on the python side (thus the error). Why do you need the formatted time when looking in the database? I think Pedro is right, if this is only for display, it'd be better to do it with a template tag/filter. Casey On

Re: custom queryset with calculated field

2011-10-22 Thread dr.phil
Thank you for the response. I added a function to the model to convert a datetime field into the needed format (def convert_time). Then I set new_time = property(convert_time). If I iterate over the queryset I can access each.new_time BUT I need the value in the queryset

Re: Storage Backend for MediaTemple's ProCDN?

2011-10-22 Thread Kurtis
Hello, I never heard of MediaTemple or their CDN until I read your post. I tried to look at their site for your information and it seems to be hidden. We just went through this same thing but starting with Rackspace and then moved to Amazon. One thing I ran across is that they (MT) use

Re: Cannot install freetype to use the 'django-simple-captcha' application.

2011-10-22 Thread Kurtis
I don't run Windows but I quickly glanced over the Freetype documentation. You'll need to make sure that Freetype is in your compiler path and that you reference it when you compile PIL. For my information, look at this page: http://freetype.sourceforge.net/freetype2/docs/tutorial/step1.html

Storage Backend for MediaTemple's ProCDN?

2011-10-22 Thread Kevin
I have a client who is suggesting that I look into MediaTemple's ProCDN. I currently only have experience with RackSpace's CloudFiles CDN, and only know of it and Amazon S3 for django storage support. Furthermore, I cannot seem to access their API pages without having a login, so this complicates

django, celery and rabbitmq. Task gets added twice

2011-10-22 Thread tom
Hello, I am using django 1.3, together with djcelery 2.3.3 and rabbitmq. When I create a task via one specific post_save signal, the get_basecamp_account.delay() task gets added twice to the queue. I have checked, the post save signal got only called once. The signal is executed once,

Cannot install freetype to use the 'django-simple-captcha' application.

2011-10-22 Thread jenia ivlev
Hello. I want to install Freetype and pil for windows and don't know how to proceed. I'm using python 2.7 with Django and windows 7. I installed the PIL and Freetype binaries but still my code cannot execute Freetype (although PIL works perfectly). That's the Freetype libaries:

Re: CSRF verification failed. Request aborted.

2011-10-22 Thread Kayode Odeyemi
On Sat, Oct 22, 2011 at 9:40 PM, wrote: > On Sat, 22 Oct 2011 19:21:59 +0100 > Kayode Odeyemi wrote: > > > I am accessing my view from a Drupal application that sends in data > > via POST. I'm not using any REST API such as > > piston,

GeoDjango on Windows.

2011-10-22 Thread Dipo Elegbede
Hi all, Has anyone successfully installed geo Django on windows 7? Please help me with details to do so.i'm running python 2.6 I've tried several times and it keeps telling me a particular lib geoc_1 is missing. I have tried adding the directory to my path in the environmental variable and

Re: CSRF verification failed. Request aborted.

2011-10-22 Thread web2 . 0+google
On Sat, 22 Oct 2011 19:21:59 +0100 Kayode Odeyemi wrote: > I am accessing my view from a Drupal application that sends in data > via POST. I'm not using any REST API such as > piston, django-tastypie. > > A few days ago, I'm smiling and happy that it all worked. Today, it's >

CSRF verification failed. Request aborted.

2011-10-22 Thread Kayode Odeyemi
Hello, I am accessing my view from a Drupal application that sends in data via POST. I'm not using any REST API such as piston, django-tastypie. A few days ago, I'm smiling and happy that it all worked. Today, it's a different story. I'm currently getting: Forbidden (403) CSRF verification

Re: custom queryset with calculated field

2011-10-22 Thread Pedro Vasconcelos
Hello, A possible solution is create a specific method in your model class to do this calculation. Take a look at: https://docs.djangoproject.com/en/1.3/topics/db/models/#model-methods If you only want to do this calculations to show it in templates you may consider creating a specific template

ModelForm - formwizard - Form on multiple pages

2011-10-22 Thread youpsla
Hello, I'm buiding a website where users hae t fill a form. It's not a really big one but I like to split it on multiple pages. I can build the database with only one big table but I prefer for update (index) reason split in 3 or 4 tables. (Maybe you'll find some quetions like beginners one ...

Re: How do you pinpoint a performance issue?

2011-10-22 Thread Casey Greene
My impression here is that the django-debug-toolbar wouldn't help here though, because the issue wasn't with the request. It was during initialization of the gunicorn processes. You can have logging.debug at function enter/exit points, so that you can switch to that log level if necessary

custom queryset with calculated field

2011-10-22 Thread dr.phil
Is this possible? I have a model that includes a datetime field. When creating a queryset of this model, I want to include a calculated field of the time difference (in hours:minutes compared to datetime.now). Currently, when creating a queryset the datetime is included. I can iterate through

RE: [] DB for 2010 Census Zip Code Data

2011-10-22 Thread Henrik Genssen
you can take the postalcodes from here, too: http://www.geonames.org/export/ just insert them into a database and do your calculations... regards Henrik >reply to message: >date: 21.10.2011 20:08:13 >from: "Kurtis" >to: "Django users"

Django - pagination - split articles manually?

2011-10-22 Thread Petey
Is it possible to split articles manually with some sort of a pagination tag in the text? Whole text: Part 1: Lorem ipsum dolor sit amet, consectetur adipiscing elit. {{ split_tag.page1 }} Part 2: Vivamus sit amet odio a turpis congue tincidunt. {{ split_tag.page2 }} etc. -- You received

Re: Django as a Standalone Desktop Application

2011-10-22 Thread Chandrakant Kumar
On 10/22/2011 08:05 AM, kenneth gonsalves wrote: On Sat, 2011-10-22 at 00:02 +0200, Ivo Brodien wrote: I think with django this is an easy tast. This might loos like a typical Excel/VBA and maybe Word thing, but I don’t want to use non open source software for this and since I like Django and