On Jun 21, 2006, at 4:49 PM, Malcolm Tredinnick wrote: > What are the use cases for this sort of construction? > [...]
I've always thought that any decent computer tool should either a) do what you tell it to, or b) tell you why it can't/won't do what you want it to (warnings, exceptions, etc.). I don't think we should be second-guessing developers. If we don't want to allow developers to do something, we should tell so, at the very least. However, in this case, there *are* valid reasons for having an "empty" model. See my example in the thread start. (Of course, it's not *actually* empty, it has a "one-to-many" relationship with a child model, but those sorts of relationships must actually be defined as a ForeignKey in the child model, thus leaving Mama model empty.) And regardless of any use cases, I don't think we should assume that no one will ever want to do something, because chances are that people will, and for good reasons. > [...] > For this reason, > I would be in favour of just creating the class in the database and > not > issuing an error. On the grounds, that it gets the framework out of > the > way of the developer and lets them get on with their preferred > method of > working. This is my preferred choice, as well, but I'm not well-versed enough in the internals of Django to know if allowing empty models can create other problems outside of the admin interface. If anyone could point me to the relevant areas of code (i.e. where in Django's code does it determine if a model shouldn't be created because it's empty, etc.), I'd be happy to take a crack at a patch or two to give these ideas a shot. > [...] Thanks for the input! -Tyson --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers -~----------~----~----~----~------~----~------~--~---