Re: [Zope] zeo clients not synchronized, modifications not shown

2015-11-05 Thread Dragos Chirila
Hi Christopher,

Great pointers, thank you very much for your response!

I use pound for load balancing (from the beginning - nothing changed here).

I will investigate using your indications.

Thanks again,
Dragos

On Thu, Nov 5, 2015 at 2:03 PM, Christopher Lozinski <
lozin...@freerecruiting.com> wrote:

>
>
> On 11/5/15 12:29 PM, Dragos Chirila wrote:
> > My impression is that the save itself is handled by lets say client1
> > and then the redirect and render of the edit page by a different one -
> > client2.
> I don't know what is going on, but let me ask a few obvious questions.
> How do you assign web requests to zeo clients.  If the redirect is
> handled by a different zeo client, then maybe it has not gotten the
> cache invalidation.  Maybe in your web page display, you can display the
> process id, to verify if indeed it is a  different zeo client which is
> the source of the problem.  At that point, put some logging into the
> cache invalidations to see if they are happening
> correctly, and before the new page is redisplayed.  Of do something on
> your load balancer to make sure that each ip is served by the same zeo
> client.
>
> And why did the problem suddenly start happening?  Wierd.
>
> Hope that helps.
>



-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] charset problems (utf-8)

2012-02-06 Thread Dragos Chirila
Hi,

You have to make sure that everything has the same encoding (strings, text
values). I recomend you to convert everything to unicode and then put
something like below as a first line in your page:

span
tal:replace=python:request.RESPONSE.setHeader('content-type','text/html;charset=utf-8')
/

and in the HEAD

meta http-equiv=Content-Type content=text/html; charset=utf-8 /

HTH,
Dragos


On Mon, Feb 6, 2012 at 2:38 PM, Hugo Ramos ram...@gmail.com wrote:

 I guess no one has charset problems...



 On Thu, Feb 2, 2012 at 6:06 PM, Hugo Ramos ram...@gmail.com wrote:
  Yellow,
 
  I've noticed charset problems displaying HTML pages.
 
  Let's say I want to display a page using a DTML Method like this:
 
  html
  head
  ...
  /head
 
  body
  á Á à À ç
  /body
  /html
 
  This page is ok and I can see the portuguese letters fine.
 
  The problem starts when I do this:
 
  html
  head
  ...
  /head
 
  body
  á Á à À ç br
  dtml-var sometextfield
  /body
  /html
 
  The first line of characters shows some strange characters and the
  sometextfield shows up fine even if it has the same portuguese
  characters.
 
 
  sometextfield comes from a mySQL server using utf-8 as charset and
 collation.
 
  zope.conf has the following:
 
  rest-input-encoding utf-8
  rest-output-encoding utf-8
 
  The browsers also have UTF-8 as the encoding (safari, firefox and
  chrome) all show me the same problem.
 
  I also noticed some strange behavior...
  If I create á Á à À ç as a property field using ustring and call it
  as dtml-var someproperty also gets fine in the browser.
 
  Anyone seen this??? Double encoding maybe???
 
 
  TIA
 
  --
  Hugo Ramos - IT Project Manager
  E: ram...@gmail.com
  W: www.hugoramos.eu
 
  Nobody expects the Spanish Inquisition! - Monty Python's
 
  Para visualizar este email em 3D, bata com uma bola de snooker na
  testa e fixe o ecrã durante 5 minutos a uma distância de 20cm.



 --
 Hugo Ramos - IT Project Manager
 E: ram...@gmail.com
 W: www.hugoramos.eu

 Nobody expects the Spanish Inquisition! - Monty Python's

 Para visualizar este email em 3D, bata com uma bola de snooker na
 testa e fixe o ecrã durante 5 minutos a uma distância de 20cm.
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev )




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope-dev] Strange Cut/Paste or Copy/Paste or Import/Export behavior

2011-06-01 Thread Dragos Chirila
Hi all,

I have to containers old_container and new_container that accept objects of
the same type. The two containers are actually instances of different
classes in the same product.

I want to move all the objects from old_container to new_container. I have
tried with only one object:

1. To move it with a simple Cut/Paste operation through ZMI: the object is
moved successfully, but has missing properties
2. I have used Import/Export to move the same object: the object is imported
successfully, but also has missing properties
3. Even tried a simple Copy/Paste: same result, no errors but missing
properties

Basically, the code for the object to be moved is like this:


class Country(Discussion, Folder):

_properties = (
Discussion._properties
+
(
{'id': 'body', 'type': 'text', 'mode': 'w'},
)
)

def __init__(self, id, title, body, comments, flg_notify):
self.id = id
self.title = title
self.body = body
Discussion.__dict__['__init__'](self, comments, flg_notify)

def check_properties(self):
 
print hasattr(self, 'body')
print hasattr(self, 'comments')

and

class Discussion:

_properties = (
(
{'id': 'comments', 'type': 'int', 'mode': 'w'},
{'id': 'flg_notify', 'type': 'int', 'mode': 'w'},
)
)

def __init__(self, comments, flg_notify):
self.comments = comments
self.flg_notify = flg_notify


If i run the method check_properties before move/copy/import it prints
True+True. After step 1/2/3 the result is True+False. So the missing
property is 'comments', that comes from the extended class Discussion. If a
I trie to acces the Propeties tab, manage_propertiesForm method, I get:

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module App.special_dtml, line 178, in _exec
  Module DocumentTemplate.DT_In, line 703, in renderwob
  Module DocumentTemplate.DT_Let, line 76, in render
  Module DocumentTemplate.DT_Util, line 196, in eval
   - __traceback_info__: id
  Module string, line 0, in ?
  Module OFS.PropertyManager, line 151, in getProperty
AttributeError: comments


Am I doing something wrong? Any idea is highly appreciated.

Thank you very much,
Dragos


-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope] Strange Cut/Paste or Copy/Paste or Import/Export behavior

2011-06-01 Thread Dragos Chirila
Hi all,

I have to containers old_container and new_container that accept objects of
the same type. The two containers are actually instances of different
classes in the same product.

I want to move all the objects from old_container to new_container. I have
tried with only one object:

1. To move it with a simple Cut/Paste operation through ZMI: the object is
moved successfully, but has missing properties
2. I have used Import/Export to move the same object: the object is imported
successfully, but also has missing properties
3. Even tried a simple Copy/Paste: same result, no errors but missing
properties

Basically, the code for the object to be moved is like this:


