Re: How to translate Lookup values in Django?

2012-10-03 Thread houmie
Thanks guys. I came across myself across django-modeltranslation and I must it works very well. On 03/10/12 16:34, Jair Trejo wrote: I use django-datatrans for catalog translation, i'ts not perfect but good enough for me. El martes, 2 de octubre de 2012 20:09:46 UTC-5, Houmie escribió

How to translate Lookup values in Django?

2012-10-02 Thread Houmie
Django has an excellent support for internationalization, any English expression within Models, Forms, View or template can easily be marked for translation. However I came across an interesting situation I don't know how to deal with. I have a Gender lookup (Male, Female). Now even if I

Ordering the forms within a formset? (How to override __iter__())

2012-09-24 Thread Houmie
deals_formset_factory = modelformset_factory(Deal, form=DealCForm, extra=1, can_delete=True, max_num=5) deals_formset = deals_formset_factory(queryset=query) Is there a way to say the one extra form shall always be the first form no matter how many more instance forms are within the

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
to extend the factory at all. Many Thanks, Houman On 17/08/12 14:24, Melvyn Sopacua wrote: On 17-8-2012 15:00, houmie wrote: Yes, I know about overriding a widget. I could override a Charfield with a TextArea. For simple stuff it makes sense. Against which widget do I override the existing M2M

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
Thanks Melvyn, Yes, I know about overriding a widget. I could override a Charfield with a TextArea. For simple stuff it makes sense. Against which widget do I override the existing M2M widget though? On 17/08/12 01:01, Melvyn Sopacua wrote: On 17-8-2012 1:05, Houman wrote: What I am

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-17 Thread houmie
Thanks Thomas. Just trying to apply the DropDownMultiple Widget that you have suggested. I have followed the instruction: |class MyForm(forms.ModelForm): categories = forms.Field(widget=DropDownMultiple) def __init__(self, *args, **kwargs):

Re: How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread houmie
Hi Xavier, This wasn't the whole story. I actually have a DealType class: |class DealType(models.Model): deal_name= models.CharField(max_length=40) sales_item= models.ManyToManyField(SalesItem) price= models.DecimalField(decimal_places=2) | DealType class has a

How to create a formset that contains forms with a dropdown? (Crucial)

2012-08-16 Thread Houmie
The question might seem too simplistic, but it seems formsets can only work with forms that have simple type fields such as charfield. But has anyone tried to use a form with a dropdown and use that form to instantiate a formset? Let me give you an example why this fails: *Model:* class

(demo included) Switching Languages still relies on LANGUAGE_CODE for forms

2012-08-14 Thread Houmie
Hello, I have created a small demo to show the problem. Please open the demo here: http://sandbox.chasebot.com/ When you click on British English, you can see how both the date- and Time format change. Now if you click on Add, you will see how both date and time are pre-populated for you.

Re: Django: How to get American date format in a form?

2012-08-14 Thread houmie
:40, houmie wrote: Its just a bit odd that templates show 11:15 p.m. Slight difference in the formatting. Also the dates within templates are defined like Aug 13, 2012. Doesn't confirm with my definition in formats.py. Are they stored somewhere else? No, but you need the localize filter or tag

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
to change TIME_FORMAT = 'P' to TIME_FORMAT = '%p', but it breaks. On 13/08/12 21:52, Melvyn Sopacua wrote: On 13-8-2012 22:41, Melvyn Sopacua wrote: On 13-8-2012 17:40, houmie wrote: Its just a bit odd that templates show 11:15 p.m. Slight difference in the formatting. Also the dates within

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
. Are they stored somewhere else? On 13/08/12 15:30, Melvyn Sopacua wrote: On 13-8-2012 16:16, houmie wrote: But looking at this example, 'en/' is not good enough. British English is also `en` but the date format is European. You know what I mean? Again the culture seems to be forgotten :( Unless I could

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Thanks Melvyn for the example. Interesting you get the same problem with American date output as I. So its on purpose to pick the first available input-format from formats.py. Which is very odd if you ask me. I was expecting this to be culture specific too. Ok, let see how we can fix this.

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
. 31, 2012). Cheers On Monday, 13 August 2012 14:47:57 UTC+2, Houmie wrote: Thanks Melvyn, I have tried this: def contact_date_callback(self, field, **kwargs) : return field.contact_date(localize=True, **kwargs) But the date still shows as 2012-08-13 note

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
Thanks Melvyn, I have tried this: def contact_date_callback(self, field, **kwargs) : return field.contact_date(localize=True, **kwargs) But the date still shows as 2012-08-13 note, that Aptana Studio 3.0 complained that I put `self` first. Nonetheless neither version works. Any

