InlineAdminFormSet in django.contrib.admin.helpers

2010-06-09 Thread shaunc
I'm wondering why the "model_admin" for an inline formset is the parent model_admin, and not the inline model admin? Given that the inline admin is passed as "inline", and stored as "opts" in the in InlineAdminFormSet, I'm wondering if "opts" needs to be passed in the "model_admin" slot to subobjec

proposal: Relation in ContentType framework

2010-06-19 Thread shaunc
I'm wondering if there is any community interest in adding a model of relations in the ContentType framework? We had many Institutions in our database that represented the same object. I wrote an add-on to the admin changelist to merge institutions. I tried to write the merge in a general way; it

Re: proposal: Relation in ContentType framework

2010-06-20 Thread shaunc
On Jun 20, 3:54 am, Russell Keith-Magee wrote: > On 20/06/2010, at 12:19 PM, shaunc wrote: > > > I'm wondering if there is any community interest in adding a model of > > relations in the ContentType framework? > > > We had many Institutions in our database that

bug? missing foreign key constraints in SQL

2006-05-20 Thread shaunc
of ALTER TABLESs can be generated in this situation, where we might need more than one. Thanks for help or tips if I'm doing something wrong - Shaun X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.11.53.63 with SMTP id b63mr87424cwa; Sat, 20 May 2006 10:44:03 -0700 (PDT) X-Go

Re: bug? missing foreign key constraints in SQL

2006-05-20 Thread shaunc
Ok django.core.management:108: - pending_references.update(references) - needs to be replaced by something like: -

Re: bug? missing foreign key constraints in SQL

2006-05-20 Thread shaunc
: ENGLISH,ASCII-7-bit Received: by 10.11.53.63 with SMTP id b63mr91252cwa; Sat, 20 May 2006 15:16:59 -0700 (PDT) X-Google-Token: JSn_Zgw9TQu1BeNkqq3dTJht7_VU Received: from 66.92.72.228 by j55g2000cwa.googlegroups.com with HTTP; Sat, 20 May 2006 22:16:59 + (UTC) From: "s

aggregate field types

2006-05-20 Thread shaunc
-- In database, will have name_last, and name_first fields generated. X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.11.88.14 with SMTP id l14mr31623cwb; Sat, 20 May 2006 22:40:03 -0700 (PDT) X-Google-Token: JSgsFgwAAABEMmN3KIpV7PvK92So1gxc Rece

inserting aggregates in one transaction

2006-05-29 Thread shaunc
Hello, I tried using @transaction.commit_on_success to insert an object whose pieces are in (sub)tables. Conceptually, this should all be part of one transaction. However, django doesn't have the new id available, and so the operation fails (it tries to use "null" for the foreign key in the subt

Re: .delete() a little too eager?

2006-05-29 Thread shaunc
Ah - I just asked the group about a related issue: creating "wholes" in one transaction. Support for specification of part/whole relationships would be useful both for creati

proposal: model of ForgienKeyField available via model where defined

2006-06-20 Thread shaunc
Currently, if I have: --- class A( Model ): pass class B( Model ): a = ForeignKey( A ) a = A() b = B( b = a ) --- Then b.a gets a, and b.a.model returns A. However, if I just have "B", I think B.a should return A (right now

Re: proposal: model of ForgienKeyField available via model where defined

2006-06-20 Thread shaunc
On these same lines, it is more generally a pain to do introspection. For instance, if I want to know to what field ForeignKeyField "foo" of model "Bar" refers to, I can find out with: Bar._meta_get_field( 'foo' ).rel.field_name But this is certainly not intuitive, and presumably subject to

Re: proposal: model of ForgienKeyField available via model where defined

2006-06-20 Thread shaunc
(sorry for monolog...) Careful readers might note that my two suggestions might conflict. Bar.foo If it returns the ForeignKeyField object (or some proxy for it), cant return the model referred to. Maybe best (something like): Bar.foo.related_model to get related model; Bar.foo would t

Re: Empty models don't get created (#1972)

2006-06-22 Thread shaunc
If you really want an "empty" model -- but with a primary key, you could define an "auto" field and delcare it to be the primary key. This would give you in the DB the exact same thing as an empty model would. One use case is implementing object inheritance in DB. One overall "base" model is real

Shouldn't base Field.validate check explicitly set validators in validator_list?

2006-09-27 Thread shaunc
I believe the following code should print "FOO", but it doesn't. This seems to be because django.db.models.fields.Field.validate does nothing (and IntegerField doesn't override this). I'd think that Field.validate should at least call explicitly set validators. (Best, perhaps, would be for it to

related object descriptor incorrectly returns

2006-11-11 Thread shaunc
In django.db.models.fields.related.SingleRelatedObjectDescriptor?, The code for __get__: def __get__(self, instance, instance_type=None): if instance is None: raise AttributeError, "%s must be accessed via instance" % self.related.opts.object_name params = {'%s__pk

Re: related object descriptor incorrectly returns

2006-11-12 Thread shaunc
> We do that, actually. If you take the time to supply a name and email > address, it exponentially decreases the spam weight of the submission. > Well, in "your email or username" I entered my email. (I get confused: presumably I don't have a "django" username, or is it my username here at goo

Re: related object descriptor incorrectly returns

2006-11-13 Thread shaunc
> > Well, in "your email or username" I entered my email. (I get confused: > > presumably I don't have a "django" username, or is it my username here > > at google groups?) > > It's in the "settings" link at the bottom of the page. Ah...settings link?... there it is(!)... I must say, that's a bi

RadioFieldRenderer support for __getitem__?

2006-11-14 Thread shaunc
"__getitem__" in django.forms.__init__.RadioSelectField.render.RadioFieldRenderer In this inner class (line 546), I have found it useful to have: def __getitem__( self, item ): return self.datalist[ item ] Then I can put some commentary (say) in the html, and explici

Re: why not a http server like mongrel?

2006-11-14 Thread shaunc
One reason (in my opinion) for an effort on a server would be to use non-blocking i/o. You'd want to also use non-blocking i/o on the database side as well. Has anyone thought about that for django? --~--~-~--~~~---~--~~ You received this message because you are

MEDIA_ROOT for testing

2007-06-14 Thread shaunc
I'm currently migrating my testing to the new testing framework. Generally, very nice -- especially interaction with fixtures. One thing though: what about media? It would be nice to be able to have a TEST_MEDIA_ROOT which was cleaned and/or given some predefined content to go with various db ob

is "nodelist" a magic member of django.template.Node?

2007-09-29 Thread shaunc
I have the following templatetag code to display differently based on whether a field is hidden: @register.tag def ifdisplayed( parser, token ): contents = token.contents.split() fieldName = template.Variable( contents[ 1 ] ) yesnodes = parser.parse( ( 'endifdisplayed', 'else' ) )

Re: is "nodelist" a magic member of django.template.Node?

2007-09-29 Thread shaunc
> > Also: in the future, please post questions like this to the django-users list. > I'm sorry, I should have known that... since I've started, I'll follow up here too, though, as doubling msg doesn't seem worthwhile. > As far as I know, you can't conditionally define a block -- in other > words,