[quills-dev] Re: Entry description generated automatically
Tim Hicks tim at sitefusion.co.ukMon Dec 18 10:47:54 UTC 2006
- Previous message: [quills-dev] Re: Entry description generated automatically
- Next message: [quills-dev] Re: Entry description generated automatically
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Reinout van Rees wrote:
> Tim Hicks wrote:
>
>> There is also the issue with this approach surrounding how to handle the
>> existing 'desciption' (aka 'excerpt') AT field that needs to be
>> resolved. I mean, the field probably should not get displayed in the
>> edit view when IWeblogEntrySummariser.getSummary() is just going to
>> ignore it.
>
> His original code had a check "is there a regular summary: use it if
> available", so that's ok. Keep the regular description field by all
> means for all those people who really use it (like myself).
Yes, we should certainly keep the 'description' field for the default type.
> One thing to watch out for: If it is the same as the beginning of the
> real text, we'll soon start hearing wishes for the removal of the
> excerpt/description from the views "as it is just a duplication". Which
> is a no-no if there's a *real* description.
Yes. In my pseudo-code, I was imagining something like the following:
class IWeblogEntrySummariser(Interface):
def getSummary():
"""Return summary of body for self.context. This could be
self.context.Description(), or some manipulation (with, say, Haystack)
or self.context.getText(), or..."""
def isDescriptionRequired():
"""Return True if self.context.Description() is expected to return
something meaningful for self.getSummary(), False otherwise."""
We would then add the following to WeblogEntry:
def isDescriptionRequired(self):
return IWeblogEntrySummariser(self).isDescriptionRequired()
and add a condition on the AT 'description' field's visibility that
context.isDescriptionRequired() is True.
Does that make sense? Is it sensible?
> => Try to keep it all a bit separate and don't try to override or work
> against core plone behaviour. That'll bite you.
That sounds like a reasonable principle. But what does it mean in
practice? My interpretation of the principle was one reason why I
prefer that we use the 'getExcerpt' method, rather than 'Description' as
it makes it more justifiable to change this to our preferred behaviour.
However, I can see the principle working in the opposite way: we should
use 'Description' because that's what Plone expects.
> Andrey: what's your core aim with this? Any specific location where you
> want your auto-generated description to end up? Some template? The atom
> feed? Or just in the description field for use in plone's search
> mechanism? Is it quills-specific or do you really intend it for
> plone-as-a-whole?
That's a good question.
Tim
- Previous message: [quills-dev] Re: Entry description generated automatically
- Next message: [quills-dev] Re: Entry description generated automatically
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the quills-dev mailing list