[Zope3-Users] z3c.formjs, z3c.form.group and jsaction.handler

2009-04-29 Thread Nylan
Hello,

I've tried the following:

class GeneralInfo(group.Group):
label=_(u'General info')

fields=field.Fields(IUser).select('loginname','firstname','lastname','email')

.

class UserAddForm(layout.FormLayoutSupport,group.GroupForm,form.AddForm):
fields=field.Fields(IUser).omit('loginname','firstname','lastname','email',)
groups=(GeneralInfo,OptionsInfo)

@jsaction.handler(groups[0].fields['name'],event=jsevent.CHANGE)
def handlerTest(self,event,selector):
return 'alert("Works!");'


but it doesn't seem to work. The page is rendered correctly,but the alert part
for the selected widget above is missing.The page header contains only:
$(document).ready(function(){
})

Without Groupforms the UserAddForm works fine.
Putting the handler definition into the Group part doesn't seem to work either.
Do i miss something?

Help appreciated!
Thanks!



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


Re: [Zope3-Users] Vocabulary with objects and persistence problem

2009-04-16 Thread Nylan
Solved!

Thanks to Thierry Florac for pointing in the right direction:


Thierry Florac wrote:

Well, not absolutely sure but the problem may come that "source"
attribute is automatically defined as a 'simple' list (see introspector
to be sure), and not as a persistent one ; as a list is a mutable
object, changing one of it's attributes or adding/removing an item
doesn't flag the list as modified "from the persistent object point of
view", so it isn't stored into the ZODB when the transaction is
committed.

So you may have two solutions to handle this in the "removeSource"
method :

1. sources = self.source
sources.remove(source)
self.source = sources

2. self.source.remove(source)
self._p_changed = True

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


Re: [Zope3-Users] Vocabulary with objects and persistence problem

2009-04-04 Thread NYLAN
I've checked everything. There are no error messages and transaction seems to 
comit fine.

Does a way exist to trace a transaction?

Best regards

 Original-Nachricht 
> Datum: Fri, 03 Apr 2009 11:14:30 -0400
> Von: "Warner, Christopher" 
> An: Nylan , Zope3-users 
> Betreff: Re: [Zope3-Users] Vocabulary with objects and persistence problem

> Are you sure the transaction commit isn't failing in some way?
> 
> -- 
> Christopher Warner
> Manager, Content Management Systems
> New York Media | 75 Varick St, 4th Fl
> New York, NY 10013
> phone: 212.508.0542
> cell: 646.334.6780
> 
> 
> 
> On 4/3/09 11:08 AM, "Nylan"  wrote:
> 
> > Hello,
> > I'm having some weird problem using objects references in a vocabulary.
> > 
> > Following situation:
> > Container A -  Objects type X
> > Container B -  objects type Y with zope.schema.Choice based on
> vocabulary of
> > objects X
> > 
> > After deleting object X1 in container A and removing
> > manually(ObjectRemovedEvent
> > iterating container B, removing reference and transaction.commit) the
> > reference
> > in object Y, X1 doesn't show up and everything looks fine.
> > 
> > After restarting zope i get a LookupError. Object Y has again a
> reference to X
> > in the list.
> > 
> > It happens only when deleting some object X referenced in Object Y.
> Changing
> > other attributes of Object Y works fine.
> > 
> > Do i miss something?
> > 
> > Best regards!
> > 
> > Nylan
> > 
> > 
> > 
> > 
> > ___
> > Zope3-users mailing list
> > Zope3-users@zope.org
> > http://mail.zope.org/mailman/listinfo/zope3-users

-- 
Neu: GMX FreeDSL Komplettanschluss mit DSL 6.000 Flatrate + Telefonanschluss 
für nur 17,95 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K11308T4569a
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Vocabulary with objects and persistence problem

2009-04-03 Thread Nylan
Hello,
I'm having some weird problem using objects references in a vocabulary.

Following situation:
Container A -  Objects type X
Container B -  objects type Y with zope.schema.Choice based on vocabulary of
objects X

