for loop logic in template

2010-10-26 Thread jimgardener
hi I have a model with 3 fields class Employee(models.Model): name=models.CharField(max_length=50) home_address=models.TextField(blank=True) change_filter=models.IntegerField() I am creating a modelform using this class as model. class EmployeeForm(ModelForm): class Meta:

Re: Django job needed

2010-10-26 Thread Venkatraman S
On Wed, Oct 27, 2010 at 1:04 AM, Swordfish wrote: > Hi everybody! I'm looking for a job deals with Django. > Interesting in any kind of work: filling websites with images, texts, > translations, testing. > I'am Django newbie.Have previous experience with Plone. > >

Re: Displaying Profile model in a form

2010-10-26 Thread Venkatraman S
On Wed, Oct 27, 2010 at 4:13 AM, christian.posta wrote: > I'm trying to display a form that has both the UserProfile fields and > a select handful of the User fields. > What's the best way to go about doing this? In the CreateUserForm that > I'm creating, I have an

Displaying Profile model in a form

2010-10-26 Thread christian.posta
I am relatively new to django. I've been reading the docs endlessly and hacking to try to get something to work, but I'm hoping to not re- create functionality that either exists or is part of the framework. I have a class named UserProfile that I'd like to use to extend the User object. I set it

djagios

2010-10-26 Thread Andrea Imparato
Hello to all, I would like to add some nagios feature to my django app. I found this project http://djagios.org/index.html but I see that is not supported since 9 December 2009 :\. What do you think about it? Is it safe in your opinion or can you suggest me other solutions? Thanks -- You

Re: Permission Denied when Trying to delete User

2010-10-26 Thread Shawn Milochik
Try going into the shell with 'manage.py shell,' import the User model, and attempt to delete that user. See what happens and give us the traceback if it fails and you still don't know why. Shawn -- You received this message because you are subscribed to the Google Groups "Django users" group.

Django job needed

2010-10-26 Thread Swordfish
Hi everybody! I'm looking for a job deals with Django. Interesting in any kind of work: filling websites with images, texts, translations, testing. I'am Django newbie.Have previous experience with Plone. -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Query field across multiple django models

2010-10-26 Thread Ed
Do you have further detail on how this looks? I was intending to use forms.changed_data, but I would much rather get an automatic list of changed fields by comparing the new submission to the initial state. How do I compare the initial to the post within a pre_save function? On Oct 26, 12:18 

Re: how to use tkinter widget in django

2010-10-26 Thread jimgardener
thanks elijah..that worked how come id="id_user_entry" not enough? regards jim On Oct 26, 11:54 pm, elijah rutschman wrote: > >   >       min="0" > >       max="1000" > >       step="2" > >       value="6" id="id_user_entry"/> > > Try adding a name="user_entry" attribute to

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
On Oct 26, 10:24 am, Phlip wrote: > > This sounds like what django-reversion[1] does :) > > > [1]:http://github.com/etianen/django-reversion#readme > > We have to cover the situation where some clients might still have > rev(n-1), while some are up-to-date with rev(n). So

Re: change the default widget to a field in a modelform

2010-10-26 Thread refreegrata
maybe I not explain correctly. For any modelForm the forms for a field "ManytoMany" are "select multiple". If I want to change this I must to redefine the widget for that field in the declaration of the "modelForm". This works correctly, I can transform the field from "select multiple" to any

Re: how to use tkinter widget in django

2010-10-26 Thread elijah rutschman
>         min="0" >       max="1000" >       step="2" >       value="6" id="id_user_entry"/> Try adding a name="user_entry" attribute to the input. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: how to use tkinter widget in django

2010-10-26 Thread jimgardener
hi thanks for the link. I tried this,In firefox3.6.11 ,it is rendered as a text field In chrome it shows a slider. ... select numerical value using slider: {{myform.user_entry.errors}} ... However,I am getting validation error upon processing the form I put the field as an IntegerField in

wsgi conf ignored after apache restart

