[Zope] Retrieving the week number with DateTime

2000-08-01 Thread Arjan Scherpenisse

Hello,

i want to retrieve the number of the week from a DateTime object. Is
there any way to do this? I've looked through DateTime.py but i
couldnt find anything usefull, is there some algorithm to get this?

thanks in advance,
-- 
Arjan Scherpenisse
[EMAIL PROTECTED]

may the source be with you
=== http://www.gnu.org ===

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Substracting value from variable?

2000-08-01 Thread Arjan Scherpenisse

Jonathan  <[EMAIL PROTECTED]> wrote:

> Hi all, Is there a way to have a ZSQL Method select the four highest
> values from a list of values in a database? Example:

>   select distinct year from table

> returns the following results

>   1975 1980 1985 1990 1995 2000

> from which I want to select the latest four years:

>   1985 1990 1995 2000

> Possible? Can't seem to find anything in the docs :(

This can be achieved with plain SQL, just alter your query like this:

select distinct year from table order by year limit 4

that will do the trick. Maybe you need 'order by year desc' instead of
just 'order by year' to get the four highest values not the for
lowest, but i'm not sure,

cheers,

-- 
Arjan Scherpenisse
[EMAIL PROTECTED]

may the source be with you
=== http://www.gnu.org ===

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] ZUBB on Zope 2.2 - bug?

2000-08-01 Thread Arjan Scherpenisse

Hi there,

i think ive found a bug in the new ZUBB (0.5.0) on Zope 2.2. After
replying on a topic, it isnt possible anymore to view that posting and
its replies on it. It says:

Error Type: AttributeError
Error Value: 'None' object has no attribute 'created'

And the traceback is:

Traceback (innermost last): 
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 222, in
publish_module 
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 187, in
publish 
File /usr/lib/zope/lib/python/Zope/__init__.py, line 221, in
zpublisher_exception_hook 
(Object: 0003) 
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 171, in
publish 
File /usr/lib/zope/lib/python/ZPublisher/mapply.py, line 160, in
mapply 
(Object: index_html) 
File /usr/lib/zope/lib/python/ZPublisher/Publish.py, line 112, in
call_object 
(Object: index_html) 
File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 167, in __call__
(Object: index_html) 
File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502,
in __call__ 
(Object: index_html) 
File /usr/lib/zope/lib/python/DocumentTemplate/DT_Util.py, line 337,
in eval 
(Object: item_index_html(_.None, _)) (Info: _) 
File lt;stringgt;, line 0, in ? 
File /usr/lib/zope/lib/python/OFS/DTMLMethod.py, line 163, in __call__

(Object: item_index_html) 
File /usr/lib/zope/lib/python/DocumentTemplate/DT_String.py, line 502,
in __call__ 
(Object: item_index_html) 
File /usr/lib/zope/lib/python/TreeDisplay/TreeTag.py, line 155, in
render 
(Object: a tree tag) 
File /usr/lib/zope/lib/python/TreeDisplay/TreeTag.py, line 261, in
tpRender 
(Object: 0003) 
File /usr/lib/zope/lib/python/TreeDisplay/TreeTag.py, line 347, in
tpRenderTABLE 
(Object: 0003) AttributeError: (see above)

I hope this is useful,

cu,
-- 
Arjan Scherpenisse
[EMAIL PROTECTED]

may the source be with you
=== http://www.gnu.org ===

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




[Zope] Calender Tag & SQL caching

2000-07-30 Thread Arjan Scherpenisse

Hi everybody,

This is my first posting to this list. I have a website which will
make use of a calender, with events on it stored in a MySQL
database. Now, i wondered how to efficiently show this data from the
database in the calender. I mean, not in a way that a sql query is
made for each day on the calender (which would make up to 31 queries
in the Calender Tag 'month' view...)

So i wondered, is there some way to 'cache' the result of the SQL
method, so that i can use just one query to fill up an entire month,
for instance?

regards,
-- 
Arjan Scherpenisse
[EMAIL PROTECTED]

may the source be with you
=== http://www.gnu.org ===

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )