Re: [Django] #30214: Indexes defined on abstract base classes are not propagated to subclasses

2019-02-26 Thread Django
#30214: Indexes defined on abstract base classes are not propagated to 
subclasses
-+-
 Reporter:  wKavey   |Owner:  nobody
 Type:  Bug  |   Status:  closed
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:  invalid
 Keywords:  abstract base class  | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by Tim Graham):

 * status:  new => closed
 * resolution:   => invalid
 * type:  Uncategorized => Bug


Comment:

 Normal Python inheritance rules apply to `Meta` Use:
 {{{
 indexes = CustomBase.Meta.indexes + [
 models.Index(fields=['ip_address'], name='ip_address')
 ]
 }}}

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.4ddd6f65fe656204c1e5c560b22b57c4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Django] #30214: Indexes defined on abstract base classes are not propagated to subclasses

2019-02-25 Thread Django
#30214: Indexes defined on abstract base classes are not propagated to 
subclasses
-+-
 Reporter:  wKavey   |Owner:  nobody
 Type:  Uncategorized|   Status:  new
Component:  Database layer   |  Version:  2.1
  (models, ORM)  |
 Severity:  Normal   |   Resolution:
 Keywords:  abstract base class  | Triage Stage:
 |  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-

Comment (by Simon Charette):

 Does it happen even if you don't define any `CustomSub.Meta.indexes`?

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.4758f6f0f9a9e49abb865059a702d822%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.


[Django] #30214: Indexes defined on abstract base classes are not propagated to subclasses

2019-02-25 Thread Django
#30214: Indexes defined on abstract base classes are not propagated to 
subclasses
-+-
   Reporter:  wKavey |  Owner:  nobody
   Type: | Status:  new
  Uncategorized  |
  Component:  Database   |Version:  2.1
  layer (models, ORM)|
   Severity:  Normal |   Keywords:  abstract base class
   Triage Stage: |  Has patch:  0
  Unreviewed |
Needs documentation:  0  |Needs tests:  0
Patch needs improvement:  0  |  Easy pickings:  0
  UI/UX:  0  |
-+-
 It seems that if I define a model with Meta.abstract=True then any indexes
 I define in that model are not propgated to subclasses.

 Example:
 {{{
 class CustomBase(models.Model):
 id = models.AutoField(primary_key=True)
 name = models.CharField(max_length=100)

 class Meta:
 abstract = True
 indexes = [
 models.Index(fields=['name'], name='name_idx')
 ]

 class CustomSub(CustomBase):
 ip_address = models.GenericIPAddressField()

 class Meta:
 indexes = [
 models.Index(fields=['ip_address'], name='ip_address')
 ]
 }}}

 Then


 {{{
 >> python manage.py makemigrations
 - Create model CustomSub
 - Create index ip_address on field(s) ip_address of model customsub
 }}}

 No mention of index 'name_idx' from the base class

-- 
Ticket URL: 
Django 
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/049.ccb9cb4e278403fc3b3756a4466605d0%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.