Template: unicode problem

2007-07-31 Thread Mario Gonzalez
Hello, I'm getting some problems with unicode in templates: 'ascii' codec can't encode character u'\xf1' in position 1: ordinal not in range(128) However, templates, database are in UTF8. I changed __str__ by __unicode__ in my models files. Django (I think) is trying to encode an ascii

Re: Template: unicode problem

2007-07-31 Thread Mario Gonzalez
On 31 jul, 12:18, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > There may well be a problem, but from the current information there is a > 0% chance of anybody being able to guess the solution. There are just > too many things it could be from bad strings in your code to bad > handling on some

Re: Template: unicode problem

2007-07-31 Thread Mario Gonzalez
On 31 jul, 12:28, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > > I understand it and please forgive my pour words :-) I'll do what > you said and I'll try to fix it by my self today. If not, I'll write > to this list for any comments. > The problem: I had a non-asci

Re: I get an error when my query returns nothing

2007-07-31 Thread Mario Gonzalez
On 31 jul, 12:45, Greg <[EMAIL PROTECTED]> wrote: > > Does anybody know what i need to do so that I don't receive this error > when the query returns nothing? > There's a difference with get() and filter(). get() always returns an object and it must be use when you're sure you've got records.

Re: More of a lighttpd question (I think)

2007-07-31 Thread Mario Gonzalez
On 31 jul, 12:49, JHeasly <[EMAIL PROTECTED]> wrote: > I keep getting this loop in my lighttpd error log: > > 09:41:07: (mod_fastcgi.c.3457) all handlers for /mysite.fcgi/ > classifieds/topjobs/5/ on /mysite.fcgi are down. I believe the process that handle fast-cgi is down. I send you some

Admin methods in any project

2007-08-10 Thread Mario Gonzalez
We know that every project needs to save data and usually the time that we've got to write templates is a lot. The question is: how can I improve the time I use to write those templates? Maybe I'm doing something wrong because if I need to enter data to different classes, ex 10 classes, in

Re: Django + PAM (Unix)

2007-09-06 Thread Mario Gonzalez
On 7 ago, 16:11, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > Hello, I'm doing some tests in a module I found: libpam-pgsql, > basically with that library you're able to authenticate accounts in a > postgres table. All my web systems are powered byDjangoandDjango > use

Re: Get function name after....

2007-04-18 Thread Mario Gonzalez
On 27 mar, 22:26, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > > At the moment we try to remember to fill in most of the details on the > > > wrapped object, but this isn't always possible (for example, the > > > __name__ attribute of a function is read-only in python 2.3). One > Today I

Django datestyle

2007-06-13 Thread Mario Gonzalez
I'm getting some problems with style DateTime field because in my country we don't use ISO style, we use ISO, DMY instead. I've got postgres installed and after activate log_statements it confirmed. Always show up: LOG: statement: SET DATESTYLE TO 'ISO' LOG: statement: BEGIN; SET

Re: Django datestyle

2007-06-13 Thread Mario Gonzalez
On 13 jun, 12:56, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > On 6/13/07, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > ... > > > all this thanks to other libraries (mx tools) > > I'm not sure if it'll help, but psycopg2 doesn't re

Re: Django datestyle

2007-06-13 Thread Mario Gonzalez
On 13 jun, 14:16, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]> wrote: > > Have you tried the DATE_FORMAT setting > (http://www.djangoproject.com/documentation/settings/#date-format)?It > doesn't change the representation stored in the DB, but *does* change > how Django displays the date. > yes, I

Re: Django datestyle

2007-06-13 Thread Mario Gonzalez
On 13 jun, 15:35, Mario Gonzalez <[EMAIL PROTECTED]> wrote: > > yes, I tried that too. I tried DATE_FORMAT and DATETIME_FORMAT with. > Currently I've got this in my settings file: > DATETIME_FORMAT = ' d-m-Y ' > > But the result is a ISO style too > arg!

Custom Form Validation

2007-06-22 Thread Mario Gonzalez
Hello, I've got a model like: class RecepcionForm(forms.Form): drivers = forms.ModelChoiceField(queryset=Driver.objects.all().order_by('- name')) lines = forms.CharField() def clean_lines(): if not format_is_correct( lines ): raise

Get function name after....

2007-03-27 Thread Mario Gonzalez
Hello, I'm trying to know the callback name after a resolve process from django.conf import settings from django.http import HttpResponse from django.core.urlresolvers import resolve class AuthorizedMiddleware(object): def process_request(self, request): return HttpResponse(str(

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 2:10 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > 'resolve' returns the actual callable function in all cases, so if you > want the string name of the function you might want to access its > '__name__' attribute. > > Are you using any decorators on these views? > no, I'm not

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 2:13 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > Also, keep in mind that writing a 'process_view' method instead will > give you access to the view function the URL resolved to, and will > execute *before* the view function is actually called. That might be I changed and I've

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 3:24 pm, "Mario Gonzalez" <[EMAIL PROTECTED]> wrote: > On Mar 27, 2:10 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > Are you using any decorators on these views? > > no, I'm not using any decorators. Now I found som

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 3:24 pm, "Mario Gonzalez" <[EMAIL PROTECTED]> wrote: > On Mar 27, 2:10 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > > > 'resolve' returns the actual callable function in all cases, so if you > > want the string name of the f

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 9:09 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > This is a known mini-problem and something we need to / will sort out > prior to 1.0. There are a *lot* of places in Django that wrap views up > and then expose them to the world. Once you get used to the idiom, it's > not a

Re: Get function name after....

2007-03-27 Thread Mario Gonzalez
On Mar 27, 10:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > > That's way I _need_ the function name :-( > > Understod. There are lots of similar cases where making sure you get the > real function name is useful. So, it's something that will be solved > soon-ish. You just can't have