Re: [Zope] Python Scripts

2005-06-16 Thread Greg Fischer
Yeah, I do see that every once in a while.  I have a very simple
script, that looks perfect, but will always return "syntax error".  I
copied the text, pasted into a text editor and checked all the indents
and tabs, then recreated the script.  Problem went away.

What was interesting is that I didnt change the code.  And even
thought the indents were the same, re-adding them might have solved
it.  Dont know for sure, but I dont see this enough to cause me
problems.

Greg

On 6/16/05, J Cameron Cooper <[EMAIL PROTECTED]> wrote:
> > We have been seeing a number of instances where python scripts fail
> > due to an apparent "syntax error" but the syntax is correct and simply
> > storing the method restores it to functionality.   Anyone else seeing
> > this?
> 
> How do you mean "fail"?
> 
> Often times, if you have an error, save, test, and then use the back
> button, you'll see the old syntax error, even though the contents are
> the new (and correct) version.
> 
> If you just revisit the script (click on the id in the breadcrumbs) the
> message will go away.
> 
> --jcc
> --
> "Building Websites with Plone"
> http://plonebook.packtpub.com
> ___
> Zope maillist  -  Zope@zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )
> 


-- 
Greg Fischer
1st Byte Solutions
http://www.1stbyte.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-16 Thread Andreas Pakulat
On 16.Jun 2005 - 23:17:43, Jim Vine wrote:
> Specifically, I've been scratching my head for a while
> about how to handle a many-many relationship: a
> property owner may own more than one house;
> conversely, a house may have more than one co-owner -
> consequently it's not appropriate to have either
> containing the other. I've googled for general
> information about handling many-many relationships in
> OO, and most of what I've come across has only
> indicated that it can be tricky!

Hmm, what I would start with is an attribute for a house containing a
list of references to owners. And vice versa, each owner has a list of
references to houses. Now in Zope references could be implemented via
storing the URL of the house and references to Users could be stored via
the username (the one the user uses to log in). 

> While I?m on, I?ve noticed that Zope 3 has been
> released. Is this now the recommended development
> environment, or am I better off sticking with Zope 2
> for now, and porting my application once Zope 3 is a
> bit further down the line?

Read the archive, short answer is:

If you depend only on Zope, you don't want TTW and you want to write a
file based product: Zope3 would be possible

If you need some existing products or if you need TTW-Code, then you
have to stick to Zope2

Andreas

-- 
You're ugly and your mother dresses you funny.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-16 Thread Lennart Regebro
On 6/17/05, Jim Vine <[EMAIL PROTECTED]> wrote:
> I'm very interested in the Object Oriented way of
> doing things; for example, I'm thinking about
> implementing houses as a folder-ish object, so it
> would be able to contain photos of the house in
> question. The biggest stumbling block I am facing is
> how to do something "Relational" in an OO environment.
> Specifically, I've been scratching my head for a while
> about how to handle a many-many relationship: a
> property owner may own more than one house;
> conversely, a house may have more than one co-owner -
> consequently it's not appropriate to have either
> containing the other. I've googled for general
> information about handling many-many relationships in
> OO, and most of what I've come across has only
> indicated that it can be tricky!

Nah. You either let every PropertyOwner have a list of the ids of
HouseProperty objects, or the other way around. Then you index this is
the catalog so you can search. Tada!