2010-10-26 Thread Scot Hacker
We have a consistent mystery on one of our .edu sites I'm hoping someone can help solve. If we restart apache on this shared host, the site reverts to a very old, non-Django version of itself. That is, an antique PHP-based version of the site is served up, and the design changes to one

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
> Things.objects.filter(id__in=Things.objects.values('name').annotate(max_id= > Max('id')).values_list('max_id', > flat=True)) I didn't do values_list because I guessed that the inner query would run and produce an array, then the outer query would run. My way, with values() on both sides of

Filtering Admin Inlines

2010-10-26 Thread Lllama
Hello all, I've got an admin site that includes some inlines. These in turn contain a ChoiceField. I'd like to filter the choices based on an attribute of the parent model. Does anyone know if this is possible and, if so, what hook I need to use? I feel like I should be able to use

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Alec Shaner
On Tue, Oct 26, 2010 at 12:40 PM, Phlip wrote: > > So this statement correctly fetches only the latest items: > > SELECT a.* FROM things a WHERE a.pid in (select max(b.pid) from > content_entity b group by b.name) > > Now I thought (from my allegedly copious experience with

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
> This sounds like what django-reversion[1] does :) > > [1]:http://github.com/etianen/django-reversion#readme We have to cover the situation where some clients might still have rev(n-1), while some are up-to-date with rev(n). So we _probably_ need the history in the same table as the current

Re: Multiple database issue v1.2.3 - Django reading the wrong database

2010-10-26 Thread Stodge
Pasted misleading traceback, as I created the scene table in the default database to verify this. Traceback (most recent call last): File "", line 1, in File "/usr/lib/python2.6/site-packages/django/db/models/manager.py", line 132, in get return self.get_query_set().get(*args, **kwargs)

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Łukasz Rekucki
On 26 October 2010 19:05, Steve Holden wrote: > On 10/26/2010 12:40 PM, Phlip wrote: >> Note that "isabelle_item" appears twice. We are following the auditing >> rule "always write new records to change data - never edit previous >> records". Someone edited isabelle_item's

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
> I hope the auditors are only forcing you to do this with records that > aren't referenced as part of relationships, otherwise your database is > going to get hammered updating all the foreign keys. The design spec (which is ours, not any "CPA auditor's"), say to duplicate the living crap out of

Multiple database issue v1.2.3 - Django reading the wrong database

2010-10-26 Thread Stodge
I have two PostgreSQL (postgresql_psycopg2) databases defined in my settings; default and scenes. If I perform a filter using the 'scenes' DB I get the expected results: Scene.objects.filter(name__contains='ME').using('scenes') [, ] If I perform a get(), Django seems to get completely confused

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Steve Holden
On 10/26/2010 12:40 PM, Phlip wrote: > Note that "isabelle_item" appears twice. We are following the auditing > rule "always write new records to change data - never edit previous > records". Someone edited isabelle_item's payload data (not shown), so > we add a new record without touching the

Re: Admin without template (no colors, no css, just simple html)

2010-10-26 Thread Giancarlo Razzolini
So I did the right thing... nice! Giancarlo Razzolini http://lock.razzolini.adm.br Linux User 172199 Red Hat Certified Engineer no:804006389722501 Verify:https://www.redhat.com/certification/rhce/current/ Moleque Sem Conteudo Numero #002 OpenBSD 4.5 Ubuntu 9.04 Jaunty Jackalope 4386 2A6F FFD4

Re: nl2br or equivalent to django

2010-10-26 Thread refreegrata
Thanks, is clearly explained in the documentation. I feel embarrassed for do a post for something like this. On 26 oct, 13:25, Daniel Roseman wrote: > On Oct 26, 5:02 pm, refreegrata wrote: > > > Hello list, I have a newie question, are in django

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
Tom Evans wrote: > Phlip, I'm going to try and make a non-stupid comment now :) http://xkcd.com/386/ > If you already know precisely the query you want to use, and you can't > coerce django's ORM to produce it, can you simply use Manager.raw()[1] > to generate the result set you are after?

Re: Access to field name in upload_to?

2010-10-26 Thread Scott Gould
> One idea would be to put 'fieldname' as the first parameter to the > function, then use functools.partial [1] to create partial functions > for each file field with the value set appropriately: > >         thumbnail_image = FileField(upload_to=partial(get_upload_path, > 'thumbnail_image'))

Re: nl2br or equivalent to django

