How to build this query

2012-11-09 Thread ozgur yilmaz
Hi all, I hope i can explain my query problem well. Think you have 3 classes: class City( models.Model ): ... ... class Brand( models.Model ): ... ... class Shop( models.Model ): brand = models.ForeignKey( Brand ) city = models.ForeignKey( City ) ... ... class Discount( models.Model ):

Re: How to build this query

2012-11-09 Thread Jirka Vejrazka
paris_discounts = Discount.objects.filter(brand__city__name='Paris') ? Note that these are always *double* underscores and I had to make a guess that your City has an attribute "name". HTH Jirka On Fri, Nov 9, 2012 at 9:12 AM, ozgur yilmaz wrote: > Hi all, > > I hope i can explain

Re: How to build this query

2012-11-09 Thread ozgur yilmaz
But Brand doesnt have a city field. Shop class has a city field. 2012/11/9 Jirka Vejrazka : > paris_discounts = Discount.objects.filter(brand__city__name='Paris') ? > > Note that these are always *double* underscores and I had to make a guess > that your City has an attribute "name". > > HTH

Re: How to build this query

2012-11-09 Thread ozgur yilmaz
Maybe: paris_discounts = Discount.objects.filter( brand__shop__city__name = 'Paris' ).distinct('id') What do you think? 2012/11/9 ozgur yilmaz : > But Brand doesnt have a city field. Shop class has a city field. > > 2012/11/9 Jirka Vejrazka : >> paris_discounts = Discount.objects.filter(brand__ci

more problems than one

2012-11-09 Thread Nebros
Good morning i have to many proplems by programing, thats maybe because i am new and my englisch is not the best... (google translator is often a bad tool...) i tryed to make a page where you can put in a name "kunde" (used as a filter) for the next page... -Portal1- {% include "header.

Re: more problems than one

2012-11-09 Thread Nebros
hmm? there is more than just one page... what do you mean tochange, and what does it make? Am Freitag, 9. November 2012 11:06:03 UTC+1 schrieb Sergiy Khohlov: > add the / at the end of your page > > 2012/11/9 Nebros > > >> Good morning >> i have to many proplems by programing, thats maybe be

Re: more problems than one

2012-11-09 Thread Nebros
And there are mor problems in the code... i marked it with: #and the problem i have there... -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/zCCvQ1J8NaUJ.

Re: more problems than one

2012-11-09 Thread Sergiy Khohlov
Take a look at your urls.py from django.conf.urls import patterns, include, url from klasse.views import portal, kundendaten urlpatterns = patterns('', (r'^portal1/$', portal1), (r'^kundendaten1/$', kundendaten1) ) this means next : next urls are served : portal1/ and kundendaten1/

login using an external database

2012-11-09 Thread Lucas Nunes ''Ruivinhoshow''
hi, i'm brazilian (sorry for dude engl.. xD ). I want to login an user using the tables that exists in other db... i'll need the tables named 'matricula' and 'password', and so i log on this user in my app... can som1 help me ? -- You received this message because you are subscribed to th

Re: login using an external database

2012-11-09 Thread Satinderpal Singh
On Fri, Nov 9, 2012 at 6:02 PM, Lucas Nunes ''Ruivinhoshow'' wrote: > hi, i'm brazilian (sorry for dude engl.. xD ). I want to login an user using > the tables that exists in other db... What do you mean by other db, > i'll need the tables named 'matricula' and 'password', and so i log on > this

Re: more problems than one

2012-11-09 Thread Nebros
ok, that was not really useful for me... :( -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/k8IF1Joy_GcJ. To post to this group, send email to django-users

Re: login using an external database

2012-11-09 Thread Lucas Nunes ''Ruivinhoshow''
i mean db = database > uhmm... but the second app isn't in django. it was built in php I > think... or it doesn't matter? > the important is: I have access to a database that is part of another application and want to use the login fields from there to log into my system .. a database fo

Re: Consume Web Service

2012-11-09 Thread Derrick Jackson
Thanks Tim. After mulling it over I decided to go with SUDS and so far all is working like a charm. On Thursday, November 8, 2012 4:52:11 PM UTC-5, Tim Sawyer wrote: > > I keep it simple and just create the XML manually. Works for me on > simple services. > > > http://drumcoder.co.uk/blog/2009

Re: login using an external database

2012-11-09 Thread Satinderpal Singh
On Fri, Nov 9, 2012 at 7:21 PM, Lucas Nunes ''Ruivinhoshow'' wrote: > i mean db = database > >> >> uhmm... but the second app isn't in django. it was built in php I >> think... or it doesn't matter? > > > the important is: I have access to a database that is part of another > application and wa

Re: Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"

2012-11-09 Thread Daniel Roseman
On Friday, 9 November 2012 11:33:53 UTC, muhammed riyas wrote: > > hi, > while trying to delete the datas from the datastore it shows the > error... > > > > > BadArgumentError at /employee/removeall/ Expected an instance or iterable > of (, 'google.appengine.api.datastore_types.Key'>, );

Re: tutorial first step. -ImportError: No module named django.core-

2012-11-09 Thread Dan Gentry
Quick note: when using virutalenv on Windows, one runs the activate script to use the environment. \Scripts\activate.bat Same function as the source command in Linux. Dan Gentry >> -- You received this message because you are subscribed to the Google Groups "Django users" group. To view th

How to crop image ?

2012-11-09 Thread Brent
Have you looked at easy-thumbnails? It depends on PIL or Pillow and works great for cropping amount other image manipulations. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d

Re: tutorial first step. -ImportError: No module named django.core-

2012-11-09 Thread Francesco Serafini
I am sure I activated the environment but nothing. In my case I guess I had some problem with the PATH variable.. 2012/11/9 Dan Gentry > Quick note: when using virutalenv on Windows, one runs the activate script > to use the environment. \Scripts\activate.bat > > Same function as the source co

Re: How to crop image ?

2012-11-09 Thread Kurtis Mullins
The only thing I didn't like about easy-thumbnails is that it relied on generating them on the fly and caching them, if I remember correctly. While that's not totally horrendous, I was using a CDN and didn't want to use my Django Application to serve media. Note: I might be thinking of something el

google app engine suggestion

2012-11-09 Thread Aswani Kumar
hi, i am planning to develop an education related information portal in django and google app engine. my question is google app engine supports python 2.7 but django moving towards python 3.x now with django 1.5 the minimum required version of python is 2.6. and django 1.6 will be on python 2.7

Re: How to build this query

2012-11-09 Thread Nikolas Stevenson-Molnar
That looks correct, though you don't need distinct('id'), since presumably id is your primary key and will already be unique. _Nik On 11/9/2012 1:01 AM, ozgur yilmaz wrote: > Maybe: > paris_discounts = Discount.objects.filter( brand__shop__city__name = > 'Paris' ).distinct('id') > > What do you t

Re: google app engine suggestion

2012-11-09 Thread Javier Guerra Giraldez
On Fri, Nov 9, 2012 at 11:53 AM, Aswani Kumar wrote: > my question is google app engine supports python 2.7 but django moving > towards python 3.x now with django 1.5 the minimum required version of > python is 2.6. and django 1.6 will be on python 2.7. what will be my future > if i choose google

CBV for Nested Formesets

2012-11-09 Thread Lee Hinde
I'm looking at these two blog posts to help me figure out nested formsets: http://yergler.net/blog/2009/09/27/nested-formsets-with-django/ http://andreipetre.tumblr.com/post/26203496689/nested-formsets-with-django The example uses a function view and I was interested using class-based views, but

Re: Hi guyz . iam just a beginner in google app engine..plz help me "abt deleting datas from DATASTORE"

2012-11-09 Thread Kev Dwyer
muhammed riyas wrote: > hi, > while trying to delete the datas from the datastore it shows the > error... > > > > > BadArgumentError at /employee/removeall/ Expected an instance or iterable > of (, 'google.appengine.api.datastore_types.Key'>, ); > received object at 0xb090aac>> (a inst

Re: google app engine suggestion

2012-11-09 Thread Ashwin Kumar
thank you javier, i am a .net and php developer, i can setup .net and php servers on windows, ubuntu. i am new to django/python. i love python so giving it a try. can you give any idea of setting up my own django server, i found hard time in setting up one. not able to choose between apache and

Queries to multiple tables

2012-11-09 Thread Kristofer
Hello, I'm new to Django and trying to learn it by making a simple budget/checkbook application. I apologize for my ignorance, but I couldn't seem to find an answer to this on Google or the Django docs from my searches. I want to create a function that will take a bank account as an id numb