[Zope3-Users] How i can get IRequest

2007-04-17 Thread Garanin Michael

Hello!
How i can get IRequest in my event handler (i has only context)?
Thanks!
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] OOBTree instances lose attributes upon restart

2007-04-06 Thread Garanin Michael

Douglas Douglas wrote:

Hi everyone.

I've been fighting with this for a while now. So I mail the list for a
suggestion.

I have a `Variable` class wich I subclass from OOBTree, because I need a
dictionary with the min, max options that OOBTree methods give. My object is
supposed to store datetime.datetime instances as keys and floats numbers as
values. eg: temperature[datetime(2007, 4, 6, 12, 8)] = 25.8

I didn't use BTreeContainer because only takes strings as keys, and I don't
want to map datetime to strings and back.

Here's my class definition:

class Variable(OOBTree, Contained):

implements(IVariable, IAttributeAnnotatable)

name = None
units = None

  

class Variable(Persistent, Contained):
 def __init__(self):
self.__mydata = OOBTree()
   
def keys(self, min, max ):

   return self.__mydata.keys(min, max, )


For example see implementations in  zope/app/container/sample.py
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Design question (object or interface for category implementation?)

2007-03-09 Thread Garanin Michael

Christophe Combelles wrote:

Christophe Combelles a écrit :

Hi,

I'm playing again with the notion of categories of objects.

I have two main goals:
-
1) I must let the user choose the category of an object added to the 
zodb. For this, I must be able to retrieve the list of categories and 
present them in a form field managed by a vocabulary (or in a 
different manner).

2) I must have different behaviours for categorized objects:
objects of different categories would have different views, different 
addMenuItems (if they are containers), etc.


the first requirement would tell me to define categories as objects, 
while the second one would tell me to define them as interfaces.


The possible solutions I see:


1) The simplest solution is to store the categories as text strings 
into the annotations of the object. So categories actually are just 
tags.


2) The second solution is to do the same, but replace text strings 
with category objects, that implement ICategory. And categories can 
be stored separately in a category container, or in a registered 
utility that gives the list of available categories. This is a bit 
better, but this way I don't know how to easily let my categorized 
objects behave differently according to their categories.


3) The third solution is to define categories as interfaces extending 
ICategory. I can retrieve the list of categories with 
ICategory.dependents
But to present them in a form, I must have a pretty name for each 
interface. Should I store them in a Tagged Value?


4) The fourth solution I see, is to define an interface type, 
ICategoryType, extending IInterface just like IContentType. Then my 
categories would be interfaces whose type is ICategoryType. But with 
IContentType, is there a way to retrieve the list of all available 
content types?


I've finally mixed 3) and 4) :

I have defined ICompany(Interface), IClient(ICompany), 
IProvider(ICompany)

And I have an ICompanyType(IInterface) interface type
I've set the type of IClient and IProvider as ICompanyType in zcml.

ICompany has a types attribute, for which I've redefined __getattr__ 
and __setattr_:

__getattr__ retrieve the ICompanyType interfaces from the object
__setattr__ calls noLongerProvides then alsoProvides to change the 
interfaces.
I think that it's not work: alsoProvides and directlyProvides change 
interfaces only in memory, it's not persistent changes (after restart 
Zope yours object will be only basic interface) .

(sorry my honor english).





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Design question (object or interface for category implementation?)

2007-03-07 Thread Garanin Michael

Christophe Combelles wrote:

.
I want to define objects that represent Companies.
A company can be either a client, or a provider, or both,
or in the future it could be of another type.

When the user creates a company, it must choose client, provider, 
or both.

The choice would assign a different interface to the object:
IClient, or IProvider, and this would lead to different views for 
these objects.


So client and provider are categories of companies.

So I would tend to have:

class ICompany(Interface)

class IClient(ICompany)

class IProvider(ICompany)

This is simple, but now how do I assign a name to these interface, so 
that the user will choose between Client and Provider, and not 
between IClient and IProvider?
Is it feasible with Tagged Value ?  Or with the name attribute in 
the zope:interface ZCML declaration?

