[pyar] DJango 1.8 Models.

Angel Freire cuerty en gmail.com
Mar Jul 14 17:25:02 ART 2015


2015-07-12 20:57 GMT-03:00 Martín Gaitán <gaitan en gmail.com>:

> 2015-07-12 20:44 GMT-03:00 Esteban Castro <ecastroborsani en gmail.com>:
>
>> Podes hacerlo con herencia[0] o explicitamente con un campo OneToOneField
>> en PaginaEspecial.
>>
>> [0]
>> https://docs.djangoproject.com/en/1.8/topics/db/models/#multi-table-inheritance
>>
>
>
> La herencia en django puro no permitiria obtener un queryset heterogeneo,
> que mezcle "Pagina" y "PaginaEspecial" segun corresponda.
>
> Este comportamiento sí se logra con un manager especial que viene en
> django-model-utils
>
>
> https://django-model-utils.readthedocs.org/en/latest/managers.html#inheritancemanager
>
> saludos
>
>
> --
> mgaitan.github.io
> textosypretextos.com.ar
>
> _______________________________________________
> pyar mailing list pyar en python.org.ar
> http://listas.python.org.ar/listinfo/pyar
>
> PyAr - Python Argentina - Sitio web: http://www.python.org.ar/
>
> La lista de PyAr esta Hosteada en USLA - Usuarios de Software Libre de
> Argentina - http://www.usla.org.ar
>

No sabia que esto estaba incluido en django-model-utils. Muy buena
información. ¡Se agradece!

-- 
http://blog.cuerty.com

"If you want to set off and go develop some grand new thing, you don't need
millions of dollars of capitalization. You need enough pizza and Diet Coke
to stick in your refrigerator, a cheap PC to work on and the dedication to
go through with it."
- John Carmack
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://listas.python.org.ar/pipermail/pyar/attachments/20150714/89ae39d9/attachment.html>


More information about the pyar mailing list