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: 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

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