class Country(Discussion, Folder):

_properties = (
Discussion._properties
+
(
{'id': 'body', 'type': 'text', 'mode': 'w'},
)
)

def __init__(self, id, title, body, comments, flg_notify):
self.id = id
self.title = title
self.body = body
Discussion.__dict__['__init__'](self, comments, flg_notify)

def check_properties(self):
 
print hasattr(self, 'body')
print hasattr(self, 'comments')

and

class Discussion:

_properties = (
(
{'id': 'comments', 'type': 'int', 'mode': 'w'},
{'id': 'flg_notify', 'type': 'int', 'mode': 'w'},
)
)

def __init__(self, comments, flg_notify):
self.comments = comments
self.flg_notify = flg_notify


If i run the method check_properties before move/copy/import it prints
True+True. After step 1/2/3 the result is True+False. So the missing
property is 'comments', that comes from the extended class Discussion. If a
I trie to acces the Propeties tab, manage_propertiesForm method, I get:

Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module App.special_dtml, line 178, in _exec
  Module DocumentTemplate.DT_In, line 703, in renderwob
  Module DocumentTemplate.DT_Let, line 76, in render
  Module DocumentTemplate.DT_Util, line 196, in eval
   - __traceback_info__: id
  Module string, line 0, in ?
  Module OFS.PropertyManager, line 151, in getProperty
AttributeError: comments


Am I doing something wrong? Any idea is highly appreciated.

Thank you very much,
Dragos


-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] zope2 2.12 installation on Windows 7

2010-09-08 Thread Dragos Chirila
 671, in install_product
initmethod(context)
  File
D:\PythonFarms\Python263\lib\site-packages\zope2-2.12.0-py2.6-win32.egg\
Products\Five\__init__.py, line 31, in initialize
zcml.load_site()
  File
D:\PythonFarms\Python263\lib\site-packages\zope2-2.12.0-py2.6-win32.egg\
Products\Five\zcml.py, line 51, in load_site
_context = xmlconfig.file(file)
  File
D:\PythonFarms\Python263\lib\site-packages\zope.configuration-3.7.2-py2.
6.egg\zope\configuration\xmlconfig.py, line 653, in file
context.execute_actions()
  File
D:\PythonFarms\Python263\lib\site-packages\zope.configuration-3.7.2-py2.
6.egg\zope\configuration\config.py, line 600, in execute_actions
for action in resolveConflicts(self.actions):
  File
D:\PythonFarms\Python263\lib\site-packages\zope.configuration-3.7.2-py2.
6.egg\zope\configuration\config.py, line 1507, in resolveConflicts
raise ConfigurationConflictError(conflicts)
zope.configuration.config.ConfigurationConflictError: Conflicting
configuration
actions
  For: ('adapter', (InterfaceClass zope.formlib.interfaces.IAction,),
Interfa
ceClass zope.browserpage.namedtemplate.INamedTemplate, u'render')
File D:\PythonFarms\Python263\lib\site-packages\
zope.formlib-4.0.4-py2.6.eg
g\zope\formlib\configure.zcml, line 19.2-19.64
adapter factory=.form.render_submit_button name=render /
File D:\PythonFarms\Python263\lib\site-packages\
zope2-2.12.0-py2.6-win32.eg
g\Products\Five\formlib\configure.zcml, line 6.2-9.8
adapter
factory=.form.render_submit_button
name=render
/
  For: ('adapter', (class 'zope.interface.exceptions.Invalid',
InterfaceClass
 zope.publisher.interfaces.browser.IBrowserRequest), InterfaceClass
zope.forml
ib.interfaces.IWidgetInputErrorView, '')
File D:\PythonFarms\Python263\lib\site-packages\
zope.formlib-4.0.4-py2.6.eg
g\zope\formlib\configure.zcml, line 22.2-25.8
adapter
factory=.errors.InvalidErrorView
permission=zope.Public
/
File D:\PythonFarms\Python263\lib\site-packages\
zope2-2.12.0-py2.6-win32.eg
g\Products\Five\formlib\configure.zcml, line 12.2-17.8
adapter
for=zope.interface.Invalid
 zope.publisher.interfaces.browser.IBrowserRequest
factory=.errors.InvalidErrorView
permission=zope.Public
/


I took the above steps twice, second time after removing everything and
still got the same error. I do not install any additional zope product or
python package, just using the zope2 installation.

I will appreciate any hints or ideas on this problem.

Thank you very much,
Dragos


-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] zope2 2.12 installation on Windows 7

2010-09-08 Thread Dragos Chirila
Hi Tres,

I have upgraded to 2.12.10 and everything works great!

Thank you very much,
Dragos


On Wed, Sep 8, 2010 at 2:36 PM, Tres Seaver tsea...@palladion.com wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Dragos Chirila wrote:
  Hi everybody,
 
  I'm having some problems when I have to run a zope2 2.12 instance. Here
 are
  the steps:
 
  1. fresh install of Python 2.6.3 - python-2.6.3.msi
  2. install pywin - pywin32-214.win32-py2.6.exe
  3. install setup tools - setuptools-0.6c11.win32-py2.6.exe
  4. install Zope2 using easy_install from egg -
 Zope2-2.12.0-py2.6-win32.egg
  5. create a new instance using mkzopeinstance.exe
 
  Until here, everything worked great. Now , I modify the zope.conf to turn
  the debug on and try to run the created instance. Here is the error that
 I
  receive:

 snip

  I took the above steps twice, second time after removing everything and
  still got the same error. I do not install any additional zope product or
  python package, just using the zope2 installation.
 
  I will appreciate any hints or ideas on this problem.

 Your traceback shows conflicting ZCML registrations between the version
 of zope.formlib you are using (4.0.4, very recent) and the version of
 Zope2 you are using (2.12.0, much older).  Please try updating to the
 latest version of Zope2 (2.12.10), which pins the zope.formlib
 dependency to version 3.7.0.  E.g.:

  bin\easy_install -U Zope2

 You may need to remove the zope.formlib 4.0.4 egg first.


 Tres.
 - --
 ===
 Tres Seaver  +1 540-429-0999  tsea...@palladion.com
 Palladion Software   Excellence by Designhttp://palladion.com
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (GNU/Linux)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

 iEYEARECAAYFAkyHdSoACgkQ+gerLs4ltQ7dQACeMi/lnLrOFBUnuEvKKQkVC+UH
 RSMAn00W+A3iQZCpKn99hLAsDzFKmAKv
 =X4x9
 -END PGP SIGNATURE-

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




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] ZEO TempStorage: Odd behavior on ZEO restart

