Re: Template Filters

2009-08-22 Thread WilsonOfCanada
For reference: http://google-ctemplate.googlecode.com/svn/trunk/doc/auto_escape.html --~--~-~--~~~---~--~~ 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

Template Filters

2009-08-19 Thread WilsonOfCanada
Hellos, I was wondering if there is a filter that can remove these '\' that python added when strings are appended to a list or dictionary. I cannot use cut because I still need one of the '\' ex. C:\\moo Code: arrPlaces = [] intPoint =0 while (len(testline)): testline = fileName.re

Re: Raw Strings with Variables

2009-08-18 Thread WilsonOfCanada
However, when I send the list over as a dictionary for HTML: d["places"] = arrPlaces return render_to_response('rentSearch.html', d) the HTML using Django has: {{ places }} but returns ['C:\\moo', 'C:\\supermoo'] --~--~-~--~~~---~--~~ You received this message

Re: Javascript with built-in templates tags

2009-08-11 Thread WilsonOfCanada
I want to access the string from the list that is in the dictionary: function changeArea() { alert({{list_areas.British_Columbia}}); } I get what I want in the generated HTML: function changeArea() { alert(['Metro Vancouver', 'Metro Vancouver A', 'Sunshine Coast']); } Howev

Re: Javascript with built-in templates tags

2009-08-08 Thread WilsonOfCanada
I tried that before, but it only seems to work when it is used on the .html file. onchange="changeArea('{{ list_areas.BC|safe|escapejs}}') I need it to be onchange="changeArea('{{ list_areas|safe|escapejs}}') so the function can use list_areas (My javascript and html are on separate files). On

Re: Javascript with built-in templates tags

2009-08-08 Thread WilsonOfCanada
I sent the variable as dictionary with lists {'BC:['Vancouver', 'Kamloops'], AB:['Calgary']} However, when I use the variable in the function, it is treated as a string. function changeArea(mooman) { alert(selectedAreas["BC"]); } This was not defined. Is there something more I need to

Re: Javascript with built-in templates tags

2009-08-08 Thread WilsonOfCanada
Thanks, It worked, but out of curiosity, what do the additional quotes change (why are they needed)? --~--~-~--~~~---~--~~ 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

Re: Javascript with built-in templates tags

2009-08-08 Thread WilsonOfCanada
No, I placed the spaces in so it is more readable (I tested with spaces afterwards and they still do not work). The function is passed in by:

Re: Javascript with built-in templates tags

2009-08-08 Thread WilsonOfCanada
I am not sure; I am just trying to pass the variable from the dictionary using render_to_response to a javascript function. The function is stored as a .js file. This is a part of the code I am using it for: {{ selectCity|safe }} The {{ selectCity|safe }} works but the {{ mooman | safe | es

Javascript with built-in templates tags

2009-08-07 Thread WilsonOfCanada
Hellos, I was wondering how to use {{ }} variables in javascript functions. ex. onchange = "changeArea({{ mooman |safe|escapejs}});" Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To p

Re: Using Django's Cache

2009-07-20 Thread WilsonOfCanada
Well then I will have to try a different approach. When using render_to_response('webpage.html', d), I have d as a dictionary. I was wondering if you send a whole text file as a part of the dictionary. For example: fileView = open('C://path//main_cities.txt', 'r+') d['main_cities'] = fileView

Using Django's Cache

2009-07-19 Thread WilsonOfCanada
Hellos, I was wondering if I can use Django caching system to store .txt or .img files on the client side (as temp file). I want to use javascript to use them later so it would not require to transfer files from the server again. The txt files are just list so there is nothing about security, b

Re: Apache with Django

2009-07-07 Thread WilsonOfCanada
Never mind... I figured it out. Because the location is at "/", I would not need the "PythonOption django.root / " part. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Re: Apache with Django

2009-07-07 Thread WilsonOfCanada
I think I found my problem. I thought that the httpd.exe is the application running in the Vista's control panel, but it was just the "ApacheMonitor.exe" not "httpd.exe". However, while my project worked in development, it is giving me TypeError. --~--~-~--~~~---~--~-

Re: Apache with Django

2009-07-06 Thread WilsonOfCanada
I am using Apache and mod_python with the some of the changes suggested in http://docs.djangoproject.com/en/dev/howto/deployment/modpython/ as shown in the fourth posting. I can start Apache Service Control and the Test Configuration does not show any errors; however when my ip address or my doma

Re: Apache with Django

2009-07-06 Thread WilsonOfCanada
@ Kenneth: If I do not use runserver, what command should I use to run the python scripts for production servers? @ BoĊĦtjan: I am not sure if I even setup a connection between them. In httpd.conf, I only added: ServerName www.domainname.ca SetHandler python-program PythonHandl

Apache with Django

2009-07-05 Thread WilsonOfCanada
Hellos, When running a production server, I was wondering if I still use "python manage.py runserver [ip]:[port]" because the cmd says it is running a development server. Also, do I use the my LAN IP or Internet IP with which port (is it the same one Apache listens to)? Thanks --~--~-~