> Having a look through past threads on this mailing
> list I've noticed a few references to mxmRelations
> (http://www.zope.org/Members/maxm/products/mxmRelations)
> which seems to match up - have I got the right end of
> the stick? 

Relation products often are aimed at making arbitrary relations
between different objects. it's cool, and useful. It may be overkill
in this case, unless you want to for example have different types of
owners. Then it fits perfectly.

http://zemantic.org/ Is the relations tool that seems to emerge as the
preferred one in the zope3 environment.

> While I'm on, I've noticed that Zope 3 has been
> released. Is this now the recommended development
> environment, or am I better off sticking with Zope 2
> for now, and porting my application once Zope 3 is a
> bit further down the line?

For applications development, zope3 is definitely recommended. Zope2
is only recommended if you you want to use a CMS application, like
Plone, CPS, or something else. There isn't one for zope3 yet.

-- 
Lennart Regebro, Nuxeo http://www.nuxeo.com/
CPS Content Management http://www.cps-project.org/
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-16 Thread Max M

Jim Vine wrote:


Having a look through past threads on this mailing
list I've noticed a few references to mxmRelations
(http://www.zope.org/Members/maxm/products/mxmRelations)
which seems to match up - have I got the right end of
the stick? Before I jump in with this I'd appreciate
any advice or guidance you could provide - it'd be
greatly appreciated.


Use Plone and references instead ;-)


--

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Newbie Questions - many-many relationships? Zope 2 or 3?

2005-06-16 Thread Jim Vine
Database Question


Hello,

I'm a newbie, so this is a newbie question!

I am currently preparing to build a web application
for property lettings, and I'm very interested in what
Zope has to offer. The application will need to
recognise a number of different objects, such as
"houses", "prospective tenants" and "property owners"
(the latter of which I may implement as user types,
which would allow these people to log in and amend
some of their own information.)

I'm very interested in the Object Oriented way of
doing things; for example, I'm thinking about
implementing houses as a folder-ish object, so it
would be able to contain photos of the house in
question. The biggest stumbling block I am facing is
how to do something "Relational" in an OO environment.
Specifically, I've been scratching my head for a while
about how to handle a many-many relationship: a
property owner may own more than one house;
conversely, a house may have more than one co-owner -
consequently it's not appropriate to have either
containing the other. I've googled for general
information about handling many-many relationships in
OO, and most of what I've come across has only
indicated that it can be tricky!

Having a look through past threads on this mailing
list I've noticed a few references to mxmRelations
(http://www.zope.org/Members/maxm/products/mxmRelations)
which seems to match up - have I got the right end of
the stick? Before I jump in with this I'd appreciate
any advice or guidance you could provide - it'd be
greatly appreciated.

While I?m on, I?ve noticed that Zope 3 has been
released. Is this now the recommended development
environment, or am I better off sticking with Zope 2
for now, and porting my application once Zope 3 is a
bit further down the line?

I?d greatly appreciate any guidance that can be
provided on these subjects.

Thanks in advance,
Jim






___ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail 
http://uk.messenger.yahoo.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread Tino Wildenhain
Am Donnerstag, den 16.06.2005, 22:33 +0100 schrieb John Poltorak:
> On Thu, Jun 16, 2005 at 08:30:15PM +0200, Andreas Jung wrote:
> > 
> > 
> > --On 16. Juni 2005 19:15:58 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:
> > 
> > >
> > > I've just put together a simple Zope website, but whilst it renders
> > > properly under Firefox, it looks dreadful using IE.
> > >
> > > Can anyone explain why? Could it be the CSS?
> > 
> > It could be your IE? It could be your HTML? It could be your CSS?
> 
> I was advised to change 
> 
>  
> 
> to 
> 
> http://www.mysite.org/"; /> 
> 
> and that seemed to sort out most of the problems.
> 
> Do I really need to hard code the site name like this, or is there some 
> variable I can use?

request has a lot URL variables you can use.
However zope usually does the right thing [tm]
here - you should just design your links
carefully. E.g. use root-relative, that means
links that start with / all the time.



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


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread John Poltorak
On Thu, Jun 16, 2005 at 08:30:15PM +0200, Andreas Jung wrote:
> 
> 
> --On 16. Juni 2005 19:15:58 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:
> 
> >
> > I've just put together a simple Zope website, but whilst it renders
> > properly under Firefox, it looks dreadful using IE.
> >
> > Can anyone explain why? Could it be the CSS?
> 
> It could be your IE? It could be your HTML? It could be your CSS?

I was advised to change 

 

to 

http://www.mysite.org/"; /> 

and that seemed to sort out most of the problems.

Do I really need to hard code the site name like this, or is there some 
variable I can use?
 
> -aj



-- 
John



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


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread Phillip Hutchings
On 17/06/05, John Poltorak <[EMAIL PROTECTED]> wrote:
> 
> I've just put together a simple Zope website, but whilst it renders
> properly under Firefox, it looks dreadful using IE.
> 
> Can anyone explain why? Could it be the CSS?

It could be your CSS, but it's probably IE. I usually end up writing
two stylesheets, one for IE and one for everything else. Getting IE to
read its on is just a case of using the IE-only conditional includes
feature:


though you'll have to hard code the URL - ZPT won't parse it ;)

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


Re: [Zope] Python Scripts

2005-06-16 Thread J Cameron Cooper
We have been seeing a number of instances where python scripts fail 
due to an apparent "syntax error" but the syntax is correct and simply 
storing the method restores it to functionality.   Anyone else seeing 
this?


How do you mean "fail"?

Often times, if you have an error, save, test, and then use the back
button, you'll see the old syntax error, even though the contents are
the new (and correct) version.

If you just revisit the script (click on the id in the breadcrumbs) the
message will go away.

   --jcc
--
"Building Websites with Plone"
http://plonebook.packtpub.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread Andreas Jung



--On 16. Juni 2005 19:15:58 +0100 John Poltorak <[EMAIL PROTECTED]> wrote:



I've just put together a simple Zope website, but whilst it renders
properly under Firefox, it looks dreadful using IE.

Can anyone explain why? Could it be the CSS?


It could be your IE? It could be your HTML? It could be your CSS?

-aj


pgpevoKKzoUbA.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread Joe Bezier

Can you show us? It'd be easier to tell you the problem...

It could be the CSS, or it could be the HTML, particularly the DTD - IE 
renders pages differently depending on the validity of your DTD - a 
good DTD gets your page rendered in "compliant" mode, a bad one (or 
none...) gets your page rendered in "quirks" mode. Or it could be many 
other things. Send us a link ;-)