simple way:
1) in interfaces.py:
class IMyApplicationSite(Interface):
   pass
class ICompany(Interface):
   pass

class IClientMarker(Interface):
   pass
class IProviderMarker(Interface):
   pass


2): in model.py
class MyApplicationSite(Folder):
def get(self, key, default):
 obj = Folder.get(key, default)
 if ICompany.providedBy(obj):
if 'client' in obj.tags:
directlyProvide(IClientMarker, obj)
elif 'provider' in obj.tags:
directlyProvide(IProviderMarker, obj)
  return obj

class BaseCompany(Persistent):
   implements(ICompany)
tags = client provider  # or provider


3) in configure.zcml
 view
 for=.interfaces.IMyApplicationSite
 type=zope.publisher.interfaces.browser.IBrowserRequest
 provides=zope.publisher.interfaces.browser.IBrowserPublisher
 factory=zope.app.container.traversal.ContainerTraverser
 permission=zope.View
 
allowed_interface=zope.publisher.interfaces.browser.IBrowserPublisher

 /















___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Zope3 with RDBMS (avoiding ZODB)?

2007-02-28 Thread Garanin Michael

Stefan Krumbiegel (Galileo Press) wrote:


3.3 Also there is 'zsqlmap: Zope3 wrapper for SQLObject'
(http://www.zope.org/Members/garanin/zsqlmap). This is not really a
solution for us because the version number is 0.01b and the author says:
'NOTE: i tested only postgres.' Not really a capable product...


i use (but not publish in zope.org) new branch of zsqlmap .
Now zsqlmap is NOT wrapper for SQLObject, it's simple orm (but only for 
zope3 (use Z3 specific)).

Now i tested postgresql and mssql.
https://code.keysolutions.ru/trac/zsqlmap/browser/branches/orm
(or see attach)

my applications not big (i make intrAnet applications for  50 users) 
and i don't know about perfomance problem for big requests.




zsqlmap.tar.gz
Description: application/gzip
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] default page based on roles?

2007-02-28 Thread Garanin Michael

Shailesh Kumar wrote:

Hi,
 
Is it possible to control the default page for a particular object 
based on the roles/permissions that a user has?
 
The browser:defaultPage directive as such doesn't support this.
 
Will I have to write a custom traverser or something like that for this?
 
Thanx in advance.
 
With regards,

-Shailesh
 



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users
  

i think it's not task for zcml.
simple solutions:

class MyIndexView:
   def __call__(self):
  if self.request.principal.id == 'zope.Manager':
   self.request.responce.redirect('page1.html')
   elif:
 self.request.responce.redirect('page2.html')
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Registered utility is never found

2006-12-13 Thread Garanin Michael

FB wrote:

Hi,

On Tue, Dec 12, 2006 at 12:39:37PM -0500, Benji York wrote:
  

Tom Gross wrote:

   you are trying to lookup the utility with the name None. If you don't specify a name when registering the 
utility,

omit the second parameter: zapi.getUtility(IInitIndicator)
  

In other words, the name of an unnamed utility isn't None, but the empty string.



That's not the problem. I tried None (but forget to remove it later) because it 
wasn't
working in the first place.

Regards,

Frank
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

  
Problem solved or no? If no then traceback please (after call 
zapi.getUtility(IInitIndicator) ).





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Registered utility is never found

2006-12-12 Thread Garanin Michael

FB wrote:

Hi,

is there any reason why a registered utility which is persistently stored 
inside the site
manager is never found via zapi.getUtility(IMyInterface) ?

More information:

I wrote a package ( fb ) containing some components making the developer's life 
easier. The package
provides a class fb.init.indicator.InitIndicator. A application depending on 
the fb package is
supposed to make an instance of the InitIndicator, put it into the site manager 
and register it.

As soon as the InitIndicator exists, the annoying This site is not
initialized, yet-message provided by the fb package's skin (which just
checks if zapi.getUtility(IInitIndicator) is not None) disappears.

  

