Re: IntegrityError on newforms-admin

2008-05-09 Thread Nuno Mariz
Thanks Brian, One more question, there is another way to write a custom validator without override the field type? Nuno On May 9, 5:30 pm, Brian Rosner <[EMAIL PROTECTED]> wrote: > On May 9, 4:31 am, Nuno Mariz <[EMAIL PROTECTED]> wrote: > > > I'm using newforms-admin a

IntegrityError on newforms-admin

2008-05-09 Thread Nuno Mariz
I'm using newforms-admin and I've got a "duplicate key violates unique constraint" when I'm added new record(with the same value on field that already exists in the db) in admin interface. I've an "unique=True" in the field, shouldn't admin interface shows a error message in the form and not

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Malcolm, A patch that works for me is in: django/utils/translation/ real_trans.py in the function: "def get_language_from_request(request):": for lang, mainlang, order in langs: if lang in supported or mainlang in supported: # If the lang is not supported but mainlang is,

Re: Locate subset language problem

2007-04-03 Thread Nuno Mariz
Sure. On Apr 3, 2:37 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Could you file a ticket about this, please? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Locate subset language problem

2007-04-02 Thread Nuno Mariz
The problem is not when the user do /i18n/setlang/?language=pt-br, but is in the first visit on the site. The language is not selected(i.e. not in the user cookies) and the middleware tries the locale of the user browser and sets it even if the locale is not in the settings.py. Im testing with

Re: Locate subset language problem

2007-03-30 Thread Nuno Mariz
Hi Malcolm, Simple example: In my settings.py: gettext = lambda s: s LANGUAGES = ( ('pt', gettext('Portuguese')), ('en', gettext('English')), ) Imagine a client accessing to my site with a browser using 'pt-br', my applications falls in 'pt-br'(because of

Locate subset language problem

2007-03-30 Thread Nuno Mariz
da s: s LANGUAGES = ( ('pt', gettext('Portuguese')), ('en', gettext('English')), ) Any idea to resolve this, or I must do a middleware to fix this? Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goog

Re: How much is Django memory footprint?

2007-03-20 Thread Nuno Mariz
The processing is nothing in special, right now a weblog and a online store. I've removed some modules, like fcgi, include and suexec(I can't remember the instalation of this modules ;) ) and the size of the processes is now 22Mb. Do you have KeepAlive On? In my case did't solve the problem.

How much is Django memory footprint?

2007-03-19 Thread Nuno Mariz
Hi, Anyone can say how much memory an apache process wastes in a django app, in your servers? I can't understand why the 2 servers that I have, one dedicated and other in a slicehost, with the same distro and apps installed. Have diferent memory stats. In my slice I have something like: PID

Re: Portuguese (pt) request.LANGUAGE_CODE problem

2007-03-16 Thread Nuno Mariz
You can download now the unofficial Portuguese(pt_PT) translation of Django in http://mariz.org/downloads/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

newforms and encoding problems

2007-03-07 Thread Nuno Mariz
interface works fine(because uses the oldforms, I guess) In my settings.py I have: DEFAULT_CHARSET = 'utf-8' I'm doing something wrong? Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users&q

Locale detection problem

2007-02-12 Thread Nuno Mariz
t; tries "en-us". Any idea why this happens? Note: I have a locale named "pt" for portuguese, and "pt-br" is for portuguese-brazillian. Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: newforms validation

2007-01-19 Thread Nuno Mariz
). Greetings, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email

Re: How to enable profiling in internal development webserver

2007-01-16 Thread Nuno Mariz
Done: http://code.djangoproject.com/attachment/wiki/ProfilingDjango/runserver-profiler.diff For the queries: from django.db import connection connection.queries --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

How to enable profiling in internal development webserver

2007-01-16 Thread Nuno Mariz
How to enable profiling in internal development webserver? This http://code.djangoproject.com/wiki/ProfilingDjango doesn't help Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

How to enable profiling in internal development webserver

2007-01-16 Thread Nuno Mariz
How do I enable the profiling for internal development webserver? This http://code.djangoproject.com/wiki/ProfilingDjango doesn't help. Thanks, Nuno Mariz --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D

Re: Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
Jacob Kaplan-Moss wrote: > On 1/11/07 2:35 PM, Nuno Mariz wrote: >> Any idea to resolve this , this don't scale. If I what to add another >> language, I have to patch all of my templates. > > If I were you, I'd write a simple accessor on your model to get the current

Internationalization problem in template system

2007-01-11 Thread Nuno Mariz
I have a internationalization problem to solve in the template system. In my model: [...] text_pt = TextField() text_en = TextField() [...] In my template: {% load i18n %} {% get_current_language as LANGUAGE_CODE %} {% ifequal LANGUAGE_CODE 'en' %} {{ object.text_en }} {% else %} {{

Re: Custom tags installation

2006-06-20 Thread Nuno Mariz
Sorry, Too many hours working ;) Jay Parlar wrote: > > Scroll up on that page a bit, and read "Extending the template > system". The deployment process is described there. > > Jay P. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Accessing logged-in user object in models

2006-06-13 Thread Nuno Mariz
Ok, I agree. But if I want to save the ID of the user logged-in in a field in my table, I can't. Basically in almost of my tables I will have this fields: ip (IP Address) last_update (Record last update) user_id (User id that make the change) Don Arbow wrote: > On Jun 13, 2006, at 7:58 AM,

Re: Getting a foreign key from a recursion relation model

2006-06-12 Thread Nuno Mariz
It doesn't solve. The Task model have a lots of fields, can't go into models.TABULAR. Also I want to list in Task Admin the fields: ('name', 'client', 'project', 'user') I also have to list the open tasks associated to the logged user in the home link. Thanks, Nuno SmileyChris wrote: >

Getting a foreign key from a recursion relation model

2006-06-12 Thread Nuno Mariz
I need in the Task form a select imput with: "Client - Project" for selection. How do i change my Task model to show in Admin and to save the project_id? My models.py: class Client(models.Model): name = models.CharField(maxlength=255) [...] def __str__(self): return