After deleting object X1 in container A and removing manually(ObjectRemovedEvent
iterating container B, removing reference and transaction.commit) the reference
in object Y, X1 doesn't show up and everything looks fine.

After restarting zope i get a LookupError. Object Y has again a reference to X
in the list.

It happens only when deleting some object X referenced in Object Y. Changing
other attributes of Object Y works fine.

Do i miss something?

Best regards!

Nylan




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


Re: [Zope3-Users] After fresh buildout Vocabularies don't work anymore

2008-12-17 Thread Nylan
Solved.
Added include of zope.app.schema to configure.zcml





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


[Zope3-Users] After fresh buildout Vocabularies don't work anymore

2008-12-17 Thread Nylan
I'm getting following error:
VocabularyRegistryError: unknown vocabulary: 'Bases'

Yesterday every vocabulary worked fine.

Help greatly appreciated!

Best regards




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


[Zope3-Users] zope.app.apidoc.bookmodule and transaction

2008-12-17 Thread Nylan
As mentioned here too:
https://bugs.launchpad.net/zope3/+bug/303721

After the buildout, starting zope gives me the error:

zope.configuration.config.ConfigurationExecutionError:
zope.configuration.exceptions.ConfigurationError: Help Topic definition
Project/eggs/transaction-1.0a1-py2.4.egg/transaction/README.txt does not exist


transaction 1.0a1-py2.4
zope.app.apidoc 3.4.5-py2.4


Is this a bug or do i miss something in my buildout.cfg?

Thanks!



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


[Zope3-Users] How to access external files/directory?browser:resourceDirectory?

2008-06-10 Thread Nylan
Hi,

Looks like a simple problem, but how can i open files?
...project/browser/resource/[file1..fileX]

I thought it would be possible with the browser:resourceDirectory directive.
It works somehow.

But I'm having some problems.I can access the resource only once.
..
xslt_dir=getAdapter(self.request,Interface, name='xslt')
xslt_file=xslt_dir.get(filename+'.xslt').GET()
..
The second time xslt is empty. 
No exception is thrown, when accessing the resource.

Is it the wrong way to access the file?

Help appreciated!

Best regards


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


[Zope3-Users] Re: AW: z3c.pagelet, z3c.layer.pagelet and error views notworking(Unauthorized)

2008-06-05 Thread Nylan
Roger Ineichen <[EMAIL PROTECTED]> writes:

> Did you check the following?
> 
> This could happen if you access a public view and this view
> will access a protected object. Then you run into Unauthorized
> exception but since the rendering of the pagelet allready 
> started, there is no way to show the right Unauthorized view
> for that. 

I've checked every object. All objects are zope.Public. Only one view has the
zope.ManageContent permission for testing purpose.
:-(

The breakpoint(pdb) in the credentialsplugin is triggered, but after is hard to
follow.






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


[Zope3-Users] z3c.pagelet, z3c.layer.pagelet and error views not working(Unauthorized)

2008-06-04 Thread Nylan
Hello, I'm having a serious problem with z3c.pagelet and z3c.layer.pagelet.

I've created my own layer based on 
IFormLayer,IDivFormLayer,IPageletBrowserLayer.
Layer and skin work fine.
Only with PAU zope doesn't redirect to login page when Unauthorized is thrown. 

Zope always displays:
--
URL: http://localhost:/manage.html
Module paste.evalexception.middleware:306 in respond
.
Module zope.publisher.publish:130 in publish
Module zope.publisher.browser:539 in traverse
Module zope.app.publication.browser:66 in getDefaultTraversal
Unauthorized: (, 
'browserDefault','zope.ManageContent')
--

Questions:
1. Why doesn't the redirect in the credentialsplugins challenge work?
2. The redirect doesn't work. 
   Why isn't zope displaying the error view registered for IUnauthorized?



I've found several similar issues:
1.  http://thread.gmane.org/gmane.comp.web.zope.zope3.user/6468/focus=6469
2.  http://thread.gmane.org/gmane.comp.web.zope.zope3.user/7539/focus=7544

I've checked my sources for every hint found above, without
success(z3c.layer.pagelet configure.zcml is included)

Did I include "wrong" packages?

I'll provide information as necessary.

Help greatly appreciated.

Best regards!

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


[Zope3-Users] Re: XML schema definitions,zope.schema and z3c.form

2008-06-02 Thread Nylan
Thanks a lot for your input!

Best regards!



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


[Zope3-Users] XML schema definitions,zope.schema and z3c.form

2008-05-06 Thread Nylan
Hello,

I need some advice from experienced zope3 developers. ;-)

