Jan Hackel wrote:
> Tim Hicks wrote:
> 
>> Jan Hackel wrote:
>>>> #142 [...]
>>> It would probably be best to prevent weblog entry to get an id that could
>>> break the archive, for instance by adding a prefix to those ids.
>> Yeah, that sounds reasonable - although I'm not sure how to implement
>> this.  Is there some sane way of hooking into the AT auto-naming
>> process?  I think we have INameChooser (or some such) now.  That sounds
>> like the way forward.  Still, it would seem to pose more of a problem
>> for QuillsEnabled as we would want to change the behaviour of non-quills
>> objects.  I'm not sure how hard that would be.
> 
> Archetypes provide the generateNewId method for that purpose. I have a fix
> for Quills (not Enabled) almost ready, but somehow broke the test-case when
> cleaning the patch. I commit it soon, I hope.
> 
> For QuillsEnabled, I suppose a Zope Moved Event might be fired on rename. So
> we might have to hook those. It will be not as nicely localized and not
> very robust (suppose another event-handler tries the same).

Is it legitimate to do a(nother) rename on an object from the handler 
for a moved event?  My suspicion is that implementing an INameChooser 
would be the more appropriate way forward here.

>>>> #143 ...
>>> I am pretty sure that they do not show up, because the "available"
>>> operation answers "False" on empty blogs. This is due to two reasons: a)
>>> the way IWeblogLocator.find is specified: return an empty list, if no
>>> Weblog cannot be found. And b) an empty weblog is interpreted by Python
>>> as an empty sequence (hence False). I see a few ways to fix this, but the
>>> most promising is to make the empty weblog not to appear as an empty
>>> sequence. Is there a way to hook into "bool(...)" in Python?
>> I'm not sure I understand fully, but changing the return value of
>> bool(a_weblog_that_is_empty) to True doesn't sound quite right.  It
>> seems like we have the answer to the question that we want from
>> IWeblogLocator.find already.  If the return value is an empty list, we
>> know that there is no weblog available - not that a weblog was found and
>> then found to be empty.  It sounds like some code fragment in the
>> portlet(s) needs to be adjusted accordingly.  No?
> 
> The problem is not with the locator but with Python interpreting a Weblog
> object with no published entries as False (empty tuple) in boolean
> expressions. Is there a reason why the locator returns an empty list
> instead of None when there is no Weblog?

Can you point to the line(s) of code that exhibit the problem?  I still 
don't quite understand why bool(a_weblog_that_is_empty)==False is 
causing difficulties.


Tim
_______________________________________________
quills-dev mailing list
[email protected]
http://lists.etria.com/cgi-bin/mailman/listinfo/quills-dev

Reply via email to