#27317: Form.Media inheritance
----------------------------+--------------------
     Reporter:  James Pic   |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Forms       |    Version:  1.10
     Severity:  Normal      |   Keywords:
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+--------------------
 I wanted to define a mixin to use with Form classes that would add extra
 JS. So, I tried how Form.Media would behave with inheritance, and it turns
 out they don't merge. For example:

 {{{
 class A(Form):
     class Media:
         js = ('jquery.js', 'a.js')

 class B(Form):
     class Media:
         js = ('jquery.js', 'b.js')

 class C(A, B):
     pass
 }}}

 I expected:

 {{{
 C.Media.js == ('jquery.js', 'a.js', 'b.js')
 }}}

 But that results instead in:

 {{{
 C.Media.js = ('jquery.js', 'a.js')
 }}}

 Eventually, I wanted to push it a bit further and use a Mixin, having
 exactly the same but with `A(object)` instead of `A(Form)`.

 Can I work on a patch for this ?

 Thanks for your support

--
Ticket URL: <https://code.djangoproject.com/ticket/27317>
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/047.ce175aa71ce2bc0169398d3018d48f66%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to