Cheers,

joe


On 16 Jun 2005, at 19:15, John Poltorak wrote:



I've just put together a simple Zope website, but whilst it renders
properly under Firefox, it looks dreadful using IE.

Can anyone explain why? Could it be the CSS?


--
John


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





___ 
How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos http://uk.photos.yahoo.com

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] IE v. Firefox for viewing Zope sites

2005-06-16 Thread John Poltorak

I've just put together a simple Zope website, but whilst it renders 
properly under Firefox, it looks dreadful using IE.

Can anyone explain why? Could it be the CSS?


-- 
John


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


Re: [Zope] zope 2.7: Unauthorized "in this context"

2005-06-16 Thread Dieter Maurer
John Hunter wrote at 2005-6-15 14:42 -0500:
> ...
>Dieter>   Thus, the primary problem is that "mentor" magically
>Dieter> does not have a "__roles__" attribute or (maybe) that it
>Dieter> was never expected to be accessed via the
>Dieter> "FactoryDispatcher".
>
>My classes are all defined through the old ZClass mechanism and I
>don't see any way to fix the problem on my end.  I've added these
>security assertions and roles when writing pure python products, but
>do not know how to do it with ZClasses (is it possible?)
>
>Is this a bug in my ZClasses or a zope bug?

I did not yet analyse how ZClass security works.

My ZClasses work but I still use Zope 2.7.2 and
several security tighening measures in 2.7.3 introduced a lot
of problems. Maybe, also for ZClasses...

In your product, you have an "mentor_add_permission"
and in the "Define permissions tab" of your mentor ZClass,
you map "Create class instances" to this (or another existing)
permission?


-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problem with namespace

2005-06-16 Thread Dieter Maurer
Ralph wrote at 2005-6-15 20:59 +0200:
> ...
>Method A in "report1" is rendering B in "util". B is rendering a ZSQL-object 
>in "sql" and in the tag   is rendering C (python-method) in "util", 
>to render a table cell, but this isn't working, because E is unknown and I 
>don't know why.
>
>Example: 
>
>DTML-Method A:
>
> 

I assume "B" is a DTML object...

Then, you make one of the most frequent errors when dealing with
"DTML" objects. They have 2 essential positional arguments.
If you forget to pass them (usually as "None, _"), then
the called DTML object gets a new empty namespace...


For details, please the the "Calling DTML objects" section in

  

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Problems in file upload

2005-06-16 Thread Dieter Maurer
Nello Polesello wrote at 2005-6-16 14:54 +0200:
> ...
>With some files (pdf) I obtain "Document contains no data" with Firefox, 
>while Explorer gives me a blank page.

This means, your Zope died.

Run Zope in a system (not Python!) debugger (it might be necessary to
recompile Python and its extensions to include debugging symbols)
and see where it dies.

-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] 3rd Party Search Engine

