Re: csrf_exempt decorator and class based views

2011-03-08 Thread Casey S. Greene
Have you seen this yet: http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-class-based-views I think it answers your question. Hope this helps, Casey On 03/08/2011 08:19 AM, Christo Buschek wrote: Hello. I came across a problem that I don't fully understand. I try to i

Re: Django-Celery: Rate Limit

2011-03-07 Thread Casey S. Greene
You might want to try these questions on the celery mailing list: http://groups.google.com/group/celery-users Hope this helps, Casey On 03/07/2011 09:58 AM, ju wrote: Why when I use rate_limit even the first task and the first try is waiting for some time before it's executed? -- You received

Re: Cross Site Request Forgery (csrf) via POST / JQuery

2011-02-25 Thread Casey S. Greene
I'm not sure if you ever solved this, but the provided code didn't work with jquery 1.5.0 for me (though it does with 1.4.4 and 1.5.1). Maybe this is what you are observing. Hope this helps! Casey On 02/22/2011 08:30 PM, gorans wrote: Hi I'm using Django's CSRFViewMiddleware and am making a

Re: Question(s) Concerning Securing Pages From Bots?

2011-02-22 Thread Casey S. Greene
The term that you are looking for is "captcha." If you google for: django captcha you will find a wealth of information. Hope this helps! Casey On 02/22/2011 01:09 PM, hank23 wrote: On some web pages the user is prompted to type in a series of randomly generated characters which appear on th

Re: Ordering/sort_by from a custom method

2011-02-09 Thread Casey S. Greene
I haven't used django-voting but it sounds to me like you want something like: Link.objects.aggregate(Avg(score = 'vote__score')).order_by('score') If I recall correctly you can chain aggregate and order_by. Anyway, that example and this link should get you started at least: http://docs.djangopro

Re: Django Project - handling call to the "root" url?

2011-02-02 Thread Casey S. Greene
Hi Derek, When people log in, what do you want to happen? Do you want them to reach the admin interface or some other page? -- Casey On 02/02/2011 09:35 AM, Derek wrote: Tom Restated thusly: 1. I want the "/" to display the login form (and not append 'admin/' to the visible URL) 2. I want

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Casey S. Greene
autocommit key in the OPTIONS part of your database configuration in DATABASES: 'OPTIONS': { 'autocommit': True, } from http://docs.djangoproject.com/en/1.2/ref/databases/ -- Casey On 02/01/2011 01:52 PM, Casey S. Greene wrote: Here is some code pulled from my (us

Re: Django, Postgres and recovering from database constraints

