Extend Flatpages

178 views
Skip to first unread message

Pablo Camino Bueno

unread,
Jun 14, 2017, 8:00:44 AM6/14/17
to django-oscar
Hello, 

I'm using django.contrib.flatpages to handle dynamic html pages. How can I extend the Page model to include a new attribute? 

I need to set if the link to those pages is shown on top or footer navbar.

carlos

unread,
Jun 14, 2017, 10:29:54 AM6/14/17
to django-oscar
i thing you need create your app with relations one to one for flatpages
like that

class YourClase(models.Model):
    flatpage = models.OneToOneFields(FlatPages)
    oherfieldyouneed = bla bla bla
    oherfieldyouneed = bla bla bla
    oherfieldyouneed = bla bla bla
    ...

Cheers


--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/django-oscar.
To view this discussion on the web, visit https://groups.google.com/d/msgid/django-oscar/908603d3-3312-4e38-81ac-04e79074738f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha

Pablo Camino Bueno

unread,
Jun 15, 2017, 3:49:13 AM6/15/17
to django-oscar
Yes, I guess that would do the trick, but I'd rather add the field to the page model instead of creating a new DB table. Is there a way?

Thanks


El miércoles, 14 de junio de 2017, 16:29:54 (UTC+2), Carlos Rocha escribió:
i thing you need create your app with relations one to one for flatpages
like that

class YourClase(models.Model):
    flatpage = models.OneToOneFields(FlatPages)
    oherfieldyouneed = bla bla bla
    oherfieldyouneed = bla bla bla
    oherfieldyouneed = bla bla bla
    ...

Cheers

On Wed, Jun 14, 2017 at 6:00 AM, Pablo Camino Bueno <p.cam...@gmail.com> wrote:
Hello, 

I'm using django.contrib.flatpages to handle dynamic html pages. How can I extend the Page model to include a new attribute? 

I need to set if the link to those pages is shown on top or footer navbar.

--
https://github.com/tangentlabs/django-oscar
http://django-oscar.readthedocs.org/en/latest/
https://twitter.com/django_oscar
---
You received this message because you are subscribed to the Google Groups "django-oscar" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar...@googlegroups.com.



--
att.
Carlos Rocha

carlos

unread,
Jun 15, 2017, 10:26:19 AM6/15/17
to django-oscar
noup, actually you see https://github.com/django/django/blob/master/django/contrib/flatpages/models.py
is normal model not abstract model like user. but you create new table and overwrite admin and put the new fields in inline
or fork django and change the model flatpages and used you django fork

cheers

To unsubscribe from this group and stop receiving emails from it, send an email to django-oscar+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
att.
Carlos Rocha
Reply all
Reply to author
Forward
0 new messages