2005-06-16 Thread Eric
Hi,
I'm in the process of integrating a 3rd party search engine with Zope and have 
a question about being able to make this work. I'd like to use the spidering 
capability of this search engine for it to build it's own index.

What should the most ideal approach be?

1) Should I write an object in Zope that will interface between the 
search engine and the objects in Zope? 
For example, writing an object that uses a script that the search engine could 
call to Plone to return a list of objects of type 'documents' that were 
modified in a given range of time. 

2) Should I write an object in Zope that will make calls to the Zcatalog 
to get back simliar results in 1)?
I'm concerned about having to manage both the ZCatalog and the 3rd-party search 
engine's catalog. There may also be performance issues to consider.


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


[Zope] Python Scripts

2005-06-16 Thread Dennis Allison
We have been seeing a number of instances where python scripts fail due to 
an apparent "syntax error" but the syntax is correct and simply storing 
the method restores it to functionality.   Anyone else seeing this?

-- 
Dennis Allison * Computer Systems Laboratory * Gates 227
   * Stanford University *  Stanford CA  94305
   * (650) 723-9213 * (650) 723-0033 fax
   * [EMAIL PROTECTED]
   * [EMAIL PROTECTED]


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


[Zope] Re: [Zope-Annce] [ANN] Zope 2.8.0 released

2005-06-16 Thread Andreas Jung
...and last but not leastvery special thanks to the incredible Jeremy 
Hylton for his tremendous work on MVCC.


I hope this was the last one I forgot to mention :-)

-aj

--On 15. Juni 2005 15:28:08 +0200 Andreas Jung <[EMAIL PROTECTED]> 
wrote:



Unfortunately I forgot to mention the whole Five team that contributed
Five
to Zope 2.8:

  Martijn Faassen, Sidnei da Silva, Philipp von Weitershausen,
  Lennart  Regebro

Forgetting to mention you was not intentional in any way...just the
result of my bad memory...Sorry!







pgpDBaOYtiboH.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Problems in file upload

2005-06-16 Thread Nello Polesello
Good morning,
anyone ever had problems with the standard template file_edit_form "Add new 
element" - "File"?

With some files (pdf) I obtain "Document contains no data" with Firefox, 
while Explorer gives me a blank page.