2010-07-15 Thread Dragos Chirila
 Products.Transience.Transience, line 929, in _housekeep
- Module Products.Transience.Transience, line 569, in _finalize
- Module Products.Transience.Transience, line 593, in _do_finalize_work
- Module ZODB.Connection, line 761, in setstate
- Module ZODB.Connection, line 801, in _setstate
- Module ZEO.ClientStorage, line 727, in load
- Module ZEO.ClientStorage, line 750, in loadEx
- Module ZEO.ServerStub, line 196, in loadEx
- Module ZEO.zrpc.connection, line 650, in call

 KeyError: '\x00\x00\x00\x00\x00\x00\x00\x82' (Also, the following error
 occurred while attempting to render the standard error message, please see
 the event log for full details: You are not allowed to access 'title_or_id'
 in this context)

 We know for a fact that one client instance needs to create the actual
 temporary container at the ZEO server upon its restart. Restarting a single
 client instance will make make this instance work but unfortunately won't
 recover all other client instances. All of those problems disappear as soon
 as we restart all instances; until the next ZEO server restart of course.
 The problem doesn't appear to happen if connections drops happen but the ZEO
 server keeps running.

 Is that behavior intentional? Any kind of help is very much appreciated.

 We're currently using following versions (yes, we're also running on
 windows but I find it hard to believe that the OS is causing those issues).

 Zope Version
  (Zope 2.10.9-final, python 2.4.4, win32)
  Python Version
  2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)]
  System Platform
  win32
  SOFTWARE_HOME
  G:\mentzdv\plone\instances\zeo04\zope2\lib\python
  ZOPE_HOME
  G:\mentzdv\plone\instances\zeo04\zope2
  INSTANCE_HOME
  G:\mentzdv\plone\instances\zeo04\parts\instance1
  CLIENT_HOME
  G:\mentzdv\plone\instances\zeo04\var\instance1
  Network Services
  ZServer.HTTPServer.zhttp_server (Port: 8101)
  Process Id
  6132 (5328)
  Running For
  1 hour 3 min 34 sec

 Thanks,
 Sebastian

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




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope] Get raw data (byte array) from flash in Zope

2009-11-28 Thread Dragos Chirila
Hi,

The solution is very simple :)

Instead of sending the byte array like in the example, just encode it
as a string and send it in a variable using POST:

- base64 - this doesn;t works all the time... i don't know why
- bin to hex - works all the time

The server side code is like this:

img = REQUEST.form.get('picture', None)
if img is not None and img != '':
img = binascii.unhexlify(img)
img = PIL.Image.open(StringIO(img))
img.save(join(..., 'picture.jpg'))

We made tests with a lot of images, even with images of 10MB size. It works...

Dragos


On Wed, Nov 25, 2009 at 8:30 PM, Dragos Chirila objectval...@gmail.com wrote:
 The data is actually received by Zope, but its broken into pieces.

 Please find a sample of the REQUEST.form here
 http://media.fourhooks.ro/request_form.jpg

 Any hints on how to put the image back together?


 On Wed, Nov 25, 2009 at 4:58 PM, Dragos Chirila objectval...@gmail.com 
 wrote:
 Doesn't work: AttributeError: BODYFILE


 On Wed, Nov 25, 2009 at 1:59 PM, Stefan H. Holek ste...@epy.co.at wrote:
 Try REQUEST.BODYFILE


 On 25.11.2009, at 12:30, Dragos Chirila wrote:

 The question is: how can I get this data on the server side in Zope?
 Becasue:

 - REQUEST.form is empty
 - HTTP_RAW_POST_DATA is missing
 - there is no other key or value in the REQUEST to indicate the value
 I am looking for

 --
 Stefan H. Holek
 ste...@epy.co.at








 --
 Dragos Chirila
 objectval...@gmail.com
 (+4) 0722 395375




 --
 Dragos Chirila
 objectval...@gmail.com
 (+4) 0722 395375




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Get raw data (byte array) from flash in Zope

2009-11-25 Thread Dragos Chirila
Hello everyone,

I have a question about how to get raw data sent by a flash
application in Zope (a zope method/function).

The flash application uses the method in the link below to send to the
server an image (jpg):

http://www.zedia.net/2008/sending-bytearray-and-variables-to-server-side-script-at-the-same-time/

Searching through the internet I have found a PHP example that gets
this byte array sent from flash:

http://blog.joa-ebert.com/2006/05/01/save-bytearray-to-file-with-php/

They are getting the date form a header called HTTP_RAW_POST_DATA.


The question is: how can I get this data on the server side in Zope? Becasue:

- REQUEST.form is empty
- HTTP_RAW_POST_DATA is missing
- there is no other key or value in the REQUEST to indicate the value
I am looking for


On my local devel machine I managed to find a solution:

- using Zope 2.10.3 I have enabled use-wsgi (on) (without apache)
- in zope, the method called from flash is something like this:

...
v = REQUEST.environ['wsgi.input']
v.seek(0)
f = open(join(SOME_PATH, 'image.jpg'), 'wb')
f.write(v.read())
f.close()
return '1'

This solution doesn't work on the production environment - Zope 2.11.4
with ZEO (pound and apache in the front of zope as load balancer and
web server).


Is there a way to solve this problem? Any idea is highly appreciated.

Thank you very much,
Dragos


-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Get raw data (byte array) from flash in Zope

2009-11-25 Thread Dragos Chirila
Doesn't work: AttributeError: BODYFILE


On Wed, Nov 25, 2009 at 1:59 PM, Stefan H. Holek ste...@epy.co.at wrote:
 Try REQUEST.BODYFILE


 On 25.11.2009, at 12:30, Dragos Chirila wrote:

 The question is: how can I get this data on the server side in Zope?
 Becasue:

 - REQUEST.form is empty
 - HTTP_RAW_POST_DATA is missing
 - there is no other key or value in the REQUEST to indicate the value
 I am looking for

 --
 Stefan H. Holek
 ste...@epy.co.at








-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Get raw data (byte array) from flash in Zope

2009-11-25 Thread Dragos Chirila
The data is actually received by Zope, but its broken into pieces.

Please find a sample of the REQUEST.form here
http://media.fourhooks.ro/request_form.jpg

Any hints on how to put the image back together?