Re: Django: How to get American date format in a form?

2012-08-13 Thread houmie
ld use the field format, but isn't that hardcoded and bad practice? How do you guys in US do that? Thanks, On 13/08/12 10:48, Houmie wrote: Hello everyone, For some reason the American date format is not accepted in my form. I wonder if any Django developer from US could help me with t

Django: How to get American date format in a form?

2012-08-13 Thread Houmie
Hello everyone, For some reason the American date format is not accepted in my form. I wonder if any Django developer from US could help me with this. I suspect the timezone in the settings also affect the date format, but I am not sure. *Settings:* TIME_ZONE = 'Europe/London'

Django Date formats - Please help

2012-07-11 Thread Houmie
Hi everyone, class CallsForm(ModelForm): class Meta: model = Conversation widgets = { 'contact_date': forms.DateInput(), } With a date input like this, my form shows the date like '2012-07-11', which seems international to me. I live in

Re: If using South, does it even matter what the underlying database is?

2012-07-07 Thread houmie
Oh one more thing: I have created a new superuser for postgre called django_user Now when I try to connect to it it says: FATAL: Peer authentication failed for user "django_user" But the password is correct, I had no choice than change the settings in /etc/postgresql/9.1/main/pg_hba.conf

Re: If using South, does it even matter what the underlying database is?

2012-07-06 Thread houmie
Thanks everybody for the encouragement. Just to let you know you convinced me not giving up on postgresql. It is actually quite nice that rules are tighter, to see right away what might be wrong (e.g. field length etc) Starting up with postgresql is much harder than MySQL, but then it

If using South, does it even matter what the underlying database is?

2012-07-06 Thread Houmie
Today I have started my first steps into postgresql, since its recommended by the Django team. I came across several issues, that I solved patiently one by one. 1) Creating tables under postgresql requires to login as a different OS login, from which you don't even know the password. Fine, I

Re: Internationalization in Django 1.4 doesn't seem to work

2012-06-02 Thread Houmie
> > Hi Kenneth, The good news is the problem is solved. A friendly chap in stackoverflow actually bothered to look into it. The problem is as simple as the translation files couldn't be found. For some odd reason the important information about how Django locates them is at the very last

Re: Internationalization in Django 1.4 doesn't seem to work

2012-06-01 Thread Houmie
Guys, I have created a new simple test project to demonstrate the problem. It is a very simple project and you can switch between German & English at main page. You see the selected Language code actually changes, which is a good sign but the translation simply doesn't happen. I wonder if

Re: Internationalization in Django 1.4 doesn't seem to work

2012-06-01 Thread Houmie
9 pm, Iván Raskovsky <raskov...@gmail.com> wrote: > Besides changing the language per request as you've been indicated in > SO you might want to look at lazy > translations:https://docs.djangoproject.com/en/dev/topics/i18n/translation/#lazy-t... > > Regards, >     Iván > >

Internationalization in Django 1.4 doesn't seem to work

2012-06-01 Thread Houmie
Hey everyone, I would really appreciate it if somebody could help me with this. Working on this since this morning and am totally stuck.. I have posted it with proper formatting on stack overflow. http://stackoverflow.com/questions/10854330/internationalization-in-django-doesnt-get-activated

OpenSource IDE with debugger capabilities of PyCharm

2012-05-31 Thread Houmie
Hi, I have a question to the seasoned Django developers, I am relatively new to Django and have been developing on Aptana Studio 3.0 since one month. While I think its a great free product, it seems debugging is only limited to url.py and views.py. Beyond that there is no way to set a break

New to Jdango - What IDE to use?

2012-04-21 Thread Houmie
Hi everyone, I was wondering which IDE you guys are recommending to use? Important is ease of use and productivity. Price comes third if its not free. I tried already Aptana 3.0, but I get a weird error message upon creating Django projects:

Hardware requirements for Djando development (Linux vs Mac)

2012-04-20 Thread Houmie
Hi, This might sound like a strange question. I am switching from MVC .NET to Django/Linux environment. It makes most sense to go completely linux (Ubuntu). But there is also the option of leaving PC completely behind and start using a Mac for development. As I am not familiar with Mac, is it