James Bennett wrote: > On 12/12/05, Radek Svarz <[EMAIL PROTECTED]> wrote: > >>very nice proposal. but please avoid pluralization. it is very odd in other >>languages than English. > > > I think pluralization is something to be dealt with elsewhere; so long > as this takes advantage of module_name, verbose_name and/or > verbose_name_plural (which I assume it will do) it should be OK for > now, and then if/when a decision is finally reached about how/whether > to handle pluralization, it can be modified if needed. > > -- > "May the forces of evil become confused on the way to your house." > -- George Carlin >
I was thinking about this - it may be better to do it in the following way: ..eliding other fields.. class Reporter(meta.Model): articles = meta.Collection('Article','reporter') class Articles(meta.Model): reporter = meta.ForeignKey(Article) So meta.Collection (could have a better name...) would be the descriptor at the other end of the relationship. This is explicit. As we also want to be able to add things to classes we don't want to modify the source of, (eg auth.User) class Item(meta.Model): user = meta.ForeignKey(auth.User) auth.User.items = meta.Collection(Item.user) So the meta.Collection would either take a foreign key, or a class name and attribute name that identifies it. If an explicit 'end point' is not found, we could also still add default related descriptors, with a non-pluralised name - eg auth.User would get a Collection called auth.User.item_collection. However, not doing this automated adding would be an advantage - the django.models import hook is not going to work with the new models scheme anyway. Maybe the best thing would be a function, auto_connect_collections() that gets called in the base handler, and can be turned off in settings.