On Wed, Nov 25, 2009 at 4:58 PM, Dragos Chirila objectval...@gmail.com wrote:
 Doesn't work: AttributeError: BODYFILE


 On Wed, Nov 25, 2009 at 1:59 PM, Stefan H. Holek ste...@epy.co.at wrote:
 Try REQUEST.BODYFILE


 On 25.11.2009, at 12:30, Dragos Chirila wrote:

 The question is: how can I get this data on the server side in Zope?
 Becasue:

 - REQUEST.form is empty
 - HTTP_RAW_POST_DATA is missing
 - there is no other key or value in the REQUEST to indicate the value
 I am looking for

 --
 Stefan H. Holek
 ste...@epy.co.at








 --
 Dragos Chirila
 objectval...@gmail.com
 (+4) 0722 395375




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope-dev] Zope 2.12.0 released

2009-10-05 Thread Dragos Chirila
Hi,

I have tried to install it on an windows: the egg for python 2.4
works, but the one for 2.6 fails with the following error:

Installed 
d:\pythonfarms\python262\lib\site-packages\zope2-2.12.0-py2.6-win32.egg
Processing dependencies for Zope2==2.12.0
Searching for zope.container
Reading http://pypi.python.org/simple/zope.container/
Best match: zope.container 3.9.0
Downloading 
http://pypi.python.org/packages/source/z/zope.container/zope.container-3.9.0.tar.gz#md5=
8a993c12fdbd017a408af62fb75cae39
Processing zope.container-3.9.0.tar.gz
Running zope.container-3.9.0\setup.py -q bdist_egg --dist-dir
c:\docume~1\admini~1\locals~1\temp\eas
y_install-lobg1o\zope.container-3.9.0\egg-dist-tmp-a2hqwi
error: Setup script exited with error: Unable to find vcvarsall.bat


Thank you very much,
Dragos



On Thu, Oct 1, 2009 at 6:38 PM, Hanno Schlichting ha...@hannosch.eu wrote:
 On Thu, Oct 1, 2009 at 6:09 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Hanno Schlichting wrote:

 Yeah! I added the Windows binary eggs for Python 2.4 to 2.6 to PyPi.

 Someone still needs to do this for:

 http://pypi.python.org/pypi/ExtensionClass/2.11.3

 I would, but I don't have the right PyPI access...

 Thanks. I added the missing binary eggs for the 2.11.2 and 2.11.3 releases.

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




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Zope 2.12.0 released

2009-10-05 Thread Dragos Chirila
Hi Chris,

The installation worked smoothly. Still, I had to modify something in
the site-packages\zope\interface\common\interfaces.py file :

try:
classImplements(OverflowWarning, IOverflowWarning)
except NameError:
pass # OverflowWarning was removed in Python 2.5

Otherwise, Zope wont start because of a Python error: NameError: name
'OverflowWarning' is not defined

Thank you very much,
Dragos

On Mon, Oct 5, 2009 at 11:49 AM, Chris Withers ch...@simplistix.co.uk wrote:
 Dragos Chirila wrote:

 Hi,

 I have tried to install it on an windows: the egg for python 2.4
 works, but the one for 2.6 fails with the following error:

 This is because there was no 2.6 binary egg.

 I've just rolled one and uploaded it.

 Can you try again and let me know how you go?

 Chris

 --
 Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Zope 2.12.0 released

2009-10-05 Thread Dragos Chirila
I took the steps:

- installed Python 2.6.2
- downloaded Zope2-2.12.0-py2.6-win32.egg
- ..\Scripts\easy_install.exe Zope2-2.12.0-py2.6-win32.egg
- create a zope instance with ..\Scripts\mkzopeinstance.exe


Is this the correct way, right?

On Mon, Oct 5, 2009 at 12:35 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Dragos Chirila wrote:
 Hi Chris,

 The installation worked smoothly. Still, I had to modify something in
 the site-packages\zope\interface\common\interfaces.py file :

 try:
 classImplements(OverflowWarning, IOverflowWarning)
 except NameError:
 pass # OverflowWarning was removed in Python 2.5

 Otherwise, Zope wont start because of a Python error: NameError: name
 'OverflowWarning' is not defined

 This doesn't seem right. I'm running Zope 2.12 on Windows and haven't
 had to modify anything.

 How did you try and install Zope?

 Chris

 --
 Simplistix - Content Management, Batch Processing  Python Consulting
- http://www.simplistix.co.uk
 ___
 Zope-Dev maillist  -  Zope-Dev@zope.org
 https://mail.zope.org/mailman/listinfo/zope-dev
 **  No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope )




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Zope 2.12.0 released

2009-10-05 Thread Dragos Chirila
Chris,

You were right; I tried on a fresh Python 2.6.3 installation and it
worked - Zope instance started without errors.

Dragos

On Mon, Oct 5, 2009 at 12:43 PM, Chris Withers ch...@simplistix.co.uk wrote:
 Dragos Chirila wrote:

 I took the steps:

 - installed Python 2.6.2
 - downloaded Zope2-2.12.0-py2.6-win32.egg
 - ..\Scripts\easy_install.exe Zope2-2.12.0-py2.6-win32.egg
 - create a zope instance with ..\Scripts\mkzopeinstance.exe

 Try the virtualenv option here:

 http://docs.zope.org/zope2/releases/2.12/INSTALL.html#installing-zope-using-easy-install

 It sounds like you have old cruft in your site-packages which is tripping
 Zope up...

 Chris

 --
 Simplistix - Content Management, Batch Processing  Python Consulting
   - http://www.simplistix.co.uk




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope-Dev maillist  -  Zope-Dev@zope.org
https://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope )


[Zope] strange database read conflict error

2009-08-28 Thread Dragos Chirila
Hello everyone,

I have a question regarding a database read conflict error. I would
appreciate any thoughts on this issue.

I am using Zope 2.8.9.1-final, Python 2.3.7 with a ZEO server and 4
clients for 6 months now. I have noticed that the event.log is filled
with read conflict errors like the one below:

2009-08-28T10:29:26 INFO ZODB.Conflict database read conflict error
(oid 0x09, class Products.Transience.Transience.Increaser) at
/VirtualHostBase/http/metropotam.ro:80/metropotam/VirtualHostRoot/Opera/loc4769172835-Ateneul-Roman/
(21 conflicts, of which 0 were unresolved, since startup at Thu Aug 27
15:25:02 2009)

