On Fri, 14 Oct 2005 15:36:09 +0200, gnotari wrote
> I'm at loss:
>
> I'm replicating the example at cap. 14.3 of Philipp's (Worldcookery)
> book. It's all about auto-assigning names to object being added to containers.
>
> After much tinkering, it does seem to me that this directive
>
>
On Fri, 14 Oct 2005 16:36:45 +0200, gnotari wrote
> > On Fri, 14 Oct 2005 15:36:09 +0200, gnotari wrote
> > > I'm at loss:
> > >
> > > I'm replicating the example at cap. 14.3 of Philipp's (Worldcookery)
> > > book. It's all about auto-assigning names to object being added to
> > containers.
> > >
> Sorry, but it does not solve.
> I checked your code, and indeed I implemented the same way.
> Indeed, my code works if I make it generate arbitrary names.
>
> It just does not work if I try to name a new object after one of its
> attributes because:
> - the attribute value is not set at the time
I think the answer to that question is both, but X['Y'] seem to have
precedents over X.Y.
class MyContainer(OOBTree):
title=u''
class MyContent(Persistent):
title=u''
Adding MyContent in MyContainer you can traverse MyContainer/MyContent/title
or you can traverse MyContainer/title equall
Achim,
Take a look at homefolder in the trunk. You can find it here:
http://svn.zope.org/Zope3/trunk/src/zope/app/homefolder/
It does what you want to do.
On Fri, 07 Apr 2006 16:50:50 +0200, Achim Domma wrote
> Frank Burkhardt wrote:
>
> >> Do I understand it right, that I do not grant a perm
I'm trying to do a join form with formlib and are getting errors when checking
invariants.
I have my form interface IJoinForm
class IJoinForm(Interface):
"""a join form"""
username = schema.TextLine(
title=_('User Name'),
required=True)
password = schema.Password(
or):
> u"""From-Date is after To-Date"""
>
> # this is needed to adapt to a view for formlib
> implements(IWidgetInputError)
>
> On 03.05.2006, at 20:59, mats.nordgren wrote:
>
> > I'm trying to do a join form with forml
>line 23, in IWorkspace value_type=Object(title=u"Object",
> description=u"adsf"),
in zope/schema/_field.py
class Object(Field):
__doc__ = IObject.__doc__
implements(IObject)
def __init__(self, schema, **kw): < you need to pass a schema as a non
key-word
if not IInte
Look at form.txt in the formlib directory.
On Wed, 17 May 2006 11:24:43 -0500, Jachin Rupe wrote
> hi there
>
> thanks for the help. I was just reading somewhere that formlib is
> the way to go. Is that the general consensus?
>
> The problem is, it doesn't look like formlib is covered in eit
> (Pdb) catalog.searchResults(AbbreviationIndex = "ABC")
> *** TypeError: ('two-length tuple expected', 'ABC')
> (Pdb) catalog.searchResults(["AbbreviationIndex" ,"ABC"])
> *** TypeError: searchResults() takes exactly 1 argument (2 given)
> (Pdb) res = catalog.searchResults()
> (Pdb) res == None
My bad, should be
catalog.searchResults(AbbreviationIndex=('ABC', 'ABC')
Field indices expect a high and low as Alen stated
Sincerely,
Mats
On Sun, 21 May 2006 18:49:46 +0200, Florian Lindner wrote
> Am Sonntag, 21. Mai 2006 17:58 schrieb mats.nordgren:
> >
This seems to work
class EditForm(form.EditForm):
form_fields = form.Fields(ISchema)
def __init__(self, context, request):
self.context, self.request = context, request
@form.action('Edit')
def handle_edit_action(self, action, data):
if data['image'] != None:
self.context.i
I've been trying to use NameChooser with formlibs AddForm and it always tells
me "An empty name was provided. Names cannot be empty."
I suspect it has to do with set_before_add as my object comes in to the
NameChooser without data. Problem is that you define formlib forms with http://mail.zope.or
Never mind it was a user error on my part.
I was stuffing the data variables in the create function into the context not
the object being created. Oooops :)
On Fri, 26 May 2006 13:02:42 -0500, mats.nordgren wrote
> I've been trying to use NameChooser with formlibs AddForm and it
> a
Miklos,
You should be able to customize the form 'loginform.pt' from zope.app.authentication.browser. In the session credentials plugin you can then specify the new login form name.
Cheers,
Mats
On Tue, 6 Jun 2006 23:11:18 +0200, Jegenye 2001 Bt (Miklós Prisznyák) wrote
> Hello,
>
you can
> set up your own login form to be associated with your particular
> site base object, if you don't want the login page to have to
> service logins for the whole of your zope3 instance, but just a
> particular subsite.
>
> Pete
>
> On 6/7/06, mats.nordgren &
Frank,
Try this:
role_map = IPrincipalRoleManager(context) <== For example root of site.
role_map.assignRoleToPrincipal(u'mpgsite.Authenticated', principal_id)
I use the above code in an event handler when a site has been created.
Instead of specifying the user I specify a group and then add ea
I'm totally clueless as how to get a dict widget to work.
class IMyObject(Interface):
mydict = Dict(
title=u'My Dict',
key_type=TextLine(),
value_type=Int())
I see in zope.app.form.browser the config file has no view defined for IDict
and ?IField?. Is it just a matter of configurin
Marco,
You need to pass the id not the principal object.
principalRoleManager.getRolesForPrincipal(self.request.principal.id)
Cheers,
Mats
On Wed, 14 Jun 2006 20:00:40 +0200, Marco Mariani wrote
> How do I get the list of roles for the current principal?
>
> I've tried
>
> from zope.app.secu
Frank,
That would be great. If you wish you can email it to me.
This should be included in the trunk IMHO.
Thanks,
Mats
On Wed, 14 Jun 2006 21:19:54 +0200, Frank Burkhardt wrote
> Hi,
>
> On Wed, Jun 14, 2006 at 12:39:34PM -0500, mats.nordgren wrote:
> > I'm totally clue
I'm not sure this is it or not but FieldProperty doesn't play nice with the
persistent list and dict, it will only accept the non persistent list.
>>> class ITest(Interface):
... mylist = List(title=u'My List')
...
>>> class Test(Persistent):
... implements(ITest)
... mylist = FieldPro
I've tried to get WingIDE to work for debugging Zope3 but have only had
limited success. I've followed the instructions at wingware.com where it
tells you to add the wingdbstub. I added 'import wingdbstub' in
$ZOPEINSTANCE/bin/runzope and it will break on errors but will not break on
breakpoints.
John,
I have never done it with the addform approach but it is very easily done with formlib.
class MyContentAddForm(form.AddForm):
form_fields = form.Fields(IMyContent)
def __init__(self, context, request):
self.context = context
self.request = request
def create(self, data):
Ooops that should be
for="">zope.app.container.interfaces.IAdding"
name="AddContent.html"
class=".forms.MyContentAddForm"
permission="zope.ManageContent" />
Mats
On Tue, 20 Jun 2006 23:37:35 -0500, mats.nordgren wrote
>
John,
&
The IntId subscribers are fired on
zope.app.container.interfaces.IObjectAddedEvent and IObjectRemovedEvent.
Cheers,
Mats
On Mon, 25 Sep 2006 18:55:11 +0200, Volker Bachschneider wrote
> Philipp von Weitershausen schrieb:
> > John Maddison wrote:
> >> Is it possible/wise to "auto-create" content
Never knew about IPython and really like what I see. Thanks for the hint. I
got the debugging to work for Zope3 with the following simple change to the
tutorial.
IPython.Shell.IPShell(user_ns=locals()).mainloop(sys_exit=1)
to
IPython.Shell.IPShell(user_ns={'root': root, 'app': app}).mainloop(
26 matches
Mail list logo