Use case:
1. Receive xsd from a server(see example xsd)
2. use xsd with zope3(add,edit forms with z3c.form)


I've found this solution(supports only simple elements at root level):
http://blogs.nuxeo.com/sections/blogs/julien_anguenot/2005_08_19_xml-schema-support-on

Are there other solutions, besides the link above, I haven't found/noticed?
Something able to manage more complex types?

Any help or advice appreciated!

best regards


Example XSD:

http://www.w3.org/2001/XMLSchema";
  targetNamespace="http://schemas.domain.com/SQLSource";
  xmlns:tns="http://schemas.domain.com/SQLSource";
  elementFormDefault="qualified">

  

  

  

  

  
  
  

  

  

  

  

  

  

  



  


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


[Zope3-Users] Re: Invariants and forms

2007-08-14 Thread Nylan
The standard error message is:
There were errors

I'll try your solution, but I would prefer getting the invariants to work, like
mentioned in the examples.

They seem to work with zope 3.2(example 1) and zope 3.4 (example 2)


Thanks

Best regards

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


[Zope3-Users] Re: Invariants and forms

2007-08-13 Thread Nylan
Hermann Himmelbauer <[EMAIL PROTECTED]> writes:
> 
> Am Montag, 13. August 2007 12:01 schrieb Darryl Cousins:
> > Hi,
> >
> > This was answered recently me thinks.
> >
> > http://mail.zope.org/pipermail/zope3-users/2007-August/006648.html
> 
> I think this covers a z3c.form-related issue, but not formlib...
> 
> Best Regards,
> Hermann
> 


Could it be that the issue relating to z3c.form is the same as for formlib?

It's a relative big project and I'm using formlib, so changing to z3c.form (with
resolved issue) is not possible at the moment.

Best regards

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


[Zope3-Users] Invariants and forms

2007-08-13 Thread NYLAN
Hello, I'm using an invariant to check if given passwords are equal.

I've found two different examples(see below), but both don't display my given 
exception message. The only thing i get is the standard error message.

Since this is my first experience with zope, could someone explain to me the 
correct way to get a custom error message with invariants?

Thanks!!!
I'm using zope version 3.3.1.

First example
(taken from: 
http://blog.gocept.com/zope3-testen-von-felderuebergreifenden-bedingungen-in-interfaces-mit-zope-formlib/):

class PasswordsAreNotEqual(zope.schema.ValidationError):
u"""Das Passwort und die Wiederholung sind nicht gleich."""
zope.interface.implements(zope.app.form.interfaces.IWidgetInputError)

def arePasswordsEqual(obj)
if obj.password != obj.password2:
raise PasswordsAreNotEqual

from zope.interface import Interface, invariant

class IUser(Interface):
password = zope.schema.Password(title=u"Passwort")
password2 = zope.schema.Password(title=u"Wiederholung des Passworts")

arePasswordsEqual = invariant(arePasswordsEqual)


Second example
(taken from:
http://blog.gocept.com/zope3-testen-von-felderuebergreifenden-bedingungen-invariants-in-interfaces-mit-zope-formlib-aktualisiert)

import zope.interface

class IUser(zope.interface.Interface):
password = zope.schema.Password(title=u"Passwort")
password2 = zope.schema.Password(title=u"Wiederholung des Passworts")

@zope.interface.invariant
def arePasswordsEqual(user):
if user.password != user.password2:
raise zope.interface.Invalid(
u"""Das Passwort und die Wiederholung sind nicht gleich.""")
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users