Re: IronPython AssertionError

2010-05-20 Thread Russell Keith-Magee
On Fri, May 21, 2010 at 1:47 AM, Joe D wrote: > Has anyone had any luck running Django on IronPython ? Testing under IronPython hasn't been part of our regular testing regimen, so I can't comment on the level of compatibility. > This seems to have been reported to the IronPython team here: > > h

Re: Module loading error in django trunk.

2010-05-20 Thread Russell Keith-Magee
On Thu, May 20, 2010 at 3:17 PM, ben wrote: > > > On May 18, 9:35 pm, Russell Keith-Magee > wrote: >> On Tue, May 18, 2010 at 6:12 PM, ben wrote: >> > Hi All, >> >> > After a recent svn update to my copy of Django/trunk I’ve been getting >> >

Re: manager.raw returning Capitalized field names

2010-05-20 Thread Russell Keith-Magee
class CheckIn(models.Model): sample_id = models.AutoField(db_column='SampleID', primary_key=True) date_arrived = models.DateField(db_column='DateArrived') company_name = models.CharField(max_length=100, db_column='Company') < plus any extra fields > class Meta: db_table

Re: pass related_name-s into Model.objects.create()?

2010-05-18 Thread Russell Keith-Magee
On Tue, May 18, 2010 at 12:45 PM, Phlip wrote: > Djangoists: > > The documentation for Model.objects.create(**kwargs) does not define > kwargs. It just sez "kwargs". > > I think all of our experiences would bear out "kwargs" may at least be > the model's fields. Correct. > But what about 'Foreig

Re: Module loading error in django trunk.

2010-05-18 Thread Russell Keith-Magee
On Tue, May 18, 2010 at 6:12 PM, ben wrote: > Hi All, > > After a recent svn update to my copy of Django/trunk I’ve been getting > a persistent error relating to module loading (see below). I am able > to create the same error from many but not all views/requests. > > Interesting, when I run my co

Re: Django 1.1.2?

2010-05-17 Thread Russell Keith-Magee
On Mon, May 17, 2010 at 6:56 PM, Antoni Aloy wrote: > Hello, > > On the main Django page the official version is 1.1.1 but there is a > new 1.1.2 version even documented if you make a search on the Django > site. Is the 1.1.2 officialy supported? Unofficially, yes it is officially supported :-)

Re: include(admin.site.urls) mangles with the URL

2010-05-17 Thread Russell Keith-Magee
On Mon, May 17, 2010 at 5:55 PM, Dennis Decker Jensen wrote: > Hello! > > I've been using django for a while now, and been around in the > documentation and a bit in the source code as well. I have a site > setup along the lines of the tutorial, nothing fancy, a flat urls.py > and no fancy use of

Re: order_with_respect_to fails for GenericForeignKey

2010-05-17 Thread Russell Keith-Magee
2010/5/17 Alper Çuğun : > Hello, > > A quick Google search reveals a ton of confusion about: > Meta: order_with_respect_to > > I have an abbreviated Model: > > class NewsItem(models.Model): >    # newsitems will be linked to blogs and projects >    content_type = models.ForeignKey(ContentType) >  

Re: Is the Django book written in ReST/Sphinx?

2010-05-16 Thread Russell Keith-Magee
On Mon, May 17, 2010 at 7:06 AM, cool-RR wrote: > I'm just working on a book for my own project, and I was wondering: Is > the Django book written in ReST/Sphinx? I am considering whether I > should write my book with that. This is slightly off topic for this list, but I would advise that this is

Re: manager.raw returning Capitalized field names

2010-05-15 Thread Russell Keith-Magee
On Fri, May 14, 2010 at 5:29 AM, geraldcor wrote: > Hello, > > Some background first. I am working with a legacy database that is not > only legacy, it is legacy Microsoft access so there is some hacking > going on. I am accessing a MySQL backend and my models are set up to > use the existing tabl

Re: Testing custom management commands

2010-05-15 Thread Russell Keith-Magee
On Sat, May 15, 2010 at 3:04 AM, ses1984 wrote: > I am interested in writing unit tests to cover some custom commands I > have written, but I'm unsure how I can pass options to these commands > through my unittest.TestCase classes. > > I have a command to import data from my client's flat file sys

Re: Python Database Framework

2010-05-14 Thread Russell Keith-Magee
On Fri, May 14, 2010 at 10:47 PM, Ozgur Yılmaz wrote: > Hi everybody, > > Do anyone knows a Python Database framework, which resembles Django's > approach to database programming? I need it to use outside of Django, for > other Python scripts. Is there some fundamental reason that you can't just

Re: Multiple Database Simple Example