traceback, please.
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Registered utility is never found

2006-12-12 Thread Garanin Michael

FB wrote:

On Tue, Dec 12, 2006 at 04:42:56PM +0300, Garanin Michael wrote:
  

traceback, please.



Hmm ... how? It just doesn't return the utility as expected (it returns
None). There is no error shown in any way.

  


from APIDOC:


   * *|getUtility(interface, name='', context=None)| *

 . If one is not found, raises
 ComponentLookupError.    must be EXCEPTION !!!




There are not ComponenLookupError exception? Why you find bug in 
getUtility? ;-)



(sorry my english)

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] problem adding an item to the zmi_views menu

2006-07-12 Thread Garanin Michael

   /
   browser:page
   name=ViewProject.html
   permission=zope.Public
   template=projectview.pt
   for=finance.project.Project
try:
 for=finance.interfaces.IProject 

   menu=zmi_views title=ViewIt
   /



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] export\import content

2006-06-23 Thread Garanin Michael
В Вск, 19/03/2006 в 21:57 +0300, Garanin Michael пишет:
 Hello!
 I have not empty Folder on computer. How can i import Folder to  other
 computer? Where is analog of Zope2 import\export (zexp)? 
 Thanks!
 
How i can make backup my site-folder?


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Problem with containment and @@absolut_url

2006-05-29 Thread Garanin Michael
В Пнд, 29/05/2006 в 20:26 +0200, Achim Domma пишет:
 Hi,
 
 I have implemented ArticleFolder and Article like this:
 
 
 class Article(Persistent,Contained):
  implements(IArticle)
  title=u''
  body=u''
 
 class ArticleFolder(Folder):
  implements(IArticleFolder)
 
 
 Via ZMI I can add, edit and delete articles without problems. I use this 
 TAL statement in a view for the object holding the article folder :
 
 p tal:repeat=article context/articles
  a
 tal:content=article/title
 tal:attributes=href article/@@absolute_urlasdf/a 
 /p
 
 This fails with an There isn't enough context to get URL information. 
 exception. When the exception is thrown, I see in the debugger, that the 
 context of AbsoluteUrl is the id of the first article as unicode string. 
 And this string has of course no __parent__ attribute!?
 
 I argued that context/articles might return ids, not objects, but in 
 that case article/title should fail also. But if I remove 
 tal:attributes, it works fine.
 
What is 'articles'? I can think 'articles' is list of dictionarys, like
[ {'title':'bla-bla', ...} , ..., {'title':'bla-bla'}]. 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] zope.thread.local == threading.local ?

2006-05-01 Thread Garanin Michael
Hello!
I use 'zope.thread.local', but Python2.4 has 'threading.local'-class
from Jim Fulton. Where diff? 


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] announce: pure ORM for Zope3

2006-04-26 Thread Garanin Michael
Hello!
In new branch zsqlmap-project i develop light plugable ORM for
Zope3(only!). 
It's NOT wrapper for sqlobject, but i use sqlobject naming style. 
Supported: StringCol and other; ForeignKey  MulitpleJoin; AND\OR
\BETWEEN\...\LIKE-sql conditions for select\selectBy;

Now exist two orm-adapters: for gadfly and postgres, but it's easy
develop new orm-adapters and new column-types without 'monkey patching'.
Doc-test:
https://code.keysolutions.ru/trac/zsqlmap/browser/branches/orm/README.txt




___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Announce: z3site - theme engine for Zope3-sites (ver 0.02)

2006-03-22 Thread Garanin Michael

 Hi,
 I'm getting this error.
 
 I guess your product uses boston app.
 is this dependent on  http://svn.zope.org/Zope3/branches/roger-bostonskin/ ?
 
 

I make new release 0.02:
 - add viewlet managers: IHead, ICSS, IJavaScript
 - remove 'zop.app.boston' dependency
 - remove 'create demo theme' menu item. use 'load theme' instead
 - rewrite functional test (full complete)