This URL of the object is
http://metropotam.ro/Opera/loc4769172835-Ateneul-Roman . We have
around 2000 objects of the same type and this is *the only one* that
generates read conflict errors.

I have tried a few things:

1.  Edit object and recatalog it
2.  Rename it
3.  Delete object, pack database, create a new object and then rename
it to keep the URL alive
4.  checked the data.fs and got no errors (fstest.py)

None of the above solved the problem; I still get a lot of conflicts.

Is there a way to fix this? I found it very strange that I get
conflicts only for this object and for no other of the same type, even
in the same folder...

Thank you,
Dragos Chirila
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] strange database read conflict error

2009-08-28 Thread Dragos Chirila
Peter,

Than you for your response. Please find below a few things:

- I give up using sessions in the website's front and years ago :)
There is only one page left that is using them, when u subscribe to
our newsletter but I don't think that this affects because is used
rarely

- I am using Yahoo Maps Ajax API to display maps; also some ajax calls
for our build in chat (only for logged users)

So if the things above are causing read conflicts why only for this
particular object? There is nothing special or different with this
one...

Thanks again,
Dragos

On Fri, Aug 28, 2009 at 12:19 PM, Peter Bengtssonpete...@gmail.com wrote:
 The fact that the class is Products.Transience.Transience.Increaser
 makes me suspect that you're using sessions and within the same
 session you make too many read requests to the ZODB. When the load is
 too high, after a certain amount of attempts Zope will say, piss off!
 ...for a while and come back later. So it comes back later and works
 fine.
 Are you using lots of AJAX requests? That can sometimes cause read
 conflict errors.

 2009/8/28 Dragos Chirila objectval...@gmail.com:
 Hello everyone,

 I have a question regarding a database read conflict error. I would
 appreciate any thoughts on this issue.

 I am using Zope 2.8.9.1-final, Python 2.3.7 with a ZEO server and 4
 clients for 6 months now. I have noticed that the event.log is filled
 with read conflict errors like the one below:

 2009-08-28T10:29:26 INFO ZODB.Conflict database read conflict error
 (oid 0x09, class Products.Transience.Transience.Increaser) at
 /VirtualHostBase/http/metropotam.ro:80/metropotam/VirtualHostRoot/Opera/loc4769172835-Ateneul-Roman/
 (21 conflicts, of which 0 were unresolved, since startup at Thu Aug 27
 15:25:02 2009)

 This URL of the object is
 http://metropotam.ro/Opera/loc4769172835-Ateneul-Roman . We have
 around 2000 objects of the same type and this is *the only one* that
 generates read conflict errors.

 I have tried a few things:

 1.  Edit object and recatalog it
 2.  Rename it
 3.  Delete object, pack database, create a new object and then rename
 it to keep the URL alive
 4.  checked the data.fs and got no errors (fstest.py)

 None of the above solved the problem; I still get a lot of conflicts.

 Is there a way to fix this? I found it very strange that I get
 conflicts only for this object and for no other of the same type, even
 in the same folder...

 Thank you,
 Dragos Chirila
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev )




 --
 Peter Bengtsson,
 work www.fry-it.com
 home www.peterbe.com
 hobby www.issuetrackerproduct.com
 fun crosstips.org




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] strange database read conflict error

2009-08-28 Thread Dragos Chirila
All objects as the same type of this one that generates conflicts are
displayed using the same template that contains the same elements (js,
images, etc.).

I can access any object in the same folder
(http://metropotam.ro/Opera/) and I will get no read conflicts (e.g.
http://metropotam.ro/Opera/loc8982879061-Sala-Palatului/). I have
conflicts when I access this particular object
http://metropotam.ro/Opera/loc8982879061-Sala-Palatului/.

If the problem is related with some piece of code I can't find any
logical explanation for this behavior. ... or maybe I am looking in
the wrong place.

Also, told you before, I even erased the object from the Data.fs and
then packed it. Conflicts stopped. After I have created a new object
and rename it with the old id the conflicts showed up again...

Thanks,
Dragos



On Fri, Aug 28, 2009 at 2:37 PM, Peter Bengtssonpete...@gmail.com wrote:
 2009/8/28 Dragos Chirila objectval...@gmail.com:
 Peter,

 Than you for your response. Please find below a few things:

 - I give up using sessions in the website's front and years ago :)
 There is only one page left that is using them, when u subscribe to
 our newsletter but I don't think that this affects because is used
 rarely

 It might be used anyway. It'll be empty (except the
 subscribe-to-newsletter page) all the time but it might still be in
 use.
 I think there is always a REQUEST.SESSION object.

 - I am using Yahoo Maps Ajax API to display maps; also some ajax calls
 for our build in chat (only for logged users)
 That's unrelated. Yahoo! isn't using ZODB.


 So if the things above are causing read conflicts why only for this
 particular object? There is nothing special or different with this
 one...

 It could be some other piece of code that tries to read from ZODB more
 than once and whatever it's trying to read might be something slow
 (slow for a computer).

 Have you tried running ZopeProfiler on your site to figure out if
 there are certain (ZO)DB related functions that are called either many
 many times or few but slow times.

 Thanks again,
 Dragos

 On Fri, Aug 28, 2009 at 12:19 PM, Peter Bengtssonpete...@gmail.com wrote:
 The fact that the class is Products.Transience.Transience.Increaser
 makes me suspect that you're using sessions and within the same
 session you make too many read requests to the ZODB. When the load is
 too high, after a certain amount of attempts Zope will say, piss off!
 ...for a while and come back later. So it comes back later and works
 fine.
 Are you using lots of AJAX requests? That can sometimes cause read
 conflict errors.

 2009/8/28 Dragos Chirila objectval...@gmail.com:
 Hello everyone,

 I have a question regarding a database read conflict error. I would
 appreciate any thoughts on this issue.

 I am using Zope 2.8.9.1-final, Python 2.3.7 with a ZEO server and 4
 clients for 6 months now. I have noticed that the event.log is filled
 with read conflict errors like the one below:

 2009-08-28T10:29:26 INFO ZODB.Conflict database read conflict error
 (oid 0x09, class Products.Transience.Transience.Increaser) at
 /VirtualHostBase/http/metropotam.ro:80/metropotam/VirtualHostRoot/Opera/loc4769172835-Ateneul-Roman/
 (21 conflicts, of which 0 were unresolved, since startup at Thu Aug 27
 15:25:02 2009)

 This URL of the object is
 http://metropotam.ro/Opera/loc4769172835-Ateneul-Roman . We have
 around 2000 objects of the same type and this is *the only one* that
 generates read conflict errors.

 I have tried a few things:

 1.  Edit object and recatalog it
 2.  Rename it
 3.  Delete object, pack database, create a new object and then rename
 it to keep the URL alive
 4.  checked the data.fs and got no errors (fstest.py)

 None of the above solved the problem; I still get a lot of conflicts.

 Is there a way to fix this? I found it very strange that I get
 conflicts only for this object and for no other of the same type, even
 in the same folder...

 Thank you,
 Dragos Chirila
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev )




 --
 Peter Bengtsson,
 work www.fry-it.com
 home www.peterbe.com
 hobby www.issuetrackerproduct.com
 fun crosstips.org




 --
 Dragos Chirila
 objectval...@gmail.com
 (+4) 0722 395375
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev )




 --
 Peter Bengtsson,
 work www.fry-it.com
 home www.peterbe.com
 hobby www.issuetrackerproduct.com
 fun crosstips.org




