Re: storing django object into javascript variable/array

2011-06-15 Thread John Finlay

On 6/15/11 8:59 AM, jay K. wrote:

Hello,

I apologize for seeming too impatient or rude, actually I'm a bit in a 
hurry because I was given a project
and was told that it was urgent. I miscalculated how much time it was 
going to take me to learn django


Anyway, what I want to do is to use the variables variables 
city_schools, city_latitudes and city_longitudes

as javascript arrays in a separate js file

For instance, like this

//INSIDE JAVASCRIPT FILE



for(var i = 0; i < city_schools; i++){


shouldn't this be:

for(var i = 0; i < city_schools.length; i++){



var lat = city_latitude[i];
var long = city_longitude[i];

googlemap.addmarker(lat, long);

..
}


//END

The whole point here is to add markers to an existing google map. 
Somehow the variables store the data from django into the js arrays, but
I am unable to access them they way I want, so I was wondering if I 
need to do anything extra before manipulating the js arrays.


Any suggestions would be welcomed

Thanks, and again sorry for seeming rude/desperate, it was all my fault




On Wed, Jun 15, 2011 at 10:45 AM, Ian Clelland > wrote:


On Wed, Jun 15, 2011 at 7:27 AM, jay K.
>
wrote:

Hello,

I've posted my question before, but I believe I didn't provide
enough
detail. I intend to present my issue again, this time with more
detail.

Let me tell you that I am not a django developer, so I have very
limited exposure to django. I just know html, css, javascript,
jquery,
php (also java and c++, so I'm familiar with object-oriented
programming).


...


Now, I manage to see the output of the javascript written above
through Firefox's "View - Page Source" and it comes up like this

//BEGINNING
var city_schools = ["EC","St. Giles Central","St. Giles
Highgate"];

var city_latitudes = ["58","88","25"];

var city_longtitudes = ["7","99","100"];

//END


I have a separate javascript file where I add the code for the
google
map. What I want to do is to be able to access each of the
city_schools, city_latitudes, and city_longitudes and use its
data to
I can mark the schools inside a google map. It would be ideal if I
could retrieve the info as if it was a js array, but any
method that
works is more than welcome


What you have is very clearly a JavaScript array, as you asked for
the first time you posed this question. In fact, by copying the
code, you have produced three JavaScript arrays.

What you haven't done, in this newest version of your question, is
show exactly what it is you want. We now have a rough idea of what
your models look like, but no idea at all why the JavaScript
output you have pasted is insufficient.

You say that you know JavaScript, so what you're going to have to
do is come up with a sample of what you'd *like* to see as the
template output, and hopefully we can help you with the Django
template code to produce that output.

[Also, it really doesn't help to be posting and reposting the same
question, just hours apart -- it just looks very impatient]

-- 
Regards,

Ian Clelland
>
-- 
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.


--
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.


--
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.



Writing a DB backend

2011-02-14 Thread John Finlay
I am working on a app that keeps information in a non-SQL database 
composed of XML files referenced as UUIDs. In the prototype I'm directly 
referencing these using a simple api. For the production version I'm 
wondering if it would be possible to build a db backend that would allow 
me to use the django models and model forms.


Does this seem like a reasonable thing to try? Are there examples of 
backends that do something similar? Or is this just to difficult to add 
in for the hoped for gain in using django models?


Thanks

John

--
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: Odd problem with static files and Lighttpd

2011-01-17 Thread John Finlay

What do the lighttpd logs say?


On 1/17/11 2:41 AM, sdonk wrote:

Hi to everybody,
I'm facing with a curious problem with Lighttpd and static files
serving.
Media admin is served by Lighttpd, but mymedia is not served by
Lighttpd.

This is a snippet of my lighttpd.conf

alias.url = (
 "/mymedia/" =>  "/home/osmtools/mymedia/",
 "/media/" =>  "/usr/lib/python2.5/site-packages/django/contrib/
admin/media/",
)

url.rewrite-once = (
 "^(/media.*)$" =>  "/$1",
"^(/mymedia.*)$" =>  "/$1",
 "^/favicon\.ico$" =>  "/media/favicon.ico",
 "^(/.*)$" =>  "/osmtools.fcgi$1",
)

The result is that in the admin site css and js work well (http://
osmtool.com/admin) but in the user site neither the css and the js are
loaded (http://osmtool.com).

Any idea?

Thanks

Alex



--
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.



Problem with django auth login_required and lighttpd

2011-01-11 Thread John Finlay
I'm trying to serve django pages using mod_fastcgi from a lighttpd 
server. Everything works well using the setup recommended in the 
documentation except for the initial login. The porblem seems to be that 
when the user tries:


http://server/

the login page comes up with a url of:

http://server/accounts/login/?next=/mysite.fcgi/

After the user login lighttpd returns a 404 looking for 
http://server/mysite.fcgi/mysite.fcgi


How do I fix this? A change in urls.py or a change in lighttpd.conf?

Thanks

john

--
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: GUI builder for django

2010-04-21 Thread John Finlay
Does everyone code the html and css by hand for their templates? That 
seems very time consuming and tedious.


Desktop apps have the same issues with variations of languages, fonts, 
etc. and resizing and the layout containers and other widgets provide 
for dynamic changes. GUI builders make it easy to create the views from 
the basic widgets without having to program a lot of low level code. Are 
you saying there isn't an equivalent type of development tool in the web 
design space?


Thanks

John

On 04/21/2010 03:10 PM, andres osinski wrote:
No, and it's not a good idea to do WYSIWYG development for HTML. HTML 
is not a format that produces static content; it varies depending on 
screen fonts, browser, and platform, and getting that right means 
sticking to relative layout, making content flow, and taking care of 
quirks. WYSIWYG editors don't do any of that. and the quality of their 
output is dubious at best.
Taking the time to produce sane HTML and CSS is a must for web 
development, but it's not that difficult a task and the knowledge to 
do it can be learned in a few days.


Thanks

On Wed, Apr 21, 2010 at 6:28 PM, John Finlay <fin...@moeraki.com 
<mailto:fin...@moeraki.com>> wrote:


I'm just getting started with django coming from a background of
developing desktop apps on *nix. Is there something equivalent to
a GUI builder for django?

Alternatively, is there a good WYSIWYG html editor that produces
editable html so I could quickly create a template and then
retrofit it with django template tags?

Thanks

John



--
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.



GUI builder for django

2010-04-21 Thread John Finlay
I'm just getting started with django coming from a background of 
developing desktop apps on *nix. Is there something equivalent to a GUI 
builder for django?


Alternatively, is there a good WYSIWYG html editor that produces 
editable html so I could quickly create a template and then retrofit it 
with django template tags?


Thanks

John

--
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.