IRC log of #zope3-dev for Saturday, 2005-08-06

*** suresh has quit IRC00:00
*** bradb has quit IRC00:00
*** bradb has joined #zope3-dev00:01
*** suresh has joined #zope3-dev00:01
*** douglasc has quit IRC00:13
*** sashav has quit IRC00:15
dman13I'm looking for information about creating sites.  Google didn't turn up anything useful with my search, and parts of zope.org are inaccessible.  Any pointers?  Thanks!00:21
*** suresh has quit IRC00:22
*** suresh has joined #zope3-dev00:23
GaryPosterHey Derrick.  I don't have a doc to point you to (too bad zope/app/site doesn.  I know a bit about it, and will be happy to try and answer pointed questions :-)00:24
GaryPosteroops00:24
GaryPosterthat was supposed to be an insert of "'t seem to have any useful docs)" :-)00:24
dman13ok.  #1: how do I create a site?00:25
GaryPosterlol00:25
dman13what do I need to be aware of running a zope instance with more than one site?00:25
GaryPosterThrough the web or in code?00:25
dman13so far I've only used the default site that's there when zope starts00:25
dman13ttw is sufficient00:25
GaryPosterOK:00:26
dman13btw, I'm now using 3.1c100:26
GaryPosteradd a folder00:26
GaryPoster(OK, I'm on the head)00:26
GaryPosterclick on the folder00:26
dman13probably close enough :-)00:26
GaryPosterYup :-) on the top right you should see a link to "Make a site"00:27
GaryPosterIt "converts" the folder to a site--slamming an interface on it and putting the necessary goop on an __ attribute if I remember correctly00:27
GaryPoster2) issues:00:28
dman13ok00:28
GaryPosterUm, that's kinda deep, and kinda different on how you use the sites.  For instance,00:28
dman13:-)00:28
dman13since I haven't touched that aspect of z3 yet I was looking to learn00:28
dman13I think what I want, for now, is to simplfy admin work00:29
dman13and have, for example, a wiki and a mail administrator in the same z3 instance but to not be inter-related00:29
dman13(mail admin is just a pretty way to change ldap records)00:29
dman13the two need different skins, but could use the same auth00:30
GaryPosterIf you put an intid utility in two sites, then two objects in your Zope might have the same intid, one in one site and one in the other.  This would wreak havoc on trying to merge catalog results between the two sites, for instance.00:30
GaryPosterI see00:30
SteveAsites are, like, total crack00:30
* SteveA goes on his crack crusade00:31
dman13I see in the new site-management folder I can actually use different auth mechanisms for each site00:31
GaryPosterSo, it sounds like you might want to put all your main utilities in the top site00:31
dman13so ... sites kill you or they make you feel good (temporarily)?00:31
dman13;-)00:31
GaryPosterStaveA: lol00:31
GaryPosterSo it sounds like you just want to get one skin in one site and another in skin in another00:32
* benji_york wonders what rock cocane has to do with sites00:32
GaryPosterYou can do that without sites00:32
dman13I suppose I should take a step back ... should I just use separate instances of z3 or should I use sites or should I just stick the objects in the default site?  (the objects mainly being a 'wiki' object, a 'mailadmin' object and sometime later a 'schoolbell calendar' object)00:33
GaryPosterNot the most intuitive thing in the world yet--remember we have little to no TTW story00:33
dman13right00:33
dman13I know that apache can put the skins in the URL00:33
SteveAin the future, this stuff should work so that you register these things rooted at particular urls, rooted at particular portions of the ZODB, all registered in zcml00:33
SteveAno need for TTW sites00:33
SteveAno need for folders created to put things at the URLs you want00:34
GaryPosterSteveA: weren't you doing that at one point?00:34
SteveAyes00:34
GaryPosterwhat happened? :-)00:34
GaryPosterlife and work, I suppose?00:34
SteveAyeah00:34
GaryPosteraw, that's silly. ;-)00:35
GaryPosterdman13: I'd try putting them all in the top site until you discover how that doesn't work for you00:35
SteveAi've currently resigned myself to writing it up on the launchpad wiki, so that others can see where i'm going with this stuff, and maybe implement things in that direction.00:35
dman13GaryPoster: ok, I'll just do that then.00:36
dman13I knew sites were "out there" and I had a bit of time available so I thought I'd learn about them and see if/how they apply00:36
SteveAphiliKON: the irc channel title says "help translate Zope 3.1...", but doesn't have a link to a page saying how to do so.00:36
d2mSteveA: i just changed the topic, did i delete something ? there is a link to the posting describing how to help with translation, including links00:38
d2msorry, thought you ment the #zope channel00:39
*** douglasc has joined #zope3-dev00:40
SteveAd2m: cool.  there are more people on #zope anyway00:40
*** suresh has quit IRC00:44
*** niemeyer has quit IRC00:58
*** GaryPoster has quit IRC01:00
*** sm has joined #zope3-dev01:10
*** Aiste has quit IRC01:10
*** Aiste has joined #zope3-dev01:11
*** Aiste has quit IRC01:25
*** benji_york has quit IRC01:30
*** sm has left #zope3-dev01:37
*** d2m has quit IRC01:55
*** bradb has quit IRC02:08
*** BjornT has quit IRC02:14
*** SteveA has quit IRC02:29
*** stub has quit IRC02:29
*** douglasc has quit IRC02:42
*** yota has quit IRC02:54
*** projekt01 has quit IRC04:07
*** guido_g has quit IRC04:29
*** mexiKON has joined #zope3-dev07:55
*** philiKON has quit IRC08:05
*** roym has quit IRC08:37
*** timte has joined #zope3-dev08:47
*** jhauser has quit IRC09:20
*** d2m has joined #zope3-dev10:03
*** sashav has joined #zope3-dev10:09
*** mexiKON has quit IRC11:56
*** jhauser has joined #zope3-dev12:01
*** philiKON has joined #zope3-dev12:21
*** jhauser has quit IRC12:27
*** hdima has joined #zope3-dev12:46
*** sashav_ has joined #zope3-dev13:12
*** projekt01 has joined #zope3-dev13:14
*** sashav__ has joined #zope3-dev13:15
*** sashav_ has quit IRC13:22
*** sashav has quit IRC13:25
*** yota has joined #zope3-dev14:30
*** guido_g has joined #zope3-dev14:43
*** hdima has quit IRC15:41
srichterphiliKON: I just noticed that you totally misread the devmode proposal the first time15:57
srichterI was suggesting all the time to use a ZCML feature, merely the method of inclusion of that feature was the point of discussion15:58
*** theuni has quit IRC16:48
*** Theuni has joined #zope3-dev16:48
*** jhauser has joined #zope3-dev17:07
*** Theuni has quit IRC17:20
*** Theuni has joined #zope3-dev17:21
*** Theuni has quit IRC17:21
*** Theuni has joined #zope3-dev17:22
*** sashav__ has quit IRC17:50
*** roym has joined #zope3-dev18:18
roymGentlemen, I have the following schema declaration for a member variable18:19
roym18:19
roym  | specialties = List(18:19
roym  |   title=u"Specialties",18:19
roym  |   value_type=Choice(title=u"Specialties", vocabulary="specialties"))18:19
roym18:19
roymHowever, any attempt to assign a value to the specialties field results18:19
roymin an error; what am I missing?18:19
roym18:19
roym  | choice0 = Choice(values=[u'EM'])18:19
roym  | qdatum.specialties= [choice0]18:19
roym  |18:19
roym  | zope.schema.interfaces.WrongContainedType: [<zope.schema._field.Choice object at 0x401e470c>]o18:19
*** Theuni has quit IRC18:19
wiggyhow about giving the schema an id18:20
wiggyyou only give it a title18:20
roymwiggy: not sure that I understand...18:21
roymare you saying that the specialties field needs an id?18:21
wiggylook at the documentation and compare with what you're doing18:22
srichterroym: you got it wrong :-)18:22
srichterclass IFoo(Interface):18:23
srichter  list = List(value_type=Choice(title=u"Specialties", values=[1, 2, 3])18:23
srichter18:23
srichterclass Foo(object):18:24
srichter  implements(IFoo)18:24
srichter  list = []18:24
srichter18:24
srichterfoo = Foo()18:24
srichterfoo.list = [1, 2]18:24
srichter18:24
wiggyreplace list with specialties18:24
srichterOf course there is no validation going on right now18:24
srichteryou can use field properties for this:18:25
srichterclass Foo(object):18:25
srichter  implements(IFoo)18:25
roymaha: I think I see why.18:25
srichter  list = FieldProperty(IFoo['list'])18:25
srichter18:25
srichterfoo = Foo()18:25
srichterfoo.list = [1, 2]18:25
srichterfoo.list = [1, 2, 4]18:25
srichtershould raise error here18:26
roymIn my implementation object, I didn't declare a default value...18:26
roymthere was no variable to assign to...18:26
bob2what's the advantage of using a FieldProperty instead of just using it on Foo directly?18:26
srichterbob2: the value gets validated on assignment18:27
bob2oh, of course18:27
srichterroym: Note that you cannot use the Choice field as a value for your object18:33
srichterParticularly those lines are plain wrong:18:33
srichter| choice0 = Choice(values=[u'EM'])18:33
srichter| qdatum.specialties= [choice0]18:34
srichterit should be:18:34
roymsrichter: I did try plain old ['EM'] and [u'EM'] - to no avail18:34
srichterqdatum.specialties = [u'EM']18:34
srichterno this should work18:34
roymI took your suggestion and changed the code to use a list of values - it worked.18:35
roymie: qdatum.specialties=['EM'] was OK18:35
srichterwell, with a vocabulary you need more setup18:35
srichternote that the values are converted to a simple vocabulary anyways18:35
roymindeed - thats what I am struggling with...18:35
*** sm has joined #zope3-dev18:36
srichterbut when you specify a string as a vocabulary, you must provide a vocabulary of that name as a utility18:36
roymI did:18:36
roymxmlconfig.file('meta.zcml', zope.app.schema)18:36
roymxmlconfig.file('/var/lib/zope3/instances/instance1/etc/site.zcml')18:36
roymshouldn't that take care of making the test harness "vocabulary aware"?18:37
roymAfter executing the zcml code above, the following lines work:18:40
roym | from zope.app import zapi18:40
roym | from zope.app.schema.vocabulary import IVocabularyFactory18:40
roym | spVocab = zapi.getUtility(IVocabularyFactory, 'specialties')('junk-context')18:40
roym | print [e.value for e in list(spVocab)]18:40
roymso I am assuming that is all the setup I need.18:41
roymare there any unit tests that exercise this scenario that I might look at?18:44
*** MrTopf has joined #zope3-dev19:35
philiKONroym, um, why are you executing site.zcml?!19:41
philiKONyou should do: xmlconfig.file('meta.zcml', zope.app.schema) ; xmlconfig.string("""<configure ...><vocabulary ... /> </configure>""")19:42
philiKONor, instead of that last xmlconfig.string(), do a xmlconfig.file('configure.zcml', my.package) if that configure.zcml works when loading in a test19:42
philiKON(but probably it won't)19:42
roymphiliKON: I did try narrowing the configfile directives to my package, viz:19:47
roymxmlconfig.file('configure.zcml', anoobe.quiztaker)19:47
roymbut I get:19:47
roym  ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/zope', u'content')19:48
roymand I am not sure how to work around that.19:48
philiKONroym, well, if you really only need to set up the vocuablary19:49
philiKONjust use xmlconfig.string19:49
philiKONand include the ZCML strin gfor the vocabulary directive19:50
roymthanks - I will try that.19:50
MrTopfhi19:51
philiKONMrTopf, hi19:52
* MrTopf somehow did choose an ugly hotel in munich ;-)19:52
philiKONouch19:53
philiKON*MrTopf (~cs@ehw.hotels-on-air.de) has joined #zope3-dev19:53
philiKONfunny19:53
MrTopf10EUR/day for that19:53
philiKON:(19:53
roymphiliKON: when I try executing a string, I get:19:54
MrTopfwell, won't need it that often and might choose some icafe19:54
roym  ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/zope', u'vocabulary')19:54
roymSeems like I have a bootstrap problem19:54
roymof making my directives known.19:54
philiKONroym, <configure ...><include package="zope.app.schema" file="meta.zcml" /> <vocabulary ... /> </configure>19:54
roymaha - I see.... thanks19:55
MrTopfbtw, in Five/Z2.8.1: when do I have to derive my adapter from object actually?19:55
philiKONsrichter, by the way, is somewhere in the release notes of 3.1.0 explained what happened with securitypolicy.zcml?19:55
MrTopfjust noticed that it won't work for a class without that19:55
philiKONMrTopf, huh?19:55
philiKONMrTopf, deriving from object or not is optional19:56
philiKONIOW, new-style classes are optional for adapters19:56
MrTopfwell, it said in my test that it cannot adapt19:56
MrTopfI though so, too19:56
MrTopfand it was working before without, e.g. in the FiveDemo19:56
philiKONare you sure it's becausde of that?!?19:56
MrTopfI will test it again19:56
MrTopfok, now it's also working without19:58
MrTopfthat's very strange now because I think I did not change anything except that19:58
MrTopfI really should use svn with that project so I can track that down20:02
MrTopfOTOH I wouldn't have checked in a not working version20:03
MrTopfbut I think I have the difference now. If do "from dummy import IMyInterface" it does not work, if I give the absolute path to dummy then it works..20:03
MrTopfmaybe some different dummy.py is somewhere in the way20:04
MrTopfnope, dummy2 also does not work, full path like Products.MyProducts.tests.dummy works20:06
MrTopfstrange..20:06
philiKONMrTopf, python absolute import weirdness20:08
philiKONMrTopf, i've gotten used to *always* using the full import pat20:08
philiKONh20:08
MrTopfannoying if you e.g. rename it or so20:08
philiKONyes20:10
MrTopfwell, one need to know that ;-)20:12
MrTopfbut is it only with interfaces, adapters?20:12
MrTopfor does it also make problems otherwise? because for me it's the first time I think20:12
*** sm has quit IRC20:16
philiKONit happens all the time20:16
philiKONbut in z2 it isn't that much relevant when objects aren't the same20:17
*** sm has joined #zope3-dev20:17
philiKONin z3 with the meaning of interfaces it is20:17
roymI am getting a rather strange error (to do with "chickens" :) when I20:24
roymuse the xmlconfig.string() function:20:24
roym20:24
roym  File "/usr/local/Zope3-trunk/src/zope/configuration/config.py", line 184, in resolve20:24
roym    mod = __import__(mname, *_import_chickens)20:24
roym  zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "<string>", line 25.3-28.5420:24
roym    ValueError: Empty module name20:24
roym20:24
roymSeems like I am missing a way to tell the system what module the ZCML20:24
roymconfiguration belongs to... is this correct?20:24
roym20:24
roymMy call looks like this:20:28
roym  | xmlconfig.string('''20:28
roym  | <configure20:28
roym  |    xmlns="http://namespaces.zope.org/zope"20:28
roym  |    i18n_domain="quiztaker">20:28
roym  |    <include package="zope.app.schema" file="meta.zcml" />20:28
roym  |    <include package="zope.app.component" file="meta.zcml" />20:28
roym  |    <configure directives for vocabulary...>20:28
roym  |    <:configure directives for adapters...>20:28
roym  |   <include package=".parser"/>20:28
roym  | </configure>20:28
roym  | ''')20:28
*** SureshZ has joined #zope3-dev20:31
philiKONroym, do you rconfigure directives for vocabularies / adapters use the '.' prefix for dotted names?20:35
roymyes - should I switch to absolute naming?20:38
*** suresh has joined #zope3-dev20:38
philiKONroym, yes20:38
roymmany thanks.20:38
philiKONroym, zcml wouldn't know how to interpret the '.'20:38
philiKONso, you either pass a package as context20:38
philiKONor use <configure package="..."> in the zcml string20:38
philiKONor use absolute dotted names20:39
roymok20:42
*** SureshZ has quit IRC20:45
*** SureshZ has joined #zope3-dev20:46
*** suresh has quit IRC20:51
*** MrTopf has quit IRC20:51
*** suresh has joined #zope3-dev20:51
*** SureshZ has quit IRC20:56
*** SureshZ has joined #zope3-dev20:57
*** suresh has quit IRC21:02
roymDoes anyone know what zcml file makes the zope.ManageContent21:10
roympermission known to my tests. I have tried:21:10
roym21:10
roymxmlconfig.string('''21:10
roym  <include package="zope.app.security"     file="meta.zcml"      />21:10
roym  ... ''')21:10
roym21:10
roymbut I am still looking at:21:10
roym21:10
roym  File "/usr/local/Zope3-trunk/src/zope/app/security/permission.py",21:10
roym    line 124, in checkPermission21:10
roym    raise ValueError("Undefined permission id", permission_id)21:10
roym  zope.configuration.config.ConfigurationExecutionError:21:10
roym    exceptions.ValueError: ('Undefined permission id',21:10
roym    'zope.ManageContent')21:10
roymNever mind - I found that I can simply say:21:14
roym    <include package="zope.app.security"     file="configure.zcml"      />21:14
roymand that takes care of it...21:15
roym(note: this needs to be in addition to the meta.zcml include).21:15
*** suresh has joined #zope3-dev21:32
*** SureshZ has quit IRC21:40
*** SureshZ has joined #zope3-dev21:43
*** suresh has quit IRC21:50
philiKONroym, yep. so that the <permission /> directive is also known22:01
*** projekt01 has quit IRC22:01
*** projekt01 has joined #zope3-dev22:01
*** suresh has joined #zope3-dev22:04
*** tav has joined #zope3-dev22:06
*** GvaderTH has joined #zope3-dev22:08
GvaderTHHi22:08
philiKONhi22:09
*** SureshZ has quit IRC22:19
*** SureshZ has joined #zope3-dev22:20
*** suresh has quit IRC22:27
*** suresh has joined #zope3-dev22:27
*** alienoid has joined #zope3-dev22:33
*** SureshZ has quit IRC22:34
*** suresh has left #zope3-dev22:35
*** SureshZ has joined #zope3-dev22:35
alienoidhi22:37
philiKONhey alienoid22:37
alienoidhi philiKON22:39
*** suresh has joined #zope3-dev22:47
*** SureshZ has quit IRC22:55
roymGentlemen, What incantation should I use to specify a single valued23:52
roymchoice, so that preferably a radio button is shown in the edit view,23:52
roymsomewhat like the following spec for a multi-valued field:23:52
roym23:52
roym  | specialties = List(23:52
roym  |   title=u"Specialties",23:52
roym  |   unique=True,23:52
*** suresh has quit IRC23:52
roym  |   value_type=Choice(title=u"Specialties", vocabulary="specialties"),)23:52
*** suresh has joined #zope3-dev23:52
*** yota has quit IRC23:58
*** yota has joined #zope3-dev23:59

Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!