-- 
Dragos Chirila
objectval...@gmail.com
(+4) 0722 395375

Re: [Zope] strange database read conflict error

2009-08-28 Thread Dragos Chirila
Ooops, paste it the wrong link below the URL of the object with
conflicts is http://metropotam.ro/Opera/loc4769172835-Ateneul-Roman/

On Fri, Aug 28, 2009 at 2:47 PM, Dragos Chirilaobjectval...@gmail.com wrote:
 All objects as the same type of this one that generates conflicts are
 displayed using the same template that contains the same elements (js,
 images, etc.).

 I can access any object in the same folder
 (http://metropotam.ro/Opera/) and I will get no read conflicts (e.g.
 http://metropotam.ro/Opera/loc8982879061-Sala-Palatului/). I have
 conflicts when I access this particular object
 http://metropotam.ro/Opera/loc8982879061-Sala-Palatului/.

 If the problem is related with some piece of code I can't find any
 logical explanation for this behavior. ... or maybe I am looking in
 the wrong place.

 Also, told you before, I even erased the object from the Data.fs and
 then packed it. Conflicts stopped. After I have created a new object
 and rename it with the old id the conflicts showed up again...

 Thanks,
 Dragos



 On Fri, Aug 28, 2009 at 2:37 PM, Peter Bengtssonpete...@gmail.com wrote:
 2009/8/28 Dragos Chirila objectval...@gmail.com:
 Peter,

 Than you for your response. Please find below a few things:

 - I give up using sessions in the website's front and years ago :)
 There is only one page left that is using them, when u subscribe to
 our newsletter but I don't think that this affects because is used
 rarely

 It might be used anyway. It'll be empty (except the
 subscribe-to-newsletter page) all the time but it might still be in
 use.
 I think there is always a REQUEST.SESSION object.

 - I am using Yahoo Maps Ajax API to display maps; also some ajax calls
 for our build in chat (only for logged users)
 That's unrelated. Yahoo! isn't using ZODB.


 So if the things above are causing read conflicts why only for this
 particular object? There is nothing special or different with this
 one...

 It could be some other piece of code that tries to read from ZODB more
 than once and whatever it's trying to read might be something slow
 (slow for a computer).

 Have you tried running ZopeProfiler on your site to figure out if
 there are certain (ZO)DB related functions that are called either many
 many times or few but slow times.

 Thanks again,
 Dragos

 On Fri, Aug 28, 2009 at 12:19 PM, Peter Bengtssonpete...@gmail.com wrote:
 The fact that the class is Products.Transience.Transience.Increaser
 makes me suspect that you're using sessions and within the same
 session you make too many read requests to the ZODB. When the load is
 too high, after a certain amount of attempts Zope will say, piss off!
 ...for a while and come back later. So it comes back later and works
 fine.
 Are you using lots of AJAX requests? That can sometimes cause read
 conflict errors.

 2009/8/28 Dragos Chirila objectval...@gmail.com:
 Hello everyone,

 I have a question regarding a database read conflict error. I would
 appreciate any thoughts on this issue.

 I am using Zope 2.8.9.1-final, Python 2.3.7 with a ZEO server and 4
 clients for 6 months now. I have noticed that the event.log is filled
 with read conflict errors like the one below:

 2009-08-28T10:29:26 INFO ZODB.Conflict database read conflict error
 (oid 0x09, class Products.Transience.Transience.Increaser) at
 /VirtualHostBase/http/metropotam.ro:80/metropotam/VirtualHostRoot/Opera/loc4769172835-Ateneul-Roman/
 (21 conflicts, of which 0 were unresolved, since startup at Thu Aug 27
 15:25:02 2009)

 This URL of the object is
 http://metropotam.ro/Opera/loc4769172835-Ateneul-Roman . We have
 around 2000 objects of the same type and this is *the only one* that
 generates read conflict errors.

 I have tried a few things:

 1.  Edit object and recatalog it
 2.  Rename it
 3.  Delete object, pack database, create a new object and then rename
 it to keep the URL alive
 4.  checked the data.fs and got no errors (fstest.py)

 None of the above solved the problem; I still get a lot of conflicts.

 Is there a way to fix this? I found it very strange that I get
 conflicts only for this object and for no other of the same type, even
 in the same folder...

 Thank you,
 Dragos Chirila
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev )




 --
 Peter Bengtsson,
 work www.fry-it.com
 home www.peterbe.com
 hobby www.issuetrackerproduct.com
 fun crosstips.org




 --
 Dragos Chirila
 objectval...@gmail.com
 (+4) 0722 395375
 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  https://mail.zope.org/mailman/listinfo/zope-announce
  https://mail.zope.org/mailman/listinfo/zope-dev

[Zope] ExtFile 1.5.6 bug

2008-03-25 Thread Dragos Chirila
Hi,

I am experiencing a very strange problem; any thoughts or ideas will
be highly appreciated.

I am using ExtFile 1.5.6 product to store images and files in my
application. During the publishing process, at some point, a rename of
a container with images and files it is involved. From time to time
this results in broken objects with 0 byes in size. My application
runs on a Zope 2.7.6.

On the other hand, I am running the same kind of publishing process on
a Zope 2.10.4 with ExtFile 2.0 and this problem never occours. I
noticed a line in the CHANGES.TXT file: - Bugfix: Exceptions at a late
stage of a cut/paste operation could lead to data loss. Can this be
the bug that affects my application when I use the ExtFile 1.5.6
product?

