#18012: Propagate reverse foreign keys from proxy models to base class
-------------------------------------+-------------------------------------
     Reporter:  Anssi Kääriäinen     |                    Owner:  Simon
         Type:                       |  Charette
  Cleanup/optimization               |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:                       |             Triage Stage:  Ready for
                                     |  checkin
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Ivan):

 {{{
 class Worker(models.Model):

     fio = models.CharField(u'ФИО', unique=True, max_length=250)
     active = models.BooleanField(default=True, help_text="Активный")

     def __str__(self):
         return self.fio

 class WorkerActive(Worker):

     def __str__(self):
         if not self.active:
             return "%s (Не кативен)" % (self.fio,)
         return self.fio

     class Meta:
         proxy = True

 class License(models.Model):
     target_workers = models.ManyToManyField(WorkerActive,
 verbose_name="Покупалась для", blank=True)

     def __str__(self):
         return u"License for %s (%s)" % (self.soft.name, self.number or
 '')

 }}}



 I have error (1054, "Unknown column
 'inventory_license_target_workers.workeractive_id' in 'field list'")
 WHY!?
 I believe that this is a gross error of the concept of using Proxy models

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18012#comment:33>
Django <https://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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.7dc6d164b4d8ced9406123c9f5ca53f8%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to