2011-02-01 Thread Casey S. Greene
Here is some code pulled from my (using postgres) django application that recovers fine. Perhaps this is helpful to you. I am storing the non-unique values and dealing with them later (pulling from an external source that is supposed to have unique IDs assigned but they don't always pan out s

Re: Django compressor

2011-01-15 Thread Casey S. Greene
Assuming you mean this: https://github.com/mintchaos/django_compressor From their example: {% load compress %} {% compress css %} charset="utf-8"> p { border:5px solid green;} charset="utf-8"> {% endcompress %} This goes in your template. Make the CSS for that page a separate file and only

Re: django-admin.py startproject myproject - problem

2011-01-15 Thread Casey S. Greene
It looks like django is not in your site packages directory. Did you specifically want to install the development version (that is what you linked to)? If not, then a simple: sudo apt-get install python-django will install django in kubuntu (10.10 at least, and I think earlier). Hope this h

Re: How to aggregate values by month

2010-10-28 Thread Casey S. Greene
Hi Rogério, You can output to json using templates if this is the only thing holding you back from a working solution using regroup. You can use render_to_string with a json template which you can then return with an HttpResponse. It doesn't take advantage of the serialization library but i

Re: Displaying a template table using a query set

2010-10-20 Thread Casey S. Greene
Hi Pranav, I think what Steve was saying is that if you go back to your original template and view: {% for row in table_data %} {% for value in row %} {{ row }} {% endfor %} {% endfor %} and you know, for instance, what fields you want to display and how (like your id field) that you d

Re: writing HTML Code into Template with render_to_response: How?

2010-08-25 Thread Casey S. Greene
I would caution that what you are doing may make maintenance difficult later. You may want to evaluate using whether creating the table in the template is more appropriate. -- Casey On 08/25/2010 09:21 AM, Tim Sawyer wrote: On 25/08/10 13:36, mdolphin wrote: OK, that's probably a Newbee Que

Re: [HELP] To make a basecamp like - project management site

2010-08-14 Thread Casey S. Greene
You should check out Basie: http://basieproject.org/index.html I haven't used basecamp so I don't know if they are comparable. Hope this helps! -- Casey On 08/14/2010 09:20 AM, Micheal Kang wrote: Hi all, I'm trying to make a basecamp(http://basecamphq.com/) like project management site, for

Re: Registration

2010-08-09 Thread Casey S. Greene
What if the user puts in a "fake" e-mail that belongs to someone else? Then any service notifications go to the poor person who owns the e-mail address, not the person who signed up for the account. Also the user would get to take advantage of the benefits of the service. With B only the init

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread Casey S. Greene
couldn't get the actual result. Could you people can give a gist of what happens when we type "django-admin.py startproject mysite" i.e., which program will run when we type that and press return key. On Aug 1, 12:41 am, "Casey S. Greene" wrote: Hi, I'm not a wind

Re: Which program will run when we execute "djano-admin.py startproject mysite" command?

2010-07-31 Thread Casey S. Greene
Hi, I'm not a windows user but I'm guessing that you want to use the python executable (see if you can find something called "python". Alternatively, what if you run it with: python django-admin.py startproject mysite Hope this helps, -- Casey On 07/31/2010 03:12 PM, balu wrote: Hi everybo

[SOLVED] Re: Filtering within a ModelForm

2010-07-30 Thread Casey S. Greene
Hi Derek, Thanks for your help -- I had tried both of those but couldn't get them to work with generic views. In the end I just abandoned the generic view and used the __init__() approach and things worked. -- Casey On 07/28/2010 09:35 AM, derek wrote: On Jul 26, 6:52 pm, "Casey

Re: Filtering within a ModelForm

2010-07-26 Thread Casey S. Greene
Does anyone have a hint for this (or an idea of where to get started in the documentation)? This seems relatively simple so my best guess is that there is something that I am just missing. Thanks! -- Casey On 07/22/2010 10:16 AM, Casey S. Greene wrote: I am trying to figure out a

Re: django + serving static CSS

2010-07-23 Thread Casey S. Greene
Sorry, I just noticed the 80/8000 ports. A better answer anyway would be to use the media URL: http://docs.djangoproject.com/en/dev/ref/settings/#setting-MEDIA_URL -- Casey On 07/23/2010 08:24 AM, Casey S. Greene wrote: Maybe I am confused but I think the answer is to put into the base

Re: django + serving static CSS

2010-07-23 Thread Casey S. Greene
Maybe I am confused but I think the answer is to put into the base template? I believe he said that /media is serving the files. -- Casey On 07/23/2010 07:35 AM, Michael P. Soulier wrote: On 23/07/10 Thomas said: Hi I am trying to include a css file and I've tried this in settings.py: ME

Re: How retrieve a single object rather than a list from DB?

2010-07-22 Thread Casey S. Greene
Hi, If you definitely want a get_or_none style method, django-annoying has: # get_object_or_None function - similar to get_object_or_404, but returns None if object not found. http://bitbucket.org/offline/django-annoying/wiki/Home Hope this helps, -- Casey On 07/22/2010 09:50 AM, Darius Da

Filtering within a ModelForm

2010-07-22 Thread Casey S. Greene
I am trying to figure out a reasonable way to filter using a queryset within a ModelForm. In a simple example, I have three models (A, B, and C). C has many A and B A and B have a many to many relationship. Assume that some instances of C and instances of B already exist. I am using the create

Re: trouble with many to many form

2010-06-23 Thread Casey S. Greene
I am also pretty new to django but I think that what you are looking for is the many to many through relationship: http://docs.djangoproject.com/en/dev/topics/db/models/#extra-fields-on-many-to-many-relationships Maybe someone else can provide more information if that doesn't get you started.