Customize flatpage

313 views
Skip to first unread message

galago

unread,
Feb 11, 2011, 3:35:31 PM2/11/11
to django...@googlegroups.com
I found that link: http://linfiniti.com/2011/01/bending-django-flatpages-to-your-will. I want to make some customization in flatpage. Where should I put this extra module and form?
I want to add 2 fields to custom flatpage.

Andres Lucena

unread,
Feb 13, 2011, 6:11:15 AM2/13/11
to django...@googlegroups.com

You can put it everywhere in your project, I think the best would be
putting it in app_name/models.py (or creating another app just for the
flatpage); then you have to referenciate it in the app_name/admin.py, in
the line:

from models import ExtendedFlatPage

Would be

from app_name.models import ExtendedFlatPage

Good luck,
Andres

galago

unread,
Feb 13, 2011, 7:02:44 AM2/13/11
to django...@googlegroups.com
Should I alternate original flatpage midddleware?
If I won't do that, my new fields can be unseen?

Andres Lucena

unread,
Feb 13, 2011, 2:18:36 PM2/13/11
to django...@googlegroups.com
El dom, 13-02-2011 a las 04:02 -0800, galago escribió:
> Should I alternate original flatpage midddleware?
> If I won't do that, my new fields can be unseen?

No, you don't have to change the middleware.

AFAIK the middleware [0] the only thing it does is capture the 404 and
try to get the flatpage.

Also check this stack overflow question [1], I think is what you're
trying to do.


[0]
http://code.djangoproject.com/browser/django/trunk/django/contrib/flatpages/middleware.py

[1]
http://stackoverflow.com/questions/1021487/add-functionality-to-django-flatpages-without-changing-the-original-django-app

Good luck,
Andres

Reply all
Reply to author
Forward
0 new messages