2010-05-13 Thread Russell Keith-Magee
On Thu, May 13, 2010 at 10:27 PM, GRoby wrote: > Hello, > > I am using Django 1.2 RC 1 and have setup multiple databases.  I have > everything working if I manually specify .using, for example: > > SomeObjects = ModelInDefaultDatabase.objects.all()  #This Works > > SomeObjects = ModelInDatabase2Na

Re: Tests fail with django-1.2-rc1

2010-05-11 Thread Russell Keith-Magee
On Tue, May 11, 2010 at 10:21 PM, Dirk Eschler wrote: > Hello, > > i'm in the process of upgrading a project to django-1.2-rc1. While the project > specific tests passed with django-1.1.1, they all fail now with django-1.2-rc1 > (see example below). Any idea what's going wrong? At a guess -- you

Re: Specifying an order_with_respect_to for a self referential one to many relationship (still) fails

2010-05-11 Thread Russell Keith-Magee
On Tue, May 11, 2010 at 5:18 PM, thierry wrote: > This bug is 4 years old. Weird that It was not corrected yet because > it seems to be a core functionality of the ORM. Do django developpers > have planned something before 1.2 stable release ? No, we don't have anything planned before 1.2 goes fi

Re: QuerySet.distinct and aggregates

2010-05-09 Thread Russell Keith-Magee
On Thu, May 6, 2010 at 7:50 PM, zinckiwi wrote: >> I was hoping for an elegant solution for when I know there's going to >> be several thousand plus instances (or hundreds of thousands after a >> year or two of deployment). So in the end, I guess I can work with it, >> but mostly I was hoping to

Re: Django ORM and multidimensional data

2010-05-07 Thread Russell Keith-Magee
On Fri, May 7, 2010 at 7:06 PM, thierry wrote: > Hi all, > > Have django developers planned the integration of new model fields > capable to store multidimensional data ? It's possible right now. As an example, GeoDjango contains fields for composite, multidimensional data (spatial points and pol

Re: Can I map authenticated users to specific databases via a database Router?

2010-05-05 Thread Russell Keith-Magee
On Thu, May 6, 2010 at 7:58 AM, Parker wrote: > I'm trying to port part of an existing application to Django.  In the > other application, each user has their data stored on separate > databases with identical schemas. > > For example, if we have users A, B and C, there are 3 databases > ("Databas

Re: Make MPs answer to us