Because a migration to a higher Zope version is out of the question
right now, is there a fix for this problem? Or is there another way to
overcome this?

Thank you very much,
Dragos


-- 
Dragos Chirila
[EMAIL PROTECTED]
(+4) 0722 395375
___
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] BTreeFolder2 related

2008-01-17 Thread Dragos Chirila
Hi,

What is the best way to delete all the objects inside an object
derived from BTreeFolder2?

Thank you very much,
Dragos

-- 
Dragos Chirila
[EMAIL PROTECTED]
(+4) 0722 395375
___
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] metal:fill-slot and tal:condition

2007-02-22 Thread Dragos Chirila

Hi everybody,

I am stuck with the following problem. I would appreciate it very much
if you could help me with it.

So I have a ZPT where a macro is defined with several slots; one of
the slots like below:

tal:block metal:define-slot=slot_issue
SLOT DEFAULT CONTENT
/tal:block

The common way to put other content in the slot is:

tal:block metal:fill-slot=slot_issue
CUSTOM SLOT CONTENT
/tal:block

Now, in a ZPT that uses the above marco I want to replace the default
slot content with other stuff
*only* if a condition is fulfilled:

tal:block tal:condition=condition-code metal:fill-slot=slot_issue
CUSTOM SLOT CONTENT
/tal:block

If the condition-code returns True then the CUSTOM SLOT CONTENT is
put instead of the default slot content - correct.
If the condition-code returns False then nothing will be displayed -
this is not correct?!.

I also tried somthing like:

tal:block tal:condition=condition-code
tal:block metal:fill-slot=slot_issue
CUSTOM SLOT CONTENT
/tal:block
/tal:block

In this case the content of the slot is CUSTOM SLOT CONTENT in both
cases - the result is True or False.

The only solution that I can think of is not elegant at all because I
have to duplicate the slot_issue's default content:

tal:block metal:fill-slot=slot_issue
tal:block tal:condition=condition-code
CUSTOM SLOT CONTENT
/tal:block
tal:block tal:condition=python:not condition-code
SLOT DEFAULT CONTENT
/tal:block
/tal:block

Is there other wat to accomplish this?

Thank you very much,
Dragos
___
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] changing the meta_type for python product class

2006-12-06 Thread Dragos Chirila

Hi everybody,

I am stuck with the following problem for witch I don't have a
solution. I would appreciate it very much if you could help me with
it.

I have a very simple Python product with only one class that extends
Folder. The name of the product is MyClass and the MyClass.py module
is below:

from OFS.Folder import Folder
from Products.PageTemplates.PageTemplateFile import PageTemplateFile

from constants import *

manage_addMyClass_html = PageTemplateFile('zpt/myclass_manage_add', globals())
def manage_addMyClass(self, id, title='', REQUEST=None):

   ob = MyClass(id, title)
   self._setObject(id, ob)
   if REQUEST:
   return self.manage_main(self, REQUEST, update_menu=1)

class MyClass(Folder):


   meta_type = METATYPE_MYCLASS

   def __init__(self, id, title):
   #constructor
   self.id = id
   self.title = title

And the constants.py module contains:

import Globals

MYCLASS_PRODUCT_NAME = 'MyClass'
MYCLASS_PRODUCT_PATH = Globals.package_home(globals())

METATYPE_MYCLASS = 'My Class'
PERMISSION_ADD_MYCLASS = 'MyClass - Add Components'

In the ROOT folder I create the following python script (listing):

for x in container.objectValues(['My Class']):
 print '[%s] - [%s]' % (x.meta_type, x.absolute_url())
return printed


Then I follow the steps:

1. Create an instance with the id 'instance1' (in the drop down I have
'My Class').
2. I run the 'listing' script and I get:

[My Class] - [http://10.0.0.37:8080/instance1]

3. I change the constant METATYPE_MYCLASS into 'My New Class'
4. I run the 'listing' script and I get:

[My New Class] - [http://10.0.0.37:8080/instance1]

5. I create a second instance with the id 'instance2' (in the drop
down I have 'My New Class').
6. I run the 'listing' script and I get:

[My New Class] - [http://10.0.0.37:8080/instance1]

7. I modify the python script by changing the 'My Class' with 'My New Class'
8. I run the 'listing' script and I get:

[My New Class] - [http://10.0.0.37:8080/instance2]

In the ZMI for both instances the meta_type 'My New Class' is
displayed. I don't understand why the first instance is not displayed
after I change the meta_type value in the python Product.
Moreover, if I try to explicit update the meta_type property for the
first instance to the new value, the result is the same.

What I am trying to accomplish is to be able to change the meta_type
value and this to work (e.g. with no effect on python scripts like
'listing')

Thank you very much,
Dragos
___
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] Adding HTML to Python

2006-12-06 Thread Dragos Chirila

maybe you can try to add new lines

l_errorMessage = l_errorMessage +  %s\n  % (ID)

regards,
Dragos

On 12/6/06, April Lekin [EMAIL PROTECTED] wrote:

In Python I'm building this error message:

l_errorMessage = These IDs have Errors
Loop
   l_errorMessage = l_errorMessage +  %s  % (ID)
end loop

return l_errorMessage.

How can I put breaks (returns) between the IDs so each ID will be
displayed on it's own line?
like:

These IDs have Errors:
1
46
76
45

___
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 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] Adding HTML to Python

2006-12-06 Thread Dragos Chirila

if you are using ZPT to display the result of the method use
'structure', if you are usign DTML make sure you dont't encode the
result

if is plain text use new line character as I sad above.

regards,
Dragos

On 12/6/06, April Lekin [EMAIL PROTECTED] wrote:


 Hi,
 I tried that and it will print the BR, like this

 These IDs have Errors:BR 1BR 46 BR 76BR 45BR


 At 09:43 AM 12/6/2006, Roberto Benitez wrote:

add BR to the end of each line

 example:

 l_errorMessage = These IDs have ErrorsBR #ADD BR AT END OF HEADER
LINE
 Loop
l_errorMessage = l_errorMessage +  %sBR % (ID) #ADD BR AT END OF
EACH ID ENTRY
 end loop


 - Original Message 
 From: April Lekin [EMAIL PROTECTED]
 To: zope@zope.org
 Sent: Wednesday, December 6, 2006 11:12:20 AM
 Subject: [Zope] Adding HTML to Python

 In Python I'm building this error message:

 l_errorMessage = These IDs have Errors
 Loop
l_errorMessage = l_errorMessage +  %s  % (ID)
 end loop

 return l_errorMessage.

 How can I put breaks (returns) between the IDs so each ID will be
 displayed on it's own line?
 like:

 These IDs have Errors:
 1
 46
 76
 45

 ___
 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 )



 Everyone is raving about the all-new Yahoo! Mail beta.
 ___
 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 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 )






