My slightly graceless method is to override .save and .delete:
http://groups.google.com/group/django-developers/browse_frm/thread/2caa976249783fae/#
Then whatever model you define, it can only ever have one row (well, it
will have zero rows before you put anything it).
Barry
--~--~-~-
Thanks for the input guys. I'm kind of approaching this from a client
perspective, so was fishing around for the simplest use case from an
inexperienced admin user's point of view.
The suggestions of using a Page and "chunk" schema makes perfect
sense, and a quick Google threw up a good example[
As James and Fredrik have implied, I believe the proper solution here
is to abstract things enough so that you *can* map the concept to a
relational database; in this case, assuming that every 'Page' has an
identifier, a 'Title' and, perhaps, multiple 'Sections' (each with an
identifier and text),
Phil Powell wrote:
> Perhaps I've not explained myself properly. Here's an example:
>
> I have a "Homepage" which has fields such as "Page Title",
> "Introduction Text", "Footer Text" etc. I want to be able to edit
> these fields just like I'd edit a standard model instance, but because
> ther
On 12/4/06, Phil Powell <[EMAIL PROTECTED]> wrote:
> I have a "Homepage" which has fields such as "Page Title",
> "Introduction Text", "Footer Text" etc. I want to be able to edit
> these fields just like I'd edit a standard model instance, but because
> there is only one instance of my "Homepage
On 04/12/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> I'm not sure I get how a singleton would solve the "pages generated from
> multiple chunks" problem.
>
> why not just use a model that holds (pagename, chunkname, chunk data)
> triplets, and use a view that brings up all the chunks for a give
Phil Powell wrote:
> I want to have a series of pages, with certain areas of content which
> are editable. I don't want to use flatpages, as I'd like the editable
> content to be broken down into chunks, rather than one big lump of
> content.
>
> Is there a way to easily set a model to have one
7 matches
Mail list logo