I discovered it does NOT depends on file size (I uploaded without any 
problems a 5 MB file and I can't upload one of 1.6 MB).
I never saw this problem on other sites I created with Plone, but only in 
this server.

Nello. 



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


Re: [Zope] Objects access

2005-06-16 Thread Hugo Ramos
Thanks Tino,

Your answer really helped me.
Basically I want to know what objects are accessed the most so that I
can plan a cache strategy. This is also helpfull just to optimize the
code in the objects that are used intensively. Also I can delete
objects that are very old and not used anymore but in big web apps is
dificult to maintain track of every tiny object that we don't use
anymore.


Regards
Hugo



On 6/16/05, Tino Wildenhain <[EMAIL PROTECTED]> wrote:
> Am Donnerstag, den 16.06.2005, 11:24 +0100 schrieb Hugo Ramos:
> > Yellow ppl,
> >
> > Is there a way to know how many times an object has been accessed
> > during current Zope's uptime?
> > Something like the activity tab in /Control_Panel/Database/main but
> > specific to each object in ZODB.
> 
> You can enable profiling (see ZMI in Control_Panel)
> (You need to create a file for the log in the filesystem,
> change config and restart zope) where you get refcounts on
> all object but it will also cause substantial slowdown.
> E.g. nothing you use in production environment.
> 
> Next best be it to just analyze the logfiles, for example
> Z2.log - which gives you numbers based on URL
> (Not that in a publishing process not only the object
> on the specific URL is used but also a lot parent objects,
> user, etc.
> 
> I guess it highly depends on what you really want to do.
> --
> Tino Wildenhain <[EMAIL PROTECTED]>
> 
> 


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


Re: [Zope] Objects access

2005-06-16 Thread Tino Wildenhain
Am Donnerstag, den 16.06.2005, 11:24 +0100 schrieb Hugo Ramos:
> Yellow ppl,
> 
> Is there a way to know how many times an object has been accessed
> during current Zope's uptime?
> Something like the activity tab in /Control_Panel/Database/main but
> specific to each object in ZODB.

You can enable profiling (see ZMI in Control_Panel)
(You need to create a file for the log in the filesystem,
change config and restart zope) where you get refcounts on
all object but it will also cause substantial slowdown.
E.g. nothing you use in production environment.

Next best be it to just analyze the logfiles, for example
Z2.log - which gives you numbers based on URL
(Not that in a publishing process not only the object
on the specific URL is used but also a lot parent objects,
user, etc.

I guess it highly depends on what you really want to do.
-- 
Tino Wildenhain <[EMAIL PROTECTED]>

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


[Zope] Objects access

2005-06-16 Thread Hugo Ramos
Yellow ppl,

Is there a way to know how many times an object has been accessed
during current Zope's uptime?
Something like the activity tab in /Control_Panel/Database/main but
specific to each object in ZODB.


Regards

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


Re: [Zope] Pre-indexing filter and accented letters (mostly solved)

2005-06-16 Thread Yuri


ZCTextindex to search and catalog accented words as non accented.

- Step 1

Add to Lexicon.py (around line 190) this code, which filters the things 
in the pipeline:


---

class RemoveAccented:

  def filter_word(self, w):
  """ filter the non ascii letters to ascii"""

  # trasformo la stringa w in unicode...
  parola = unicode(w,'latin-1')

  xlate={0xc0:'A', 0xc1:'A', 0xc2:'A', 0xc3:'A', 0xc4:'A', 0xc5:'A',
  0xc6:'Ae', 0xc7:'C',
  0xc8:'E', 0xc9:'E', 0xca:'E', 0xcb:'E',
  0xcc:'I', 0xcd:'I', 0xce:'I', 0xcf:'I',
  0xd0:'Th', 0xd1:'N',
  0xd2:'O', 0xd3:'O', 0xd4:'O', 0xd5:'O', 0xd6:'O', 0xd8:'O',
  0xd9:'U', 0xda:'U', 0xdb:'U', 0xdc:'U',
  0xdd:'Y', 0xde:'th', 0xdf:'ss',
  0xe0:'a', 0xe1:'a', 0xe2:'a', 0xe3:'a', 0xe4:'a', 0xe5:'a',
  0xe6:'ae', 0xe7:'c',
  0xe8:'e', 0xe9:'e', 0xea:'e', 0xeb:'e',
  0xec:'i', 0xed:'i', 0xee:'i', 0xef:'i',
  0xf0:'th', 0xf1:'n',
  0xf2:'o', 0xf3:'o', 0xf4:'o', 0xf5:'o', 0xf6:'o', 0xf8:'o',
  0xf9:'u', 0xfa:'u', 0xfb:'u', 0xfc:'u',
  0xfd:'y', 0xfe:'th', 0xff:'y',
  0xa1:'!', 0xa2:'{cent}', 0xa3:'{pound}', 0xa4:'{currency}',
  0xa5:'{yen}', 0xa6:'|', 0xa7:'{section}', 0xa8:'{umlaut}',
  0xa9:'{C}', 0xaa:'{^a}', 0xab:'<<', 0xac:'{not}',
  0xad:'-', 0xae:'{R}', 0xaf:'_', 0xb0:'{degrees}',
  0xb1:'{+/-}', 0xb2:'{^2}', 0xb3:'{^3}', 0xb4:"'",
  0xb5:'{micro}', 0xb6:'{paragraph}', 0xb7:'*', 0xb8:'{cedilla}',
  0xb9:'{^1}', 0xba:'{^o}', 0xbb:'>>',
  0xbc:'{1/4}', 0xbd:'{1/2}', 0xbe:'{3/4}', 0xbf:'?',
  0xd7:'*', 0xf7:'/'
  }

  r = ''
  for i in parola:
  if xlate.has_key(ord(i)):
  r += xlate[ord(i)]
  elif
  r += str(i)

  return r


  def process(self, lst):
  return [self.filter_word(w) for w in lst]

element_factory.registerFactory('Remove Accented',
  'Remove Accented',
  RemoveAccented)

---

Step 2

Add the locale support for a latin-1 language, I added -L it_IT to zope 
start (in 2.7 you have to enable it in etc/zope.conf)


Then you can search for "aççented" and find "accented" ;-)
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )