Queryset._as_sql() is lying to me!

2009-06-16 Thread Andrew Durdin
Today I ran into an issue where using distinct() and values() on a queryset where the model had default ordering would return apparently non-distinct results. After searching, I found http://code.djangoproject.com/ticket/9186 which indicates that this is now correct behaviour. It took me a long

Re: ANN: Updated Django Cheat Sheet

2008-10-07 Thread Andrew Durdin
Issue 4 is out with a correction to the arguments for DecimalField in the Form Fields section. Thanks to Doug Van Horn for pointing out the error. Download it from http://www.mercurytide.co.uk/whitepapers/django-cheat-sheet/ Andrew --~--~-~--~~~---~--~~ You receiv

Re: ANN: Updated Django Cheat Sheet

2008-09-22 Thread Andrew Durdin
We've updated the cheat sheet to correct two typos: - The "default_if_none" filter is now correctly spelt (thanks to Aaron C. de Bruyn for pointing it out). - The "ForeignKey" model field is now correctly named (thanks to Nikos Delibaltadakis for pointing it out). Grab it from http://www.me

Re: ANN: Updated Django Cheat Sheet

2008-09-22 Thread Andrew Durdin
On Sep 21, 8:23 am, "Nikos Delibaltadakis" <[EMAIL PROTECTED]> wrote: > Shouldn't ForeignKeyField to be just ForeignKey? > Am I missing something? No, you're absolutely correct -- thanks for spotting the error! We'll get a corrected version out ASAP. Cheers, Andrew. --~--~-~--~~---

Re: ANN: Updated Django Cheat Sheet

2008-09-10 Thread Andrew Durdin
ere in an earlier draft, but there just wasn't room. They're not too hard to remember, though, hopefully? Off the top of my head: counter, counter0, revcounter, revcounter0, parentloop, first, last. You could write them all on a single post-it note and stick them to y

Re: datetime 8 hours off

2008-04-22 Thread Andrew Durdin
On Apr 4, 1:16 pm, Simon Oberhammer <[EMAIL PROTECTED]> wrote: > Magus on IRC told me that multiple django projects with different > timezones serverd by apache / mod_python could be a problem - ie one > changing TZ in a thread that also servers the other project. > > So I set timezone-setting to

Re: Django app initialisation

2007-04-18 Thread Andrew Durdin
On Apr 18, 4:27 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > The problem is that "import all apps" is not a simple operation and has > lots of unexpected (at least until you get used to expecting the > unexpected) side-effects. Nested imports are the main cause. :-) > > The problem is tha

Re: Django app initialisation

2007-04-17 Thread Andrew Durdin
On Apr 4, 12:26 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > > I cannot think of any reliable way to solve this. It's a reasonably hard > problem to solve correctly, apparently. I say this because we currently > are *not* solving it in django/db/models/loading.py when we try to > initialise

Django app initialisation

2007-04-04 Thread Andrew Durdin
I've got a situation where one of my django apps needs to perform some initialisation that includes processing the models from all the installed apps -- and it needs its own models to have been initialised also. Because of this, I can't do my initialization when the app's __init__ module is loade

Always repeating myself in templates

2007-03-22 Thread Andrew Durdin
Recently I've found myself repeating variables many times in templates, much like this: {% if company.contact.email %} Email address {{ company.contact.email }} {% endifvalue %} This repetition is annoying, as well as inefficient if company.contact involves a ForeignKey lookup. I've created

Re: Good Web development practice

2007-01-08 Thread Andrew Durdin
paulh wrote: This thread seems to have drifted away from its original purpose. The tutorial authors seemed to have an idea about preventing the reposting of data by use of a suitable redirect. I stated that I had been unable to achieve this effect and asked whether anyone else had been able to a

Re: Full Text Search w/ MySQL

2006-08-03 Thread Andrew Durdin
Adam Endicott wrote: > > Do any of the core devs see this as a candidate for inclusion in > contrib? Speaking as the author of the piece -- I don't. This code isn't developed enough to be particularly practical as-is: to be more useful it should probably support both natural language and boolean