And bonus: 'bostontheme' it's example theme (NOT required
'zope.app.boston' ;-) ).  


You can get all on http://garanin.objectis.net/ or www.zope.org after
workflow-publish.





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Announce: z3site - theme engine for Zope3-sites

2006-03-21 Thread Garanin Michael
 
 Hi,
 I'm getting this error.

 I guess your product uses boston app.
 is this dependent on  http://svn.zope.org/Zope3/branches/roger-bostonskin/ ?
 
 
Sorry, i use Zope3-trunk-version. I think boston-skin include to
release...

For solve problem you can remove zope.app.boston.boston from
browser.zcml in line 7:

skin name=z3site layers=z3site rotterdam zope.app.boston.boston
default/  --- to -- skin name=z3site layers=z3site rotterdam
default/

(but demo-theme use boston-skin as example)

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] export\import content

2006-03-19 Thread Garanin Michael
Hello!
I have not empty Folder on computer. How can i import Folder to  other
computer? Where is analog of Zope2 import\export (zexp)? 
Thanks!

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Announce: z3site - theme engine for Zope3-sites

2006-03-18 Thread Garanin Michael
В Сбт, 18/03/2006 в 00:22 +, Martin Aspeli пишет:
 On Fri, 17 Mar 2006 20:37:04 -, Garanin Michael  
 [EMAIL PROTECTED] wrote:
 
  Hello!
  I publish simple theme-engine for Zope3-sites. I use it for customize
  GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
  local utitlity for theme storage.
 
 Sounds interesting...
 
  url:
  http://www.zope.org/Members/garanin/z3site
 
 This requires a login, which I don't have ... perhaps a workflow state  
 problem?
 
 Martin
 
sorry, it's page has 'pending' status.
see attach.



z3site.tar.gz
Description: application/compressed-tar
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Announce: z3site - theme engine for Zope3-sites

2006-03-17 Thread Garanin Michael
Hello!
I publish simple theme-engine for Zope3-sites. I use it for customize
GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
local utitlity for theme storage. 

Features:
1) you can change  GUI of web-site (and ZMI) through web (on fly,
without restart server, and without Zope3-programming)
2) you can prepare theme and upload as tar.gz archive.
3) you can create few themes for one site.

Example: you can get design from www.oswd.org and create new ZMI through
web (without create Zope3-skin and without restart server).


url:
http://www.zope.org/Members/garanin/z3site

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Re: Announce: z3site - theme engine for Zope3-sites

2006-03-17 Thread Garanin Michael
В Сбт, 18/03/2006 в 00:22 +, Martin Aspeli пишет:
 On Fri, 17 Mar 2006 20:37:04 -, Garanin Michael  
 [EMAIL PROTECTED] wrote:
 
  Hello!
  I publish simple theme-engine for Zope3-sites. I use it for customize
  GUI(and ZMI) of Zope3-sites through browser. It's dynamics skin and
  local utitlity for theme storage.
 
 Sounds interesting...
 
  url:
  http://www.zope.org/Members/garanin/z3site
 
 This requires a login, which I don't have ... perhaps a workflow state  
 problem?
 
 Martin
 
sorry, it's page has 'pending' status...
new url: http://garanin.objectis.net/z3site.tar.gz


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] zope3.org

2006-03-04 Thread Garanin Michael
Hello!
I  see  url ' http://www.zope3.org:8080/++skin++tracker/tracker/49'  in
'bugtracker/TODO.txt'.
But 'zope3.org' - it's television company site. Why?

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] modified layout from web

2006-02-22 Thread Garanin Michael
I very want modified layout ('skin_macros') of my site throw web.
How i can do it?
I try create 'PageFolder'-utility but after create 'skin_macros'-ZPT my
site down  crach (is it bug?). 
Thanks.


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] standart views

2006-02-19 Thread Garanin Michael
For example i want insert yours tfws_i18ninfo into 'IRight'-slot of my
site == i must overwrite yours 'viewlet'-definitions. I think it's not
right.

