Django Cheat Sheet

2007-02-13 Thread John Sutherland
Hi all, Firstly, sorry for the cross-post. My employer, Mercurytide [1], as some of you may have seen in the past, publishes white-papers on a monthly basis. This month it's another Django themed one: a Django cheat sheet: We've

Re: What IDE do you use? (semi-OT)

2006-10-08 Thread John Sutherland
On 8 Oct 2006, at 23:22, Serg Kovrov wrote: > I'd like to know what editor/IDE Django users (and developers) uses on > daily basis, to boost development process. And why exactly - what > features you find useful, how it helps you to save time (or just makes > coding enjoyable, which probably

Re: How do I select where x=a and y=b?

2006-10-08 Thread John Sutherland
On 8 Oct 2006, at 19:48, carlwenrich wrote: > What I'm looking for is something like r = Record.objects.get(x=a, > y=b) > which doesn't work. Give the following a go: Record.objects.filter(x__exact='a', y__exact='b') John. --~--~-~--~~~---~--~~ You received

Re: Organisational question

2006-10-01 Thread John Sutherland
On 1 Oct 2006, at 17:02, Nicolas Steinmetz wrote: > to have 3 app (a blog app, a tutorial app and a category app) ? In > the second case, the questions are : I would suggest this is the way to go, if you added another app, say a photo gallery or something, you can add photos to categories.

Re: tutorials

2006-09-30 Thread John Sutherland
On 1 Oct 2006, at 01:08, Malcolm Tredinnick wrote: > > On Sat, 2006-09-30 at 23:10 +0200, Onno Timmerman wrote: >> Hi, >> >> Its not easy when you first learn Django. You just start to get some >> grasps with it when you do the tutorials but the tutorials stop >> after 4 >> pages. Any idea

Re: Stumped on how to implement flatpages

2006-08-24 Thread John Sutherland
On 24 Aug 2006, at 21:49, [EMAIL PROTECTED] wrote: > I read the documentation on the flatpages, included the middleware, > added the app, sync'd the database, and made an entry using the admin. It sound like you've put the flatpages middleware in the wrong place, it should be the last entry

Re: How do I store project in subversion?

2006-08-15 Thread John Sutherland
On 15 Aug 2006, at 20:52, [EMAIL PROTECTED] wrote: > I was wondering if someone could tell me how they store the django > project in subversion. I am moving a php project I have already > written > to django and I want to open source this project. So I am trying to > figure out the best way to

Re: Template including

2006-08-11 Thread John Sutherland
On 11 Aug 2006, at 20:05, Michal wrote: > > Hello, > I was trying to include some of the menu templates according to > flatpage.url variable (I have several local menu templates): > > {% include flatpage.url|menu %} > > But this doesn't work. It seems to me, that flatpage.url|menu isn't >

Re: Admin interface for DB model classes defined outside application doesn't work ?

2006-08-08 Thread John Sutherland
Not that I could find -- I believe I originally found it in a Ticket somewhere. John. On 8/8/06, ak <[EMAIL PROTECTED]> wrote: > > John, app_label made it work. Thanks !!! > > P.S. Is there a line in django docs about that ? > > > > > -- [EMAIL PROTECTED]

Re: How to get a subset of records from a subset?

2006-08-08 Thread John Sutherland
Hi PythonistL, I wonder if you can do the following: histories = historys... ids = [history.id for history in histories] histories = historys.get_list(id__in=ids, date__year=1066) It's a while since I did any .91 ;) John. On 8/8/06, PythonistL <[EMAIL PROTECTED]> wrote: > > > To explain: >

Re: Admin interface for DB model classes defined outside application doesn't work ?

2006-08-08 Thread John Sutherland
Hi Anton, You may need to add the Meta class in too: mycompany/models.py: from django.db import models class Subnet(models.Model): field = models.CharField(maxlength=255) ... class Admin: pass class Meta: app_label = 'administration' And then in your

[White-paper] Full Text Search w/ MySQL

2006-08-02 Thread John Sutherland
Hi all, I just wanted to let you know about a white-paper written by one of the guys in my office. "Extending Django's database API to include full-text search" We spent a little bit of time coming up with some generic