2010-10-26 Thread Daniel Roseman
On Oct 26, 5:02 pm, refreegrata wrote: > Hello list, I have a newie question, are in django some function like > nl2br in the template to print data saved previously from a > "textarea"? because in my template all the lines are printed in the > same line. > > P.D.: nl2br is

help with model definition

2010-10-26 Thread pixelcowboy
I have a question regarding the best way to conceptualize a model. I have a tasks model, which I want to hook to a few different other models: The model Project, the model Company and a few other undefined models. The problem is that I want a particular instance of the task to be pluggable to one

Re: Query field across multiple django models

2010-10-26 Thread bruno desthuilliers
On 26 oct, 15:48, Ed wrote: > I do like this a lot.  If I use post_save, is there a way to grab the > field that is altered? Nope, you have to use "pre_save" for this, load another (yet unmodified) copy of your model instance, and diff both. > I know the admin page

Re: Graphic and form in the same template

2010-10-26 Thread Waleria
I don't understand what you said. Thanks On 26 out, 12:19, Daniel Roseman wrote: > On Oct 26, 3:08 pm, Waleria wrote: > > > I know that the execution of the function stops there, but i don't > > know how do i resolve. I need to display the

nl2br or equivalent to django

2010-10-26 Thread refreegrata
Hello list, I have a newie question, are in django some function like nl2br in the template to print data saved previously from a "textarea"? because in my template all the lines are printed in the same line. P.D.: nl2br is PHP function to do this: "a b c" is tranformed in "abc" Thanks for

Re: Access to field name in upload_to?

2010-10-26 Thread Daniel Roseman
On Oct 26, 4:29 pm, Scott Gould wrote: > Hi folks, > > I've got all my file uploads (that go to S3 as it happens, but I don't > think that's overly important) taking their path from one upload_to > delegate: > > def get_upload_path(instance, filename=None): >         """ >    

'str' object not callable

2010-10-26 Thread John Yeukhon Wong
This is part of my views [[[code]]] from mysite.views def site_root(request): return HttpResponse("This is the site root") def hello(request): return HttpResponse("Hello World") [[endcode]] My URLConf [[code]] from django.conf.urls.defaults import * urlpatterns =

Access to field name in upload_to?

2010-10-26 Thread Scott Gould
Hi folks, I've got all my file uploads (that go to S3 as it happens, but I don't think that's overly important) taking their path from one upload_to delegate: def get_upload_path(instance, filename=None): """ Defaults to appname/modelname/uuid. """ return

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Tom Evans
Phlip, I'm going to try and make a non-stupid comment now :) If you already know precisely the query you want to use, and you can't coerce django's ORM to produce it, can you simply use Manager.raw()[1] to generate the result set you are after? Eg, Student.objects.raw(r'SELECT * FROM `student`

Re: Query field across multiple django models

2010-10-26 Thread Scott Gould
> Second, I'm not sure I understood the last part about getting the > field within each model. Sorry, I misread, thinking you were talking about having different parameters of each model being responsible for what counted as "latest". Bruno's solution looks good to me. -- You received this

Re: Graphic and form in the same template

2010-10-26 Thread Daniel Roseman
On Oct 26, 3:08 pm, Waleria wrote: > I know that the execution of the function stops there, but i don't > know how do i resolve. I need to display the graphic generated and > just below the form. > > Can you help me, please? > > Thanks Well as far as I can tell, the

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
> st=Student.objects.filter(marks__in=Student.objects.all().aggregate(Max('ma > rks'))) Aha - a marks__in may point to an aggregate subquery. In conclusion, screw my SQL server's optimizer. It deserves to suffer! (I can't seem to find a self-join to do what I need either...) -- You received

Re: how to use tkinter widget in django

2010-10-26 Thread ringemup
Try the HTML5 . On some current browsers, it'll just appear as a text field, although you can supplement it with javascript. Moving forwards, as more browsers support HTML5 forms, it'll appear as a slider widget. See [1]. [1]http://diveintohtml5.org/forms.html#type-range On Oct 26, 7:17 am,

Re: Graphic and form in the same template

