Re: Using DATE_FORMAT in django 1.2

2010-06-06 Thread Tomas Zulberti


On Jun 5, 8:11 pm, Karen Tracey  wrote:
> On Sat, Jun 5, 2010 at 6:17 PM, Tomas Zulberti  wrote:
> > So my question is: is this a bug, or I am doing something wrong (I am
> > sure I might be doing something grong but I don't know where).
>
> I ran into the same behavior this afternoon. I think it is a 
> bug:http://code.djangoproject.com/ticket/13702
>
> Karen
> --http://tracey.org/kmt/

Thanks for all your help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Using DATE_FORMAT in django 1.2

2010-06-05 Thread Tomas Zulberti
Hi. I have the following values in the settings.py:
USE_L10N = True
DATETIME_FORMAT = '%d/%m/%Y'

When the date is printed it prints: "Nov. 24, 1983". The date is:
datetime.date(1983, 11, 24).
As far as I was able to follow the code, in the django/utils/
formats.py, the it uses the the get_format function because I have in
the settings USE_L10N. So it will use get_format will use
format_module of my sistem (english) to format the date.

The problem is that if I don't use USE_L10N to True, the function
localize() in the same module will return a datetime.date() object
insted of using the settings DATE_FORMAT value. After that the method,
force_unicode will be used, which it doesn't use the settings at all
(it does str(datetime.date())).

So my question is: is this a bug, or I am doing something wrong (I am
sure I might be doing something grong but I don't know where).

Thanks in advance,
Tomas Zulberti

pd: Sorry for my bad English.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: The beginner to develop website using DJANGO

2009-05-14 Thread Tomas Zulberti

On Thu, May 14, 2009 at 6:56 AM, veasna.bunhor  wrote:
>
>
>    Dear all value Django team,
>
>    I am a third-year student in IT field that focus on Computer
> programming in Cambodia. I have known a little about Python. Now, i am
> start to learn to develop website by using Python framework Django.
> Could you please tell very step by step what do i need to install
> before using Django and also a good tutorial for the beginner. If
> possible please five me the link to that source.
>
>    Thanks in advanced,
>
>    BUNHOR Veasna,
>

Have you checked the docs?[0]
There is shown how django is installed, and it also have a four step
tutorial which gives an overview of how django works


[0] http://docs.djangoproject.com/en/dev/

--~--~-~--~~~---~--~~
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 to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: JQuery Autocomplete in Django Not Working

2009-04-09 Thread Tomas Zulberti

On Thu, Apr 9, 2009 at 3:16 AM, Gath  wrote:
>
>
> Guys,
>
> I have the following code from some example i got from
> here: 
> http://lethain.com/entry/2007/dec/01/using-jquery-django-autocomplete-fields,
>
> but its not working on my django application.
>
> On my templete i have this function:
>
> $(function(){ setAutoComplete("tags", "tagResults", "/taglookup/?
> query=");taglookup/?query=test 404 NOT FOUND });
>
> and on my urls i have the following line
>
> (r'^taglookup/$', 'twine.twineapp.views.tag_lookup'),
>
> and my view looks like this:
>
> def tag_lookup(request):
># Default return list
>results = []
>if request.method == "GET":
>if request.GET.has_key(u'query'):
>value = request.GET[u'query']
># Ignore queries shorter than length 3
>if len(value) > 2:
>#model_results = Book.objects.filter
> (name__icontains=value)
>TaggedItem = Tag.objects.get_by_model(Question,
> Tag.objects.filter(name__in=[value]))
>results = [ x.name for x in TaggedItem]
>json = simplejson.dumps(results)
>return HttpResponse(json, mimetype='application/json')
>
> When i try to type anything on my "tags" field in the template,
> firebug gives me the following error;
>
> GET http://127.0.0.1:8000/taglookup/?query=test 404 NOT FOUND
> JQuery-1.3.2.js (line 3633)
>
> Any ideas where am goofing?
>
> Gath

The url for the view is r'^taglookup/$, meaning that the spacified url
should end with /$.In you case the complete url is:
taglookup/?query=test so, the regular expresion isn't corrert.

A quick fix should be to addd something like taglookup/.*

--~--~-~--~~~---~--~~
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 to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---