2010-05-05 Thread Russell Keith-Magee
On Thu, May 6, 2010 at 3:04 AM, Darren Mansell wrote: > > It's election day tomorrow. This is a great web site for lots of info about > what's really going on: > [http://www.38degrees.org.uk] This is a forum about using Django. The site you reference is in no way relevant to that topic (as far a

Re: Trouble with multi-db test suite.

2010-05-04 Thread Russell Keith-Magee
On Wed, May 5, 2010 at 1:43 AM, J. Cliff Dyer wrote: > I'm having trouble working with multi-db using mysql replication.  When > I run our test suite, I'm getting several hundred errors if I have more > than one database configured, and none if I have only one configured. > > It seems that somethi

Re: Uploads in the Form Wizard

2010-05-04 Thread Russell Keith-Magee
On Mon, May 3, 2010 at 12:02 PM, Wiiboy wrote: > What would be the best workaround (or is there one)? > Perhaps overriding FormWizard.process_step()? The only obvious workaround I can think of is to treat the N-form wizard problem as a (N-1) form wizard, plus 1 normal form that handles file uploa

Re: Uploads in the Form Wizard

2010-05-02 Thread Russell Keith-Magee
On Mon, May 3, 2010 at 11:49 AM, Wiiboy wrote: > Is that in trunk (i.e. could I revert to an older SVN revision and > have it work)? Technically, yes, but you'd have to revert to a pre-1.0 revision. The FileField refactoring occurred over 2 years ago. Yours, Russ Magee %-) -- You received this

Re: Uploads in the Form Wizard

2010-05-02 Thread Russell Keith-Magee
On Mon, May 3, 2010 at 11:32 AM, Wiiboy wrote: > Hi guys, > I'm trying to use the form wizard for a model.  The problem is, I have > an ImageField in the last step, but I keep getting a "This field is > required" on it.  request.FILES contains the uploaded file, however. > > Can I use ImageField's

Re: Any way to use the multi-database support in 1.2 for horizontal sharding?

2010-05-01 Thread Russell Keith-Magee
On Sun, May 2, 2010 at 2:52 AM, Continuation wrote: > Hi, > > I read the doc on the multi-database feature in 1.2. It seems it's > mostly geared towards vertical partitioning of databases. > > Any way to use it for horizontal sharding? > > For example, say I have a Message class. I want to use a h

Re: contrib.auth: Email address instead of username as identifier

2010-04-30 Thread Russell Keith-Magee
On Fri, Apr 30, 2010 at 9:30 PM, Felippe Bueno wrote: > > > On Fri, Apr 30, 2010 at 12:08 AM, Russell Keith-Magee > wrote: >> >> I'm sorry - what is this based on? There haven't been any substantive >> changes to contrib.auth in 1.2. It's not on th

Re: contrib.auth: Email address instead of username as identifier

2010-04-29 Thread Russell Keith-Magee
On Fri, Apr 30, 2010 at 5:03 AM, Felippe Bueno wrote: > django-1.2 will support this. I'm sorry - what is this based on? There haven't been any substantive changes to contrib.auth in 1.2. It's not on the official "new features" list. There have been some discussions about some potential changes,

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 12:20 PM, idle sign wrote: > I'm using the latest trunk from http://github.com/django/django. > A complete test project you can grab at > http://idlesign.narod.ru/django/django-tests.tar.gz > There is a little bootstrap.sh to run to create DBs. > > Thank you, Russ. Ok - u

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 11:04 AM, idle sign wrote: > I thought so, have tried so, but got "This code isn't under > transaction management", and opened this thread :) I get that error if I *omit* the using= argument to commit (which is what I'd expect to see). What version of trunk are you using?

Re: Transaction commit with cursor.execute

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 12:59 AM, idle sign wrote: > I think I spotted something weird. May be someone could explain that? > > 1. In Django 1.2 define two DBs (let it be sqlite), one of which name > 'test'. > 2. Define DB router for 'testapp' so that it always uses 'test' DB. > 3. Use 'commit_manu

Re: Moving django.contrib.auth to its own database

2010-04-28 Thread Russell Keith-Magee
On Thu, Apr 29, 2010 at 8:32 AM, Brandon Belew wrote: > Hello, > > I am attempting to use a database router to move django.contrib.auth > off to its own database.   Reasoning behind this - I want to share > just a few tables ( Auth and a custom app called AdminAccess )  across > multiple sites whi

Re: Getting a Blog included in the Django community aggregator

2010-04-28 Thread Russell Keith-Magee
On Wed, Apr 28, 2010 at 9:50 PM, Gustavo Narea wrote: > Hello, Russell et al. > > We also have a relatively new blog where we talk about Django and the > extensions we write for Django, and one of my fellow developers > contacted Jacob a few months ago but he never replied. > > Here's the feed for

Re: Getting a Blog included in the Django community aggregator

2010-04-27 Thread Russell Keith-Magee
On Wed, Apr 28, 2010 at 3:49 AM, Rob wrote: > By strange coincidence, I sent an email to Jacob earlier today > requesting that my blog be included in the Django community > aggregator. > > I had a suspicion that this type of situation might arise, as I expect > many are doing the same. > > My blog

Re: Sending email via SMTP in a unit test

2010-04-23 Thread Russell Keith-Magee
On Fri, Apr 23, 2010 at 6:27 PM, Vasil Vangelovski wrote: > Is there a way to run unit tests in such a way that email will be sent > via the SMTP email backend when there's a call to send_mail in the > unit test? In 1.1; no. In 1.1, Django has a single mail API, and the test setup code replaces t

Re: Getting a Blog included in the Django community aggregator

2010-04-21 Thread Russell Keith-Magee
On Wed, Apr 21, 2010 at 4:28 PM, Daniel Roseman wrote: > On Apr 20, 3:36 pm, Russell Keith-Magee > wrote: >> Obviously this isn't an isolated problem - I'll see what I can do >> about changing the advice on the community page so that Jacob's inbox >> d

Re: Getting a Blog included in the Django community aggregator

2010-04-20 Thread Russell Keith-Magee
On Tue, Apr 20, 2010 at 10:26 PM, Atamert Ölçgen wrote: > On Tuesday 20 April 2010 16:22:58 Russell Keith-Magee wrote: >> Apologies if your mail has gone unanswered. I've just added your blog >> to the aggregator. > I, also, have sent two e-mails to Jacob regarding comm

Re: Getting a Blog included in the Django community aggregator

2010-04-20 Thread Russell Keith-Magee
On Tue, Apr 20, 2010 at 9:21 PM, Russell Keith-Magee wrote: > On Tue, Apr 20, 2010 at 3:48 PM, Jonatan Heyman wrote: >> Hi! >> >> I wonder how to go about to get your blog included in the Django >> community aggregator? I've written one Django post so far, and h

Re: Getting a Blog included in the Django community aggregator

2010-04-20 Thread Russell Keith-Magee
On Tue, Apr 20, 2010 at 3:48 PM, Jonatan Heyman wrote: > Hi! > > I wonder how to go about to get your blog included in the Django > community aggregator? I've written one Django post so far, and have > two other posts laying in the pipeline to be posted. I've sent an e- > mail to jacob at jacobian

Re: Baffled by self.client.login(...) not working in unit tests

2010-04-19 Thread Russell Keith-Magee
On Tue, Apr 20, 2010 at 10:51 AM, Brian McKeever wrote: > I fixed it by uninstalling Python 2.6.5 and installing 2.6.4 instead. Ah - then I think I know the problem. Python 2.6.5 made a change to the way cookies are stored which is subtly incompatible with the test client. This problem has been

Re: IF no longer short-circuits in 1.2?

2010-04-17 Thread Russell Keith-Magee
On Sun, Apr 18, 2010 at 8:53 AM, Jerry Stratton wrote: > It looks like {% if %} with OR or AND no longer short circuits under > 1.2-beta-1. > > class Page(models.Model): >        ... > >        def beTrue(self): >                print "BEING TRUE" >                return True > >        def beFals

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
On Fri, Apr 16, 2010 at 8:40 PM, h-k-ii wrote: > You are correct. > > Based on my experience with natural keys, I would propose improvements > for the documentation [1] - but perhaps these are matters of personal > opinion: We're always open to suggestions on how to improve documentation. The bes

Re: Strange natural keys serialization XML format (Django SVN-12978)

2010-04-16 Thread Russell Keith-Magee
On Fri, Apr 16, 2010 at 5:26 PM, h-k-ii wrote: > I find dumpdata output in XML format quite strange for natural keys. > Each character in a key reference is wrapped in a . > > Is this a bug to be reported or a feature? It certainly doesn't look right; so there is a bug somewhere. However, it mig

Re: manage.py loaddata silently fails

2010-04-12 Thread Russell Keith-Magee
On Tue, Apr 13, 2010 at 2:14 AM, Phlip wrote: >> How do I access the error message? > > In this case, turning on --verbosity=2 reveals a huge dump, and > tweezering through it reveals the fixture file was not found. (A > colleague bumped its app from the app list.) > > It seems that "fixture not f

Re: Request to the list owner

2010-04-11 Thread Russell Keith-Magee
On Mon, Apr 12, 2010 at 1:58 PM, Omer Barlas wrote: > Can you please add a prefix to the email subject? I am reading my mail > mostly from my BB Bold, but I cannot filter mail like Thunderbird > does, it would be much simpler if there was a prefix like [django] or > such. No. This has been propo

Re: dumpdata doesn't seem to respect database routers

2010-04-08 Thread Russell Keith-Magee
On Fri, Apr 9, 2010 at 2:34 AM, wizard_2 wrote: > Hi everyone, > Mange dumpdata seems to be ignoring my database router and failing on > a model thats in a different db. > > I have two databases, default (mysql db named knothedashboard) and > bluecherry (mssql database named dataKNOT). Here's my r

Re: DB Adapter for HTML5 Client Database Storage?

2010-04-07 Thread Russell Keith-Magee
On Wed, Apr 7, 2010 at 3:45 PM, Victor Hooi wrote: > heya, > > This is a bit of random musing, but I was wondering, how big a project > is it to write a DB adapter for the Client-side Client-side Database > Storage API in HTML5? > > That is, there are already efforts to integrate in things like Co

Re: url template tag taking a long time

2010-04-06 Thread Russell Keith-Magee
On Wed, Apr 7, 2010 at 12:08 PM, Brian Neal wrote: > I am on trunk, somewhere around revision 127xx and just updated to > 12936. A couple of my views render this one particular template, which > used to take less than a second to see a response. Now it is taking > almost a minute. The Django debug

Re: ORM: get, filter and DoesNotExist

2010-04-04 Thread Russell Keith-Magee
On Mon, Apr 5, 2010 at 11:33 AM, zweb wrote: > after some debugging, just found out that > filter method does not throw DoesNotExist while get does. get() returns a single object. If a single object does not exist, you get a DoesNotExist exception. This is documented: http://docs.djangoproject.c

Re: Getting strange email from "dreamhost"

2010-03-31 Thread Russell Keith-Magee
On Thu, Apr 1, 2010 at 7:55 AM, Russell Keith-Magee wrote: > On Wed, Mar 31, 2010 at 11:13 PM, Wiiboy wrote: >> Hi guys, >> I've gotten two emails from "Mail Delivery Subsystem >> " with the subject "Your message was NOT >> received by django

Re: Getting strange email from "dreamhost"

2010-03-31 Thread Russell Keith-Magee
On Wed, Mar 31, 2010 at 11:13 PM, Wiiboy wrote: > Hi guys, > I've gotten two emails from "Mail Delivery Subsystem > " with the subject "Your message was NOT > received by django-us...@googlegroups.com!". > The body is below.  Anyone know why I'm getting these?  Is anyone else > getting them?  I ha

Re: Table in models.py not being created during syncdb

2010-03-31 Thread Russell Keith-Magee
On Thu, Apr 1, 2010 at 1:16 AM, wchildsuk wrote: > Hi, > > I'm using the django app, django-schedule (http://github.com/thauber/ > django-schedule) and am adding an additional table to map users to > calendars (see line 253 on dpaste).  When I run syncdb it completely > ignores my table and doesn'

Re: auth.Message ignores directions from database router - Possible RelatedManager bug

2010-03-31 Thread Russell Keith-Magee
On Mon, Mar 29, 2010 at 9:28 AM, xin wrote: > I am unsure if this a bug in Django, or django-multidb-router, or > something I've done wrong. > > I'm using django-multidb-router from here: > http://github.com/jbalogh/django-multidb-router > With two database definitions, a read_only_user and a rea

Re: assert_performant(query_set)

2010-03-29 Thread Russell Keith-Magee
On Tue, Mar 30, 2010 at 12:05 AM, Phlip wrote: >> qs.query.get_compiler(qs.db).as_sql() > > That gives this error message with the usual zero Google hits for that > error message: > >  AttributeError: 'BaseQuery' object has no attribute 'get_compiler' Sorry - a point of clarification. the techniq

Re: Using Mako as a templating language

2010-03-29 Thread Russell Keith-Magee
On Mon, Mar 29, 2010 at 12:34 AM, Colin wrote: > After struggling with Django's templating language for a while, I > decided I wanted to switch to something with a bit more power. In > particular, I liked what I saw of Mako (being able to instantiate new > variables, and write functions for subrou

Re: django version detection

2010-03-28 Thread Russell Keith-Magee
On Mon, Mar 29, 2010 at 8:07 AM, Mike Dewhirst wrote: > Can someone kindly tell me how I can detect which subversion revision of > Django is actually installed on my machine? > > I need to re-install the exact same revision on another platform. > > It is probably staring me in the face but I must

Re: download html django docs

2010-03-28 Thread Russell Keith-Magee
On Mon, Mar 29, 2010 at 5:24 AM, Django Grappelli wrote: > hi everyone, > quick question: > is it possible to download the django docs in html somewhere so that i don't > have to use the rest text ones when i'm developing offline? No, but if you install sphinx (pip install sphinx), you can compil

Re: mod_wsgi broken in rev #12866

2010-03-28 Thread Russell Keith-Magee
On Mon, Mar 29, 2010 at 12:40 AM, nih wrote: > oops sorry, typo in the last paragraph :( > > It only crashes for me with apache, mod_wsgi, new project (no views/ > models/etc), finished project, and rev # 12866+. > > They all work normally with the dev server and rev # 12866+, so that > pretty muc

Re: mod_wsgi broken in rev #12866

2010-03-28 Thread Russell Keith-Magee
On Sun, Mar 28, 2010 at 10:12 PM, nih wrote: > One of the files modified in django rev #12866 has broken mod_wsgi for > me, the web app loads perfectly ok in rev #12865, the apache mod_wsgi > log when using django rev #12866 has: > ... > none of the changed files in rev #12866 look like they have

Re: Testing email with the testserver

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 11:29 PM, Ben Gerdemann wrote: > I found the Django documentation about testing E-mail services > confusing. It says here > http://docs.djangoproject.com/en/1.1/topics/testing/#e-mail-services > "Django's test runner automatically redirects all Django-sent e-mail > to a du

Re: Tests for contrib.flatpages

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 9:42 PM, Bjunix wrote: > Hi all, > > I am looking for tests for the flatpages app. I can't find any. Do I > miss something or ships django without tests for flatpages? You're not missing anything; for historical reasons (specifically, that flatpages was written before Djan

Re: Problem with cross-database foreign-keys and select_related

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 10:54 PM, greatlemer wrote: > Hi, > > I'm running the django 1.2 beta and am testing out the multi-db > system.  Unfortunately I have run into an issue where I have: > > class A(models.Model): >    name = models.CharField() >     > > class B(models.Model): >    a = models.F

Re: Any way to have a ModelForm tied to 2 Models?

2010-03-26 Thread Russell Keith-Magee
On Fri, Mar 26, 2010 at 9:11 AM, Continuation wrote: > I have 2 models: A, B > > I need a form that inserts/updates both fields of A and fields of B. > > Is there any way to create a ModelForm tied to A & B? Or do I need to > use the plain old Form? Why not just use two forms? There's no limitati

Re: Django 1.2b multidatabase + manytomany relationship

2010-03-26 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 6:16 PM, mbdtsmh wrote: > Hi All, still trying to get my head around the multi db stuff in 1.2 > release. > > Here is my problem that I have hit upon. > > I have a model in my default db... > > class Set1(models.Model): >    create_date = models.DateTimeField(auto_now_add='

Re: tests fail for django.contrib.auth

2010-03-26 Thread Russell Keith-Magee
2010/3/24 Filip Gruszczyński : > When I run all tests, tests for django.contrib.auth. I tried googling > it and found information, that django.contrib.sites is required, but I > have this app installed. I was also advised to use > TEMPLATE_CONTEXT_LOADERS, but this didn't help. Have anyone > encoun

Re: Disabling Messaging

2010-03-24 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 9:16 PM, jrs wrote: > I'm using 1.1.1 now.  Any idea when there will be a 1.1.2 release?  Is > the current branch considered stable? 1.1.2 will be released at the same time as 1.2; current estimate is mid April. We only ever backport bugfixes from trunk to the stable bran

Re: Re: possible bug or feature request with extra and where

2010-03-24 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 2:57 PM, Henrik Genssen wrote: > Hi, > > thanks for your answer! > Now is there a way to force select_related tables any way in a count? >> >>select_related() is an optimization for data retrieval. It allows you >>to expand a select row to include related objects in a s

Re: possible bug or feature request with extra and where

2010-03-23 Thread Russell Keith-Magee
On Sun, Mar 21, 2010 at 8:17 AM, Henrik Genssen wrote: > No one any comment on this? > is this the expected behavior? ... >>Now is there a way to force select_related tables any way in a count? select_related() is an optimization for data retrieval. It allows you to expand a select row to include

Re: Django ORM

2010-03-23 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 5:35 AM, jrs wrote: > Clifford, > > Ask the previous engineering staff of Twitter if it's dangerous. When you're using the wrong shovel to hammer in a screw, you don't blame the shovel. Yours, Russ Magee %-) -- You received this message because you are subscribed to the

Re: Django ORM

2010-03-23 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 6:22 AM, jrs wrote: > Another great example... If PostgreSQL has referential integrity on by > default, is django still hammering the db with unnecessary queries? In this case, for two reasons - MySQL, and generic foreign keys. Fisrtly, we aim to guarantee consistent beha

Re: Disabling Messaging

2010-03-23 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 5:01 AM, jrs wrote: > Thanks Preston. > > I'm not using django's messaging... at all.  My problem is that for > every ajax request, the query- > > {'time': '0.000', 'sql': u'SELECT `auth_message`.`id`, > `auth_message`.`user_id`, `auth_message`.`message` FROM `auth_message`

Re: assert_performant(query_set)

2010-03-23 Thread Russell Keith-Magee
On Wed, Mar 24, 2010 at 4:56 AM, Phlip wrote: > Djangoists: > > Suppose I want a test to fail if the database would respond to a given > QuerySet without using my favorite index. > > This test case would attempt, at developer test time, to solve the > same problem as a "soak test" would, at accept

Re: Django ORM

2010-03-23 Thread Russell Keith-Magee
On Tue, Mar 23, 2010 at 11:04 PM, jrs wrote: > Thanks Russ > > On Mar 23, 10:33 am, Russell Keith-Magee > wrote: >> On Tue, Mar 23, 2010 at 10:21 PM, jrs wrote: >> >> > On Mar 23, 10:05 am, "ge...@aquarianhouse.com" >> > wrote: >> >

Re: Django ORM

2010-03-23 Thread Russell Keith-Magee
On Tue, Mar 23, 2010 at 10:21 PM, jrs wrote: > > > On Mar 23, 10:05 am, "ge...@aquarianhouse.com" > wrote: >> Filter would be better :) >> >> Container.objects.filter( >>           pk=container_id >>      ).delete() > > Why is filter better here, since it's a one record delete? It isn't. > Also

Re: Django ORM

2010-03-23 Thread Russell Keith-Magee
On Tue, Mar 23, 2010 at 9:55 PM, jrs wrote: > I have a statement--- > >    Container.objects.get( >         pk=container_id >    ).delete() > > This seemingly trivial operation hammers the db with 581 queries!! > The reason being that the django orm has decided that it will enforce > referential i

Re: Issue with aggregate_select changes

2010-03-23 Thread Russell Keith-Magee
On Tue, Mar 23, 2010 at 5:53 AM, David Cramer wrote: > One of the recent changes in trunk was a change to how querysets were > cloned. Due to this, some old code we had is no longer working. This > was a custom aggregate which relied on "aggregate_select" (see below). > I believe the change I'm re

Re: Making a "Common causes for translation problems"

2010-03-19 Thread Russell Keith-Magee
On Fri, Mar 19, 2010 at 9:16 PM, cool-RR wrote: > Hello Django community, > > I have started compiling a list, "Common causes for translation > problems". Where would be a good place to put this list so people who > have a problem with their translations will be most likely to > encounter it? Dep

Re: Multi Database Question

2010-03-19 Thread Russell Keith-Magee
On Fri, Mar 19, 2010 at 10:19 PM, mbdtsmh wrote: > This makes alot of sense and works in my case - many thanks. > > However, still unclear as to how to specify which table should be > created in which database when you do want to syncdb to both > databases. I may have 2 tables in models.py that I

Re: Authentication system : should I use contrib.auth or reinvent the wheel?

2010-03-19 Thread Russell Keith-Magee
On Sat, Mar 20, 2010 at 9:55 AM, Peyman wrote: > Thank you for your reply. > After having a look at its code, it seems that django-registration > provides the signup feature, and uses contrib.auth for the rest. > > I looked at the source code of the djangoproject.com site itself (for > me, should

Re: multi natural_key dependencies problem

2010-03-15 Thread Russell Keith-Magee
On Tue, Mar 16, 2010 at 11:34 AM, victor wrote: > how to set multi natural_key dependincies? > Model code as following: > class Menu(models.Model): >    mName = models.CharField(max_length=256) >    mTitle = models.CharField(max_length=256) >    url = models.CharField(max_length=1024, blank=True,

Re: a bug (i think) with dynamic inlines and ManyToMany relationships

2010-03-14 Thread Russell Keith-Magee
On Sat, Mar 13, 2010 at 8:33 PM, Simon wrote: > Hi all, > > I've found what I think is a bug in django 1.2 beta 1 (SVN-12773). > > The dynamic inlines works great with foreign key relationships, but > the "Add another xxx" link doesn't appear with ManyToMany > relationships.  It seems to be becaus

Re: How to cache the output of Django 1.2 RSS class based views?

2010-03-11 Thread Russell Keith-Magee
On Thu, Mar 11, 2010 at 10:01 PM, Brian Neal wrote: > On Mar 7, 10:48 pm, Brian Neal wrote: >> Before the Django 1.2 beta and the class-based Feed views, I was doing >> this to cache my RSS feeds: >> >> urls.py: >> from django.contrib.syndication.views import feed as syndication_feed >> from djan

Re: 1.1.2

2010-03-10 Thread Russell Keith-Magee
On Thu, Mar 11, 2010 at 11:16 AM, brad wrote: > Hi all > > When can we expect a release of 1.1.2? Specifically I'm hoping to get > a test bug fixed - http://code.djangoproject.com/ticket/12720 The most likely scenario is that we will cut 1.1.2 at the same time we cut 1.2-final. The exact date dep

Re: Serializing objects with a many-to-many reference

2010-03-09 Thread Russell Keith-Magee
On Wed, Mar 10, 2010 at 1:57 AM, Jesus Mager wrote: > 2010/3/2 Russell Keith-Magee : >> On Wed, Mar 3, 2010 at 12:46 AM, Jim N wrote: >>> Hi, > >> The short answer is you can't - at least, not out of the box. This is >> a feature that has been proposed seve

Revised 1.2 release schedule

2010-03-09 Thread Russell Keith-Magee
Hi all, Those of you that have been paying attention to the Django release roadmap [1] will have noticed that the original estimated release date for Django 1.2 final has passed, but we haven't actually made a final release. Although Django aims to follow a date-based release cycle, we won't make

Re: Adding a new convenience filter 'contains_any'

2010-03-08 Thread Russell Keith-Magee
On Tue, Mar 9, 2010 at 3:24 AM, Phlip wrote: >> > And if the PEP8 told you to ... just jump off a cliff... would you? >> >> Sounds like you might benefit from actually reading it: > > This thread arc is about me lamenting the positive value of style > guides, even those with wrong line-items. > >

Re: Maintaining Continuity (after editing) in the Admin interface?

2010-03-07 Thread Russell Keith-Magee
On Mon, Mar 8, 2010 at 2:24 PM, Derek wrote: > I have noticed that, if a change list has been filtered before a record is > edited, the filter is not restored after the editing operation is complete. > > a. Is there a way to automatically restore the filtered view and, if so, > how? > > b. If ther

Re: v1.2 roadmap - translation string freeze?

2010-03-07 Thread Russell Keith-Magee
On Mon, Mar 8, 2010 at 8:14 AM, Aljosa Mohorovic wrote: > according to http://code.djangoproject.com/wiki/Version1.2Roadmap RC1 > marks translation string freeze, any updates on roadmap? We've been discussing this amongst the core; we should be making some sort of formal announcement shortly, but

Re: Adding a new convenience filter 'contains_any'

2010-03-05 Thread Russell Keith-Magee
On Sat, Mar 6, 2010 at 9:09 AM, Phlip wrote: >> >>> (I also disagree with leaving out the spaces around =, but obviously >> >>> obeying a team style guide supersedes improving it...) >> >> >> ... the goal of clarity/legibility >> >> > uh... >> >> ;)  I meant *having* a style guide was consistent w

Re: Question!!!

2010-03-05 Thread Russell Keith-Magee
On Sat, Mar 6, 2010 at 6:55 AM, Kenny Meyer wrote: > Wilmer A. Delpratt (wdelprat...@gmail.com) wrote: >> Hi everyone..i'm new in this group...my friends says this is one of >> the best groups... >> I'd like to know how i can use a ManyToManyField in a "list_display", >> i've read the documentatio

Re: Fail after upgrade to Django 1.2

2010-03-04 Thread Russell Keith-Magee
On Thu, Mar 4, 2010 at 9:54 PM, eXt wrote: > Hi! > >   I've upgraded my Django to 1.2 (1.2-beta-1, tried also trunk) and > after that my application has started to throw an exception: > ValueError: Cannot add "": instance is on database > "default", value is is on database "None". > > The code cau

Re: Serializing objects with a many-to-many reference

2010-03-03 Thread Russell Keith-Magee
On Thu, Mar 4, 2010 at 1:36 AM, Jim N wrote: > I just came across manager methods in the docs: > > http://docs.djangoproject.com/en/dev/topics/db/managers/#adding-extra-manager-methods > > Could I have used these to create a seriallizable QuerySet, by > defining, say, a with_user() method inside t

Re: Serializing objects with a many-to-many reference

2010-03-02 Thread Russell Keith-Magee
On Wed, Mar 3, 2010 at 12:46 AM, Jim N wrote: > Hi, > > I am writing a question-and-answer app which serializes data in JSON. > I have Question, User, and Asking models.  Asking is the many-to-many > relationship table for Question and User, because the Asking > relationship may be more complicate

Re: Application Name Cannot be the Same as Site Name - is this true?

2010-02-28 Thread Russell Keith-Magee
On Sun, Feb 28, 2010 at 3:33 PM, Anthony wrote: > I've got my app deployed on my production server where the application > name == site name.  (It's running fine.) > > I copied it down to my development machine and tried to set up the > same thing ('python manage.py startapp [appname==sitename]'),

Re: Date fields and Django’s loaddata

2010-02-28 Thread Russell Keith-Magee
On Mon, Mar 1, 2010 at 2:04 AM, Michael Shafrir wrote: > Can a date be loaded into a DateField using Django's loaddata admin > feature? I have a JSON file that I'm using to bulk load data into my > app. When you dumpdata, date fields are outputted in the format - > mm-dd. However, if you try l

Re: fixtures getting created with terminal message prefixed

2010-02-26 Thread Russell Keith-Magee
On Sat, Feb 27, 2010 at 4:07 AM, Joel Stransky wrote: > When ever I create a fixture via dumpdata, I get this text prior to the > start of the data. > > Please select your server identifier. >    1) admin >    2) aws >    3) dipsy >    4) dot >    5) local >    6) sdeng >    7) soup >    8) tomcat