2010-10-26 Thread Waleria
I know that the execution of the function stops there, but i don't know how do i resolve. I need to display the graphic generated and just below the form. Can you help me, please? Thanks On 26 out, 11:42, Daniel Roseman wrote: > On Oct 26, 2:17 pm, Waleria

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Phlip
On Oct 26, 2:42 am, Tom Evans wrote: > I'm curious, why can't I talk you into > Student.objects.all().order_by('-score')[0] ? > > It is clearly a superior query :/ > >> ( BTW please don't try to talk me out of it; I've been doing SQL since > >> 1989 and am fully aware

Re: Query field across multiple django models

2010-10-26 Thread Ed
I do like this a lot. If I use post_save, is there a way to grab the field that is altered? I know the admin page seems to be able to determine the changed field. . . On Oct 26, 9:41 am, bruno desthuilliers wrote: > On 26 oct, 13:25, Ed

Re: Query field across multiple django models

2010-10-26 Thread Ed
If there is no simpler way to do this, then I'm fine with this method. 2 questions though. Is there a concern about the size of the query required for the big_honking_list? I would probably be pulling a much larger dataset than I need and can only truncate it after it's sorted by date. Second,

Re: Graphic and form in the same template

2010-10-26 Thread Daniel Roseman
On Oct 26, 2:17 pm, Waleria wrote: > Hi all, > > I have this code:http://pastebin.com/Ra1G7twn > > I need to display the graphic generated and just below the form, now > the code only display the form. The image of graphic isn't displayed. > > What could it be? > > How do

Re: Query field across multiple django models

2010-10-26 Thread bruno desthuilliers
On 26 oct, 13:25, Ed wrote: > I want to create a "What's New" section that lists all of the database > changes in the last day. I've added an "updated" field to my models: > > class Film(models.Model): >    . >    . >    . >    updated =

possible bug with onetoone relationship and psycopg2

2010-10-26 Thread sircco
Looking for someone to check into this, before i submit problem is with __isnull=False handling backend is psycopg2 tables: class Person(models.Model): name = models.CharField(max_length=60) surname = models.CharField(max_length=60) class SampleTest(models.Model): person =

Re: choosing queryset

2010-10-26 Thread vamsy krishna
That's it! Thanks for pointing me in the right direction. Also my apologies for posting on the other forum. I did not know i wasn't supposed to do that. And thanks DR for your response. I've sorted it out now. On Oct 26, 5:42 pm, Jirka Vejrazka wrote: > > I've two

Graphic and form in the same template

2010-10-26 Thread Waleria
Hi all, I have this code: http://pastebin.com/Ra1G7twn I need to display the graphic generated and just below the form, now the code only display the form. The image of graphic isn't displayed. What could it be? How do i resolve? Thanks -- You received this message because you are

Re: Admin without template (no colors, no css, just simple html)

2010-10-26 Thread Daniel Roseman
On Oct 26, 1:25 pm, Giancarlo Razzolini wrote: > I had this same problem when hosting it with apache. I solved the > problem by creating a symbolic link inside my media folder pointing to > the admin site that is instaled with django. Something like this: > > admin ->

Re: What does an ideal django workflow setup look like?

2010-10-26 Thread Celso González
On Fri, Oct 22, 2010 at 08:02:56AM -0700, Ken wrote: Hi > I understand there are many different ways and products to use to > setup a great workflow for developing in django, but would like to > hear how you or your startup team (or corporate dev group) does it. > Specifics would be amazing, as

Re: how to use tkinter widget in django

2010-10-26 Thread Steve Holden
On 10/26/2010 8:50 AM, jimgardener wrote: > thanks for the replies.. > I am wondering if javascript is the only alternative if I want to use > such a custom widget. > If anyone knows about any such python widget please tell me.. > regards > jim > Jim: The reason you can forget using Python is

Re: how to use tkinter widget in django

2010-10-26 Thread Jirka Vejrazka
> thanks for the replies.. > I am wondering if javascript is the only alternative if I want to use > such a custom widget. > If anyone knows about any such python widget please tell me.. You might want to dig a bit into website design to understand how JavaScript-based systems work. That would

Re: how to use tkinter widget in django

2010-10-26 Thread jimgardener
thanks for the replies.. I am wondering if javascript is the only alternative if I want to use such a custom widget. If anyone knows about any such python widget please tell me.. regards jim -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: choosing queryset

2010-10-26 Thread Daniel Roseman
On Oct 26, 1:29 pm, vamsy krishna wrote: > I've two modules called plan and income and both have a class called > Income in their respective models. Now if I do user.income_set, it is > accessing the income set under plan. How do I alter it to access > income.income? Any

Re: choosing queryset

2010-10-26 Thread Jirka Vejrazka
> I've two modules called plan and income and both have a class called > Income in their respective models. Now if I do user.income_set, it is > accessing the income set under plan. How do I alter it to access > income.income? Any ideas? Hi, have you had a chance to check out related_name in

choosing queryset

2010-10-26 Thread vamsy krishna
I've two modules called plan and income and both have a class called Income in their respective models. Now if I do user.income_set, it is accessing the income set under plan. How do I alter it to access income.income? Any ideas? Thanks in advance -- You received this message because you are

Re: Admin without template (no colors, no css, just simple html)

2010-10-26 Thread Giancarlo Razzolini
I had this same problem when hosting it with apache. I solved the problem by creating a symbolic link inside my media folder pointing to the admin site that is instaled with django. Something like this: admin -> /usr/share/pyshared/django/contrib/admin/media/ Of course, this would only work

Re: how to use tkinter widget in django

2010-10-26 Thread Nelson Saraiva
hi, do this with JavaScript. 2010/10/26 jimgardener > is it possible to use the sliderlike Scale widget from tkinter in > django?I am coding a web app where I need to get a numerical value > entered by the user.I thought ,instead of asking the user to enter a > value

Re: (sem Assunto) Sorry... Django Setup Problem

2010-10-26 Thread Nelson Saraiva
you think this problem is the Django_countries? I expected it to be in PostgreSQL. I'll check the versions now! Thanks 2010/10/26 Venkatraman S > > On Tue, Oct 26, 2010 at 5:28 PM, Nelson Saraiva wrote: > >> * >> File >>

Re: how to use tkinter widget in django

2010-10-26 Thread Steve Holden
On 10/26/2010 7:17 AM, jimgardener wrote: > is it possible to use the sliderlike Scale widget from tkinter in > django?I am coding a web app where I need to get a numerical value > entered by the user.I thought ,instead of asking the user to enter a > value in a textfield ,I would provide a slider

Re:

2010-10-26 Thread Venkatraman S
On Tue, Oct 26, 2010 at 5:28 PM, Nelson Saraiva wrote: > * > File > "C:\Python25\lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", > line 121, > in _cursorraise ImproperlyConfigured("You need to specify NAME in your > Django settings file.") > >

Re: What does an ideal django workflow setup look like?

2010-10-26 Thread David De La Harpe Golden
On 25/10/10 19:04, Jumpfroggy wrote: > - +1 on using "settings.py" and "local_settings.py". The problem with > keeping local settings files in the VCS is when you have multiple > servers with different settings. You could store each file as > local_settings_test_server.py and so on. We use

[no subject]

2010-10-26 Thread Nelson Saraiva
Hi, I'm new here in the List and Django (i'm a intermediate python programmer), i'm from Brazil. one know I'm trying to install a group buying system here in my machine called Massive-Coupon, anyone know? After you install many dependencies(Photologue, PyFacebook, SocialRegistration,...), arose

