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

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

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, i

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

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, t

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=co

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

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* $(fun

Re: Django Database Data Type

2014-05-05 Thread Mike Dewhirst
On 5/05/2014 5:39 PM, Brendan Edwards wrote: 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.objec

Re: Django Database Data Type

2014-05-05 Thread Brendan Edwards
Thanks a lot for the reply! It got me thinking and I changed the code around a bit and was able to get the result I was looking for. What I did in the end was: teecolor = GolfCourseTees.objects.filter(Course_Name='course').values() tee1 = teecolor[0] and in the HTML i used {{ tee1.hole1_distanc

Re: What is different of handling character code between pure Python and Django?

2014-05-05 Thread Sugita Shinsuke
Dear François Schiettecatte Hello. Thank you for replying. I checked sys.getdefaultencoding() in Django and pure Python of the server. Django returns 'ascii'. And, Python returns 'ascii' too. I also checked your link, http://stackoverflow.com/questions/1473577/writing-unicode-strings-via-sy

Re: i've screwed up my virtualenv

2014-05-05 Thread Malik Rumi
THANKS! Yea, it's that 'activate' part that I kept forgetting that got me into this mess. Maybe I should paste it to my forehead? (-: On Mon, May 5, 2014 at 2:46 AM, Mike Dewhirst wrote: > On 5/05/2014 5:32 PM, Malik Rumi wrote: > >> >> I have several problems. They are: >> > > Try ... > >

Re: i've screwed up my virtualenv

2014-05-05 Thread yati sagade
Or probably just use the excellent virtualenv-wrapper :) You can then do things like: mkvirtualenv foo # to create a venv workon foo # switch to venv foo On May 5, 2014 6:26 PM, "Malik Rumi" wrote: > THANKS! > Yea, it's that 'activate' part that I kept forgetting that got me into > thi

Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Vibhu Rishi
Hi I have Users and based on some requirements, I have created a few User Groups . e.g. I have a group of moderators. Now, I am trying to create a form where a normal user can message the moderators. So, I have a model to be used by the form something like : class Message(models.Model): mo

Stuck on Tutorial-- can't import Question

2014-05-05 Thread Alon Nisser
Try to import Question from the shell. python manage.py shell >>from polls.models import Question I guess you have a typo in the model that raises the import error. If it does import in shell then you have some other issue -- You received this message because you are subscribed to the Google G

Re: Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Helton Alves
Hi brother, so, I don't know if understand very well. but I think that this is answer for your problems. https://docs.djangoproject.com/en/dev/ref/contrib/admin/ vlw. 2014-05-05 14:52 GMT+01:00 Vibhu Rishi : > Hi > > I have Users and based on some requirements, I have created a few User > Gro

Re: Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Carlos Futino
Hi, you could change the QuerySet of the ModelChoiceField. I'd do it in the forms __init__ method. Like this: class MessageForm(forms.ModelForm): def __init__(self,*args,**kwargs): super(MessageForm,self). __init__(*args,**kwargs) self.moderator.queryset = User.objects.filter(...*Place your q

Re: Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Simon Charette
You could use the `ForeignKey.limit_choices_to` option : class Message(models.Model): moderator = models.ForeignKey(User, limit_choices_to={'groups__name': 'Moderator'}) user= models.

Static files in templates with VARIABLES

2014-05-05 Thread Damián Pérez
Hello everyone: I'm using for the templates {% static 'images/logo.png' %}, but what can i do if I have the logo url on the variable ?, something like static LOGO thanks. best regards, -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsub

Re: Static files in templates with VARIABLES

2014-05-05 Thread Charly Román
{% static LOGO %} 2014-05-05 10:27 GMT-05:00 Damián Pérez : > Hello everyone: > > I'm using for the templates {% static 'images/logo.png' %}, but what can i > do if I have the logo url on the variable ?, something like static LOGO > > thanks. > > best regards, > > -- > You received this message b

django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
Hi all, am new to django and followed a tiny tutorial to start off - I wanted to add the ability to use Markdown syntax in the blog posts. It was suggested to use django.contrib.markup, but that wont work anymore ( i guess it's been removed ) - what do I need to use Markdown in my posts ? Tha

Installing Database for creation of database driven Web-application using Django

2014-05-05 Thread Neeta Jawale
Hi, I am new to Django framework. I have just started learning Django framework and I am new to web development . Can anyone guide me from scratch how to install database for that, so I can create database tables & execute queries on it? I have installed Django framework & its verision is 1.4.

Re: Installing Database for creation of database driven Web-application using Django

2014-05-05 Thread Jorge Andrés Vergara Ebratt
Look in the Django documentation, it has great examples for doing that. I suggest you also follow the polls app tutorial. On May 5, 2014 11:14 AM, "Neeta Jawale" wrote: > Hi, > I am new to Django framework. I have just started learning Django > framework and I am new to web development . > Can an

Re: regression? validate_email accepts trailing dash

2014-05-05 Thread Jason Brackins
For future reference, I went ahead and filed https://code.djangoproject.com/ticket/22579 On Wednesday, April 30, 2014 2:27:21 PM UTC-7, Jason Brackins wrote: > > Hi everybody, > > I've found this behavior that feels like a bug. I would like your opinion > on whether it *is* a bug. > > In django

Re: Django Query Data

2014-05-05 Thread C. Kirby
The reason you are getting a dictionary in return is because the call to values() returns a ValueQuerySet, which is an iterable of dictionaries ( https://docs.djangoproject.com/en/dev/ref/models/querysets/#values) In order to get a list of tee colors (eg ['Blue',Green','Red']) you should use a va

Overriding Default Field Names

2014-05-05 Thread rgreene
Good day, Using a ManyToManyField as in the example below causes django to automatically instantiate a Model called country_region with fields country_id and region_id, which is very cool. But what if the region_country database table (for reasons beyond the scope of this thread) has field nam

Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
fwiw - this is the tutorial I was trying : http://www.creativebloq.com/netmag/get-started-django-7132932 it mentions django.contrib.markup ... but that doesnt seem to work :\ On Monday, 5 May 2014 16:44:47 UTC+1, Alex Leonhardt wrote: > > Hi all, > > am new to django and followed a tiny tutori

Editing existing data using Form Wizard

2014-05-05 Thread rgreene
Good day, The thread at http://stackoverflow.com/questions/13822975/django-form-wizard-to-edit-model shows an approach for using the form wizard to edit data. Is this approach still recommended? If so, I'm wondering how to initialize the data for a step based on a formset? Passing a single m

Re: Installing Database for creation of database driven Web-application using Django

2014-05-05 Thread Gelli Ravikumar
Hi Neeta, Here is the very basic youtube tutorial for django creation, installation and database: Django Basics - Part 1 of 4 - Installing and Setting up Django. I hope this will clears your problem, if not yet revert back your issues. On Monday,

Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Brad Pitcher
django.contrib.markup has been deprecated. You could try using the standalone project that is a copy of the same code from django: pip install django_markup_deprecated Then add "markup_deprecated" to your INSTALLED_APPS instead of django.contrib.markup. - Brad Pitcher On Mon, May 5, 20

Re: django 1.6.4 - markup / markdown (for django blog tutorial)

2014-05-05 Thread Alex Leonhardt
Thanks Brad - i had a look and didnt get it to work, but thanks to your hint I did get this to work : https://django-markup.readthedocs.org/en/latest/ with https://django-markup.readthedocs.org/en/latest/usage_templates.html Cheers! Alex On Monday, 5 May 2014 21:22:21 UTC+1, Brad Pitcher wro

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-05 Thread Guillem Liarte
Hello Brad, Thanks for the suggestion, I was suspecting something like that. I will let you know how it goes. Where do you find this? I Could not find anything like that in the wsgi documentation. Thank you, Guillem On Friday, 2 May 2014 16:37:35 UTC+2, Brad Pitcher wrote: > > What does your

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-05 Thread Brad Pitcher
It's just something that was passed down to me from a senior programmer :-) - Brad Pitcher On Mon, May 5, 2014 at 2:45 PM, Guillem Liarte < guillem.lia...@googlemail.com> wrote: > Hello Brad, > > Thanks for the suggestion, I was suspecting something like that. I will > let you know how

Re: Centos 6.5 Python 3.3.x Django 1.6 Apache 2.2

2014-05-05 Thread Guillem Liarte
Hello Tom, Yes, I tried to compile wsgi with python 3.3, but I got error after error. Instead I came back to the original quest of finding a compiled version that works of, as it has also been indicated, to le apache know that that I wish to use a different python. Any specific tips when compi

Re: Django 1.7 not working with mysql-connector-python 1.1.6 & Python 3.3 ?

2014-05-05 Thread Richard Esplin
I am also trying to use Django 1.7 with the Mysql-Python-Connector 1.1.6. I am seeing the same behavior for both the migrate NotImplementedError and the syncdb RemovedInDjango19Warrning. Were you able to solve these problems? Richard On Thursday, April 3, 2014 9:09:31 AM UTC-6, Giovanni wrote:

Re: Django 1.7 not working with mysql-connector-python 1.1.6 & Python 3.3 ?

2014-05-05 Thread Richard Esplin
I can't find any evidence on the interwebs of someone successfully using the Mysql-Connector-Python with Django 1.7. So I reported it as an issue in the MySQL bug database: http://bugs.mysql.com/bug.php?id=72542 If anyone has a suggestion for using MySQL with Python 3 and Django 1.7, I would a

Re: Static files in templates with VARIABLES

2014-05-05 Thread Damián Adriel Pérez Valdés
thanks On Mon, May 5, 2014 at 10:29 AM, Charly Román wrote: > {% static LOGO %} > > 2014-05-05 10:27 GMT-05:00 Damián Pérez : > > Hello everyone: > > > > I'm using for the templates {% static 'images/logo.png' %}, but what can > i > > do if I have the logo url on the variable ?, something like

Re: Django 1.7 not working with mysql-connector-python 1.1.6 & Python 3.3 ?

2014-05-05 Thread Richard Esplin
This is actually a warning, and only halts execution when settings.py has DEBUG enabled. See mysql/connector/django/base.py line 59. However when syncdb proceeds past the deprecation warning, it halts on the error about needing schema_editor implemented. On Thursday, April 3, 2014 9:09:31 AM UT

Re: Creating an object using Foreign Key for Users but filtered by group

2014-05-05 Thread Vibhu Rishi
Hi Simon, this is exactly what I was looking for ! It works perfectly. I had gone through the documentation for limit_choices_to but I was not able to figure out how to do the groups part. Vibhu On Mon, May 5, 2014 at 8:51 PM, Simon Charette wrote: > You could use the `ForeignKey.limit_choic

Re: What is different of handling character code between pure Python and Django?

2014-05-05 Thread Sugita Shinsuke
Dear François I checked Django's encoding again. locale.getpreferredencoding() is ANSI_X3.4-1968 sys.getdefaultencoding() is ascii 2014年5月5日月曜日 20時12分52秒 UTC+9 Sugita Shinsuke: > > Dear François Schiettecatte > > Hello. > Thank you for replying. > > I checked sys.getdefaultencoding() in Djang