В Вск, 19/02/2006 в 19:46 +1300, Darryl Cousins пишет:
 Hi Garanin,
 
 I don't believe such an agreement exists. I am getting used to using
 viewlets (zope.viewlet and implemented in zope.app.boston for example)
 and this provides easy insertion of presentationSlots as you describe.
 
 For example in a tfws.layers.tfws.viewlets.i18info configure.zcml:
 
   viewlet
   name=tfws_i18ninfo
   for=*
   manager=zope.app.boston.ILeft
   permission=zope.Public
   class=.browser.I18nInfoViewlet
   template=viewlet.pt
   layer=tfws
   weight=3
   /
 
 Hope this helps.
 
 Regards,
 Darryl
 
 
 On Sat, 2006-02-18 at 19:05 +0300, Garanin Michael wrote:
  Where are exists 'agreement about standart views'?
  I think it's need for development components for site. 
  Example of my problem:
  I have two 3th-party components 'Forum' and 'News'. And i want easy
  insert 'Last Forums Items'-box and 'Last News'-box into left column of
  my site pages. I think authors of Forum and News must develop
  '@@presentationSlotBox'-view according 'agreement about standart views'
  for easy insert into site :
  1) @@presentationSlotBox from 'Forum' present 'Last Forums items'-box.
  2) @@presentationSlotBox from 'News' present 'Last News'-box.
  
  
   
  
  ___
  Zope3-users mailing list
  Zope3-users@zope.org
  http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] standart views ('slot-box views')

2006-02-19 Thread Garanin Michael
Sorry, i think i mistake in my question. 
I only want offer rule for develop components: if you develop component
for use in web-sites, then develop few 'slot-box views' for easy insert
into sites. 'slot-box views' it's little box with standart zope3-css
(div.box etc.)

Example:
1) I develop 'NewsManager' component. And for easy usage in sites i
develop one 'slot-box views': @@lastNewsBox show 'Last 10 News '

2) I develop 'Z3Forum' component. And for easy usage in sites i develop
two 'slot-box views': @@lastItemsBox and @@myPrivateItems

Now, if SiteDeveloper want use my component 'NewsManager' then he easy
insert @@lastNewBox into site main page (as 'tal:content' or 'viewlet').






  

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: [Zope3-dev] 'standart viweletManger' for web-site

2006-02-19 Thread Garanin Michael
I mistake in my 'stadart views' post. My question is transformed.
'Boston' layer has 'standart' viewlet managers (IHead, ICSS, ILeft,
etc.). But 'Boston' layer it's layer for ZMI, and he not include
right-side slot.

Question: Where layer for web-site (not ZMI)? I offer create
'z3site'-layer and define 'standart' viewler managers for web-site(not
ZMI) : IHead, ICSS, .., ILeft, IRight(!), etc. 






___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] standart views

2006-02-18 Thread Garanin Michael
Where are exists 'agreement about standart views'?
I think it's need for development components for site. 
Example of my problem:
I have two 3th-party components 'Forum' and 'News'. And i want easy
insert 'Last Forums Items'-box and 'Last News'-box into left column of
my site pages. I think authors of Forum and News must develop
'@@presentationSlotBox'-view according 'agreement about standart views'
for easy insert into site :
1) @@presentationSlotBox from 'Forum' present 'Last Forums items'-box.
2) @@presentationSlotBox from 'News' present 'Last News'-box.


 

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


RE: [Zope3-Users] nextURL: add vs edit

2006-02-17 Thread Garanin Michael
Difference beetween AddView and EndView
1) for AddView: 'self.context' is view (name '+')
2) for EditView : 'self.context' is content-object

I think this is 'standart' behavior. Use 'zope.formlib' for advanced
customization your forms. 