Re: moving from Postgres to MySQL

2010-10-26 Thread David De La Harpe Golden
On 22/10/10 17:34, Kevin Monceaux wrote: > I think the OP was referring to mysqldump's --compatible option which > one could use, for example, as mysqldump --compatible=postgresql ... Doesn't Work, btw. (really doesn't help much, at least in my experience - you just end up with dump that's

Re: Query field across multiple django models

2010-10-26 Thread Scott Gould
Maybe -- in fact, almost certainly not -- the best way, but this is how I do that kind of thing: a_queryset = ModelA.objects.all() another_queryset = ModelB.objects.filter.(by_something=True) yet_another_queryset = ModelC.objects.exclude(by_something_else=False)

Query field across multiple django models

2010-10-26 Thread Ed
I want to create a "What's New" section that lists all of the database changes in the last day. I've added an "updated" field to my models: class Film(models.Model): . . . updated = models.DateTimeField(auto_now=True) class Actor(models.Model): . . . updated =

how to use tkinter widget in django

2010-10-26 Thread jimgardener
is it possible to use the sliderlike Scale widget from tkinter in django?I am coding a web app where I need to get a numerical value entered by the user.I thought ,instead of asking the user to enter a value in a textfield ,I would provide a slider which he can move between the minimum and maximum

Re: What does an ideal django workflow setup look like?

2010-10-26 Thread Brian Bouterse
I can't encourage it *enough*. This was writen hastily, thanks for the close read. Brian On Tue, Oct 26, 2010 at 1:01 AM, Kenneth Gonsalves wrote: > On Mon, 2010-10-25 at 16:06 -0400, Brian Bouterse wrote: > > I really can't encourage the use of Hudson

Re: How WEB SERVICE works?

2010-10-26 Thread girish shabadimath
sorry friends, ignore this On Tue, Oct 26, 2010 at 4:31 PM, Tom Evans wrote: > Bad netiquette. > > Please don't send unsolicited attachments to mailing lists. If it is > really that riveting, provide a link. > > On Tue, Oct 26, 2010 at 11:55 AM, girish shabadimath >

Re: How WEB SERVICE works?

2010-10-26 Thread Tom Evans
Bad netiquette. Please don't send unsolicited attachments to mailing lists. If it is really that riveting, provide a link. On Tue, Oct 26, 2010 at 11:55 AM, girish shabadimath wrote: > > Hi friends, > i found this ppt interesting, specially the diagram which made me to

Re: Admin without template (no colors, no css, just simple html)

2010-10-26 Thread rebus_
On 26 October 2010 06:48, marcoarreguin wrote: > I'm starting with Django and I have a bluehost, yesterday I have been > installing all the stuff, I found a tutorial about how to install > django in bluehost, so I'm using fcgi. > > My problem is that when I uncomment the

Re: django page cms get_absolute_url return an empty strings andURL issues.

2010-10-26 Thread tricks...@googlemail.com
Sorted. The get absolute url had not been set and the ordering of urls was incorrect. -- 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

Re: Unable to filter a query on >1 ManyToMany relationships

2010-10-26 Thread Tom Evans
On Mon, Oct 25, 2010 at 6:30 PM, Jumpfroggy wrote: > > I have a class like this: > > class Node: >    name = models.CharField() >    parents = models.ManyToManyField('self', symmetrical=False, > related_name='child_nodes', null=True, blank=True) > > This allows a basic

Admin without template (no colors, no css, just simple html)

2010-10-26 Thread marcoarreguin
I'm starting with Django and I have a bluehost, yesterday I have been installing all the stuff, I found a tutorial about how to install django in bluehost, so I'm using fcgi. My problem is that when I uncomment the necesary things to run my admin, it runs, but it hasn't a layout like the images

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Tom Evans
Course there could be, I'm being dense :/ On Tue, Oct 26, 2010 at 10:55 AM, Piotr Kilczuk wrote: > > > 2010/10/26 Tom Evans >> >> I'm curious, why can't I talk you into >> Student.objects.all().order_by('-score')[0] ? >> >> It is clearly a superior

Re: What does an ideal django workflow setup look like?

2010-10-26 Thread Tom Evans
On Mon, Oct 25, 2010 at 7:04 PM, Jumpfroggy wrote: > This is such a great thread!  I'd love to see a wiki page detailing > some good setup ideas.  It's such a leap forward from the nuts & bolts > of "How do I install django" and "How do I run a complex query" to > this...

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Piotr Kilczuk
2010/10/26 Tom Evans > I'm curious, why can't I talk you into > Student.objects.all().order_by('-score')[0] ? > > It is clearly a superior query :/ > This would select only one row; there can possibly be multiple students with a top note. Am I right? :) Regards,

Re: SELECT * FROM `student` WHERE mark=(select max(mark) from student)

2010-10-26 Thread Tom Evans
I'm curious, why can't I talk you into Student.objects.all().order_by('-score')[0] ? It is clearly a superior query :/ Cheers Tom On Tue, Oct 26, 2010 at 6:37 AM, ankit rai wrote: > say your model name is Student, and it has a field names as marks > > query set will be >