Re: Do fixtures in tests overwrite default model field values?

2010-02-25 Thread Russell Keith-Magee
On Thu, Feb 25, 2010 at 8:43 PM, filias wrote: > Hi, > > I am running several tests and created a fixture with the test data. > I have one model with a custom field which has a default value. > > I thought my test fixture should overwrite this field for some of the > objects but when run the test

Re: Multiple DB in django 1.2

2010-02-25 Thread Russell Keith-Magee
On Fri, Feb 26, 2010 at 2:08 AM, Roach, Marshall (MROACH) wrote: > Hi, I was at pycon last week and heard about the db routers in django 1.2 > and I have the alpha version of django running for a project I’m running and > trying to figure out how to do the following. > > I have 2 databases on diff

Re: Fascism is coming to Internet

2010-02-23 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 10:11 PM, Joan Miller wrote: > *Sorry by this off topic message, but this is too important* I'm sure you're deeply concerned by this issue. For the record, I am too. However, everyone thinks that their pet issue is more important than the rules. Allow me to assure you that

Re: does current aggregation api support counting by month?

2010-02-23 Thread Russell Keith-Magee
On Wed, Feb 24, 2010 at 1:01 AM, Manolis wrote: > Hello, > I have a model like this: > class Report(models.Model): >    date_submitted = models.DateTimeField() > > I want to calculate some aggregate counts per month. The SQL query for > this would be: > SELECT YEAR(date_submitted), MONTH(date_subm

Re: how to get as_sql() to work again

2010-02-22 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 10:42 AM, felix wrote: > > On Feb 23, 12:32 am, Russell Keith-Magee > wrote: > >> To reinforce my point - if you're using Django's ORM, you shouldn't >> have to care about the underlying query. The ORM *should* be >> abstra

Re: how to get as_sql() to work again

2010-02-22 Thread Russell Keith-Magee
On Tue, Feb 23, 2010 at 1:17 AM, felix wrote: > > On Feb 22, 9:22 am, Russell Keith-Magee > wrote: >> > However getting the SQL that will be produced is essential.  There >> > needs to be a utility method somewhere that will give us this sql and >> > it ne

<    5   6   7   8   9   10   11   12   13   14   >