В Птн, 17/02/2006 в 13:42 -0500, Shaun Cutts пишет:
 Ok,
 
 In AddView.update,
 
 self.request.response.redirect(self.nextURL())
 
 is called, but this is not called in EditView... so change isn't as
 simple as moving nextURL. However, if you put this line into
 EditView.update as well as moving nextURL, then my redirect works fine.
 
 But does this break anything else? Is there some reason why the editview
 doesn't do redirect? 
 
 I have gotten offlist feedback that I'm not the only one interested in
 this
 
 Thanks,
 - Shaun
 
 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] On Behalf Of
 Shaun Cutts
 Sent: Friday, February 17, 2006 1:17 PM
 To: Zope3-users@zope.org
 Subject: [Zope3-Users] nextURL: add vs edit
 
 Is there a reason why zope.app.form.browser.add.AddView defines:
 
 def nextURL(self):
 return self.context.nextURL()
 
 but zope.app.form.browser.editview.EditView doesn't?
 
 My redirection works for add but not edit, and this is the reason. Is
 this a feature or a bug? If a bug, all that needs to happen is that
 nextURL get moved to EditView from AddView, as EditView is base for Add.
 
 
 But perhaps there is a reason for this I don't understand?
 
 - Shaun
 
 
 ___
 Zope3-users mailing list
 Zope3-users@zope.org
 http://mail.zope.org/mailman/listinfo/zope3-users

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Announcement: zsqlmap

2006-02-16 Thread Garanin Michael
Announcement zsqlmap-project: 
zsqlmap - it's Zope3-wrapper for SQLObject. i borrow idea from sqlos
(http://codespeak.net/z3/sqlos) and add features. 
Homepage:
https://code.keysolutions.ru/trac/zsqlmap/
Enjoy.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-11 Thread Garanin Michael
   File /home/florian/Zope3/src/zope/schema/_bootstrapfields.py, line 171, 
 in 
 get
 return getattr(object, self.__name__)
 ForbiddenAttribute: ('blablubb', CS.centershock.centershock.Centershock 
 object at 0xb757a46c)
 
That is problem? You object don't have '__name__' attribute. 
See 'buddydemo.Buddy' please.  
There are two variants:
1) in MyClass write ' __name__ = __parent__ = None'
2) or MyClass must implement ILocation

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
Do you register the 'centershock'skin? 
Write this part of zcml-code, please.


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
В Птн, 10/02/2006 в 14:22 +0100, Florian Lindner пишет:
 Am Freitag, 10. Februar 2006 14:05 schrieb Garanin Michael:
  Do you register the 'centershock'skin?
  Write this part of zcml-code, please.
 
 Yes, there are a number of page directives that use the centershock skin and 
 are working correctly.
 
 Florian
Do you include 'default'-layer to 'centershock'-skin definition?
I think 'browser:form' ignore 'layer'-attribute and use
'default'-layer. 





___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
I simulate this for Buddy from buddydemo (see attached) == it is normal
work for Buddy-object! 

I think you make mistakes:
1) __init__ for 'view' always get 3-parameters (self, context, request)
2) getData must return dictionary.







configure  
xmlns=http://namespaces.zope.org/browser;
xmlns:zope=http://namespaces.zope.org/zope;
  layer name=centershock/
   
  skin name=centershock layers=centershock rotterdam default/

  form
name=registrationForm.html
 schema=.test.registrationForm
 class=.test.registrationFormView
 permission=zope.Public
 layer=centershock
 for=*/
  
/configurefrom zope.interface import Interface
from zope.schema import TextLine, Password

class registrationForm(Interface):
login = TextLine(title=uUsername)


class registrationFormView:

def getData(self):
return {}
def setData(self):
pass
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
В Птн, 10/02/2006 в 17:18 +0300, Garanin Michael пишет:
 I simulate this for Buddy from buddydemo (see attached) == it is normal
 work for Buddy-object! 
for work my example don't forget insert

   implements 
   interface=.test.registrationForm /

to content class=.buddy.Buddy - tag. 


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
I think 'browser:form' will be 'deprecated'. 
Try use 'zope.formlib' for new automatic-generated forms. It's easy and
more undestandable and more flexibility.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael

В Птн, 10/02/2006 в 17:47 +0100, Florian Lindner пишет:
 Am Freitag, 10. Februar 2006 15:55 schrieb Garanin Michael:
  I think 'browser:form' will be 'deprecated'.
  Try use 'zope.formlib' for new automatic-generated forms. It's easy and
  more undestandable and more flexibility.
 
 Hi,
 You have any proof that the browser:form will be deprecated?
 

This links:
http://www.z3lab.org/sections/blogs/philipp-weitershausen/2005_12_14_zcml-needs-to-do-less
http://www.infrae.com/presentations/present_PF_DocumentLibrary/schemas
http://faassen.n--tree.net/blog/view/weblog/2005/09/06/0



___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Trying to use browser:form - 404

2006-02-10 Thread Garanin Michael
 I've played with zope.formlib before that. I didn't manage to generate a 
 entire form, just the input ... statemenets were generated, without any 
 html headers or anything like that. So I need to add them manually with 
 python code or a template. Can you tell me how I can generate a form. 
 Basically the same like the form directive we're talking about all the time.
 
 
 Thanks,
 
 Florian
It's easy. Example:

1) class IMyForm(Interface):
title = TextLine(...)

2) class MyAddForm(zope.formlib.AddForm):
form_fields = IMyForm

def create(self, data):
   # create you object from data-dictionary


   class MyEditForm(zope.formlib.EditForm):
form_fields = IMyForm
# yes it's all ! ;-)

3) in browser.zcml
   
  page
  name=AddMyObject.html
  for=zope.app.container.interfaces.IAdding 
  class=.MyAddForm
  permission=zope.ManageContent
  /
  page
  name=edit.html
  for=.IMyObjectInterface
  class=.MyEditForm
  permission=zope.ManageContent
  /

P.S. you can see usage zope.formlib in 'zsqlmap' (my product, see
zope.org ;-)









___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Simple Acquisition

2006-02-04 Thread Garanin Michael
  
В Сбт, 04/02/2006 в 21:01 +0100, Jean-Marc Orliaguet пишет:
   
 David Johnson wrote:
 
 I have created a ZPT Page which I have no trouble accessing:
 
 http://localhost/index.html
 
 
 
 However, if I try to access it from the following URL, I see the
 contents of MyFolder instead of the index.html.
 
 http://localhost/MyFolder/index.html
 
 What is the proper way to acquire index.html in other contexts?
   
you can overwrite traverse-behavior for 'your folders': write simple
Traverse-adapter for you folders. 
What is 'your folders'? It's folders implements
'IMyAcquisitionBehavior'. 

This adapter will has  'traverse'-method.
example(only idea):

class MyAcquisitionTraverse:
  __used_for__ = myproduct.interfaces.IMyAcquisitionBehavior

  def traverse(self, name):
 my_folder = self.context
 parent_folder = my_folder.__parent__ 
 return zapi.traverse(parent_folder, name) 












___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Sum of Decimals

2006-02-03 Thread Garanin Michael
  
Hello!
My content object A has attributes 'cost'  'tax' - Decimal (from
decimal). I try: A.cost + A.tax --- security error '+' method for
Decimal-class. I solve problem by 'zope.proxy.removeAllProxies' , but i
think it's bad. What other ways are exist?

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Zope3-wrapper for SQLObject

2005-12-22 Thread Garanin Michael
  
Hello!
I develop Zope3 wrapper for SQLObject (sqlos-alternative).
Features: 
 1. you can make multi-level containers tree: ZODB-Folder-SQL
Container-SQL Container ...- SQL Item 
 2. zsqlmap use DA-wrapper for SQLObject._postgres and etc. (i
tested only _postgres ;-) 
 3. support optimize values()-slice (it's SQLObject-feature, i only
wrap in special class)

Links:
http://garanin.objectis.net/main.txt - functional test
http://garanin.objectis.net/zsqlmap.tar.gz - source 
Thanks for criticism.

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users