#2363: [patch] Tighten subclass check at top of
db.models.base.ModelBase.__new__.
--------------------------------------+-------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: mtredinnick
Status: reopened | Component: Core framework
Version: | Resolution:
Keywords: | Stage: Ready for checkin
Has_patch: 1 | Needs_docs: 0
Needs_tests: 0 | Needs_better_patch: 1
--------------------------------------+-------------------------------------
Changes (by [EMAIL PROTECTED]):
* status: closed => reopened
* needs_better_patch: 0 => 1
* resolution: fixed =>
Comment:
Checking on name == "Model" is even 'hackisher' IMHO.
I have a Model named Model.. This check doesn't take the difference
between django.db.models.Model and project.app.models.Model in account and
django.db.models.ForeignKey(Model) breaks.
{{{
#!python
from django.db import models
class Measures(models.Model):
top = models.IntegerField()
waist = models.IntegerField()
hip = models.IntegerField()
def is_major_turnon():
import random
return random.choice((True, False)) #Mind over matter ;)
class Model(models.Model):
name = models.CharField(maxlength=25)
measures = models.ForeignKey(Measures)
class AmericasTopModel(models.Model):
season = models.IntegerField()
model = models.ForeingKey(Model)
def program_sucks():
return True
}}}
This is not my real app, just some witty example. My real app records
devices and their makes and models.
--
Ticket URL: <http://code.djangoproject.com/ticket/2363#comment:5>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---