Changes between Initial Version and Version 1 of Ticket #25486


Ignore:
Timestamp:
Sep 30, 2015, 5:17:04 PM (9 years ago)
Author:
Tim Graham
Comment:

This seems to be a regression in 1.8 and a duplicate of #24505 (bisected to fb48eb05816b1ac87d58696cdfe48be18c901f16 and fixed subsequently fixed in 4ee08958f154594b538207a53c1d457687b3f7ae). I'll backport that fix to 1.8.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25486

    • Property Resolutionduplicate
    • Property Status newclosed
  • Ticket #25486 – Description

    initial v1  
    3232#!python
    3333class Contact(models.Model):
     34    first_name = models.CharField(blank=True, max_length=50)
     35    last_name = models.CharField(blank=True, max_length=50)
    3436
    35         first_name = models.CharField(blank=True, max_length=50)
    36         last_name = models.CharField(blank=True, max_length=50)
    37 
    38         class Meta:
    39                 ordering = ('last_name','first_name')
    40 
    41         pass
     37    class Meta:
     38        ordering = ('last_name', 'first_name')
    4239
    4340class Dealer(models.Model):
    44 
    45         contacts = models.ManyToManyField('Contact', through='DealerContact', related_name='dealers')
    46        
    47         name = models.CharField(db_index=True, max_length=250)
    48 
    49         pass
     41    contacts = models.ManyToManyField('Contact', through='DealerContact', related_name='dealers')
     42    name = models.CharField(db_index=True, max_length=250)
    5043
    5144class DealerContact(models.Model):
     45    dealer = models.ForeignKey('Dealer', related_name='dealercontacts+', on_delete=models.CASCADE)
     46    contact = models.ForeignKey('Contact', related_name='+', on_delete=models.CASCADE)
     47    roles = models.ManyToManyField('Role', through='DealerContactRole', related_name='+')
    5248
    53         dealer = models.ForeignKey('Dealer', related_name='dealercontacts+', on_delete=models.CASCADE)
    54         contact = models.ForeignKey('Contact', related_name='+', on_delete=models.CASCADE)
    55         roles = models.ManyToManyField('Role', through='DealerContactRole', related_name='+')
    56 
    57         class Meta:
    58                 unique_together = ('dealer','contact')
    59 
    60         pass
     49    class Meta:
     50        unique_together = ('dealer', 'contact')
    6151
    6252class DealerContactRole(models.Model):
     53    dealercontact = models.ForeignKey('DealerContact', related_name='+', on_delete=models.CASCADE)
     54    role = models.ForeignKey('Role', related_name='+')
    6355
    64         dealercontact = models.ForeignKey('DealerContact', related_name='+', on_delete=models.CASCADE)
    65         role = models.ForeignKey('Role', related_name='+')
    66 
    67         class Meta:
    68                 unique_together = ('dealercontact','role')
    69 
    70         pass
     56    class Meta:
     57        unique_together = ('dealercontact', 'role')
    7158
    7259class Role(models.Model):
     60    name = models.CharField(db_index=True, max_length=100)
    7361
    74         name = models.CharField(db_index=True, max_length=100)
    75 
    76         class Meta:
    77                 ordering = ('name',)
    78 
    79         pass
     62    class Meta:
     63        ordering = ('name',)
    8064}}}
Back to Top