Re: select_related reverse?(!)

2014-05-05 Thread Andreas Bloch
thanks for your input fellas, solved my problem.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d6652df4-5702-4c7b-bb31-7df4921e7759%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


jquery in included html file

2014-05-05 Thread Andreas Bloch
How do you access (or include) jquery in a file, which is included?
I'm getting a "Uncaught ReferenceError: $ is not defined" when trying to 
use jquery in the included file...

In my template, that extends base.html, I am able to use jquery but not the 
file I'm including with {% include 'nav.html' %} in the template.

I could just put my 

i've screwed up my virtualenv

2014-05-05 Thread Malik Rumi



I have several problems. They are:

My Django project folder is 3 levels below my virtualenv.

Pip freeze:

a.on my virtualenv, in the parent folder or the Django project, only 
gives me the Django-trunk I got from github

b.but in the Django project folder, and without the virtualenv, it 
gives me all 8 packages I’ve been using on my project thus far.

c.Note this includes Django 1.6.1, not Django-trunk, which is the beta 
Django 1.7a2.

So clearly I’ve screwed up. The question is, how bad is it, and what do I 
do about it?

thx

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/7c1fc205-eefe-45fb-9538-bddb1aaf321a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: jquery in included html file

2014-05-05 Thread Shai Efrati
How did you use it in the nav.html file? Can you please write it here,
maybe it's a reference issue.

On Monday, May 5, 2014, Andreas Bloch  wrote:

> How do you access (or include) jquery in a file, which is included?
> I'm getting a "Uncaught ReferenceError: $ is not defined" when trying to
> use jquery in the included file...
>
> In my template, that extends base.html, I am able to use jquery but not
> the file I'm including with {% include 'nav.html' %} in the template.
>
> I could just put my 

Re: jquery in included html file

2014-05-05 Thread Hannu Krosing
On 05/05/2014 09:30 AM, Andreas Bloch wrote:
> How do you access (or include) jquery in a file, which is included?
> I'm getting a "Uncaught ReferenceError: $ is not defined" when trying
> to use jquery in the included file...
Is jquery there when you look at the page source ?
>
> In my template, that extends base.html, I am able to use jquery but
> not the file I'm including with {% include 'nav.html' %} in the template.
>
> I could just put my 

Django Database Data Type

2014-05-05 Thread Brendan Edwards
Hi,

I have just started learning Django (been flip flopping between meteor and 
django, cant decide which to use..) and I am fairly new to web development 
in general.

Basically, I have a query where I am using the code "teecolor = 
GolfCourseTees.objects.values('Tee_Color').filter(Course_Name=course)" but 
I want to take the value retrieved form this and use it to make another 
query before loading the template. When I set color1= teecolor[0] color 1 
will show as: {'Tee_Color': u'Blue'}, and I am unsure why this happens. I 
want to retrieve only the value "blue" in this case.

The reason for this is each course has usualy 4-5 tee colors. therefore I 
will have color1 = teecolor[0], color 2 = teecolor[1] etc.. so that I can 
insert that into a second query.

Questions:

1) What is the data output "{'Tee_Color': u'Blue'}" called and why does it 
display like this (I would like to understand and not just insert a given 
line of code)? I have read the documentation and I am still confused on 
this. 
2) How can I retrieve blue from {'Tee_Color': u'Blue'}? (example code would 
be helpful)

Brendan

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/a10e6d29-9fc9-483a-958f-f62385e7301b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: i've screwed up my virtualenv

2014-05-05 Thread Mike Dewhirst

On 5/05/2014 5:32 PM, Malik Rumi wrote:


I have several problems. They are:


Try ...

1. Create a new virtualenv for your project

2. pip install all the dependencies again (if you don't have a 
requirements file) including Django 1.6


3. Retrieve your project code from the repo or backup

4. Manually copy any changed source (from three levels down) over the 
restored source


5. Repeat from 1 above except for Django 1.7 in step 2

Don't forget to activate whichever virtualenv you want to work on.

Good luck

Mike




My Django project folder is 3 levels below my virtualenv.

Pip freeze:

a.on my virtualenv, in the parent folder or the Django project,
only gives me the Django-trunk I got from github

b.but in the Django project folder, and without the virtualenv,
it gives me all 8 packages I’ve been using on my project thus far.

c.Note this includes Django 1.6.1, not Django-trunk, which is
the beta Django 1.7a2.

So clearly I’ve screwed up. The question is, how bad is it, and
what do I do about it?

thx

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to django-users+unsubscr...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/7c1fc205-eefe-45fb-9538-bddb1aaf321a%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/536741C3.5020802%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: jquery in included html file

2014-05-05 Thread Andreas Bloch
here is how the files are structured...

*base.html*




...



{% block nav %}{% endblock %}
{% block content %}{% endblock %}





*template.html*

{% extends "base.html" %}

{% block nav %}
{% include 'nav.html' %}
{% endblock %}

*// works*

$(function(){
$('#nav a').on('click', function() {
var href = $(this).attr('href');
alert(href);
});
});

*nav.html*


*// jquery in included html not working*