Hi List, Merry Xmas! In my mysql db, I have this table (ccpngrid_gridjob), created from a model GridJob:
| juser | jname | title | fileName | jdate | jobdir | jstatus | jpid | jiter | round | where my pk is jobdir. I would like to know how to convert, if possible, the sql command below to a django query: select *, case when jstatus='Submitted' then '1 orange' when jstatus='Running' then '2 blue' when jstatus='Failed' then '3 red' when jstatus='Cancelled' then '4 magenta' when jstatus='Finished' then '5 green' else '6 black' end as seq from ccpngrid_gridjob where juser='alan' order by seq, jobdir DESC Many thanks in advance. Alan -- Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate Department of Biochemistry, University of Cambridge. 80 Tennis Court Road, Cambridge CB2 1GA, UK. >>http://www.bio.cam.ac.uk/~awd28<< --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---