--
Dragos Chirila
[EMAIL PROTECTED]
(+4) 0722 395375
___
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] changing the meta_type for python product class

2006-12-06 Thread Dragos Chirila

Hi!

Thank you very much for your response.

Ok, you are right, but if I do it why the ZMI is showing to me the new
meta type for both instances? This is wrong...

Also, I don't understand why if I explicit change the meta_type
property for the old instance (e.g. a method of MyClass that is called
via URL) still nothing happens?

I also tried to add the following lines to the MyClass:

   _properties = (
   Folder._properties
   +
   (
   {'id': 'meta_type', 'type': 'string', 'mode': 'w'},
   )
   )

In the Properties tab for both instances the same value is shown for
the meta_type property.

Thank you very much once again for taking time to consider my problem.

Regards,
Dragos.

On 12/6/06, Dieter Maurer [EMAIL PROTECTED] wrote:

Dragos Chirila wrote at 2006-12-6 15:48 +0200:
 ...
What I am trying to accomplish is to be able to change the meta_type
value and this to work (e.g. with no effect on python scripts like
'listing')

The best way is *NOT* to change the meta type (at least not when
you have places that require it unchanged).

Instead derive a new class from it and give this new class a new
meta_type.



--
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] batching help

2005-12-15 Thread Dragos Chirila

Hi

I suggest to use the following function that

def get_grouped_list(self, seq=[], size=3):
#get the list with all items grouped
return [seq[i:i+size] for i in range(0, len(seq), size)]

that takes as parameter a list and goups items in slices with length = size.

 def get_grouped_list(seq=[], size=3):
... return [seq[i:i+size] for i in range(0, len(seq), size)]
...
 l = [1,2,3,4,5,6,7,8]
 get_grouped_list(l)
[[1, 2, 3], [4, 5, 6], [7, 8]]
 get_grouped_list(l, 4)
[[1, 2, 3, 4], [5, 6, 7, 8]]


Then iterating this is something like:

tr tal:repeat=slice python:someobject.get_grouped_list(yourlist)
td tal:repeat=item slice
span tal:replace=item /
/td
/tr


Hope this will help.
Dragos


Nicolas Georgakopoulos wrote:
Hello all , I'm trying to display on the same page a table with (3 
columns) with content from a list . I'm trying to batch the results so 
that every 3 elements anothe row is created.

Can anyone give me a clue how to do that ?

this is my code:


table tal:define=Rnumber 
python:context.cm1.content.specialfile.getList('link_list') ; batch 
python:modules['ZTUtils'].Batch(Rnumber,size=3,start=0)

   th colspan=3Main Title/th
   trthTitle 1/ththTitle 2/ththTitle 3/th/tr
   tr
   td tal:repeat=num batch
   span tal:condition=python:num  3 
tal:replace=structure num content goes here.. /span

   /td
   /tr !--  tr
   td tal:repeat=num batch
   span tal:replace=structure num 
Material goes here /span

   /td
   /tr 
-- /table

___
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 )




--
Dragos Chirila
Programmer, Finsiel Romania (http://www.finsiel.ro)
44A, Ficusului St. - 013975 Bucharest
Tel: +40 21 2320193, Fax: +40 21 2329807
Jabber: [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] Character set problems

2005-09-09 Thread Dragos Chirila

Hi

Here are some things you can do to handle your problem. For me, this 
approach worked just fine.


1. Your HTML pages must have set the encoding to utf-8. Put this in the 
HEAD tag of your html pages:


meta http-equiv=Content-Type content=text/html; charset=utf-8 /

2. For the Root folder add a property named 'management_page_charset' of 
type 'string' with the value 'utf-8'. In this way the ZMI pages will be 
displayed with utf-8 encoding.


3. Modify your HTML code like this:

input name=test:utf8:ustring /

	If 'test' is also a property of some object, make sure it has 'ustring' 
type.



After that the value will be displayed correctly in all pages.

Note: If your Zope runs over an Apache you must check also the Apache 
settings (to serve pages utf-8 encoded)


Hope this will help.

Regards,
Dragos


Niklas Saers wrote:

Hey guys,
I've installed Zope on a FreeBSD server. My problem domain is very 
small: display a list of when people are unavailable, and let people 
update the list. This is all in Danish, and here are come my problems. 
Danish has three extra letters not in the ASCII alfabet, three 
upper-case and three lower-case. When getting the data from a input 
name=test / where I've written æ ø å Æ Ø Å, I get: æ ø Ã¥ Æ Ø Ã…


What is the standard way of ensuring that I get the correct data?

I tried writing a little converter, but the string

tekst = tekst.replace(\xc3\xa6, ae);

gives me the error *UnicodeDecodeError: **'ascii' codec can't decode 
byte 0xc3 in position 0: ordinal not in range(128)*


Do you have any suggestion on how to overcome these problems?

Cheers

   Nik




___
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 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] Multilingual content class with LocalPropertyManager

2005-09-06 Thread Dragos Chirila

Hi

I want to build a multilingual content class with LocalPropertyManager 
from the Localizer product. Also, my class extends the File class, 
something like:



class MClass(LocalPropertyManager, File):

title = LocalProperty('title')
description = LocalProperty('description')

def __init__(self, id, title, description, file, precondition, 
content_type, lang):
File.__dict__['__init__'](self, id, title, file, content_type, 
precondition)

self._setLocalPropValue('title', lang, title)
self._setLocalPropValue('description', lang, description)


The problem is that everytime I call the title property it doesn't 
return the LocalProperty 'title', but instead it returns the value 
entered when the object was created.


From a ZPT, if lang is the current selected language and is 'en':

	span tal:replace=here/title / - don't get the correct value for the 
selected language


	span tal:replace=python:here.getLocalProperty('title', lang) / - 
correct value


Not event after editing the object properties, the 'title' value remains 
the same: the value entered when the object was created.


I tried not to call the File constructor, but it doesn't work also. My 
LocalProperty 'title' is somehow 'hidden'.


Could you please give me some indications about what am I doing wrong? 
Is there another way to have a class like MClass?


Thanks a lot,
Dragos
___
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 )