*** suresh has quit IRC | 00:00 | |
*** bradb has quit IRC | 00:00 | |
*** bradb has joined #zope3-dev | 00:01 | |
*** suresh has joined #zope3-dev | 00:01 | |
*** douglasc has quit IRC | 00:13 | |
*** sashav has quit IRC | 00:15 | |
dman13 | I'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 IRC | 00:22 | |
*** suresh has joined #zope3-dev | 00:23 | |
GaryPoster | Hey 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 |
GaryPoster | oops | 00:24 |
GaryPoster | that was supposed to be an insert of "'t seem to have any useful docs)" :-) | 00:24 |
dman13 | ok. #1: how do I create a site? | 00:25 |
GaryPoster | lol | 00:25 |
dman13 | what do I need to be aware of running a zope instance with more than one site? | 00:25 |
GaryPoster | Through the web or in code? | 00:25 |
dman13 | so far I've only used the default site that's there when zope starts | 00:25 |
dman13 | ttw is sufficient | 00:25 |
GaryPoster | OK: | 00:26 |
dman13 | btw, I'm now using 3.1c1 | 00:26 |
GaryPoster | add a folder | 00:26 |
GaryPoster | (OK, I'm on the head) | 00:26 |
GaryPoster | click on the folder | 00:26 |
dman13 | probably close enough :-) | 00:26 |
GaryPoster | Yup :-) on the top right you should see a link to "Make a site" | 00:27 |
GaryPoster | It "converts" the folder to a site--slamming an interface on it and putting the necessary goop on an __ attribute if I remember correctly | 00:27 |
GaryPoster | 2) issues: | 00:28 |
dman13 | ok | 00:28 |
GaryPoster | Um, that's kinda deep, and kinda different on how you use the sites. For instance, | 00:28 |
dman13 | :-) | 00:28 |
dman13 | since I haven't touched that aspect of z3 yet I was looking to learn | 00:28 |
dman13 | I think what I want, for now, is to simplfy admin work | 00:29 |
dman13 | and have, for example, a wiki and a mail administrator in the same z3 instance but to not be inter-related | 00:29 |
dman13 | (mail admin is just a pretty way to change ldap records) | 00:29 |
dman13 | the two need different skins, but could use the same auth | 00:30 |
GaryPoster | If 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 |
GaryPoster | I see | 00:30 |
SteveA | sites are, like, total crack | 00:30 |
* SteveA goes on his crack crusade | 00:31 | |
dman13 | I see in the new site-management folder I can actually use different auth mechanisms for each site | 00:31 |
GaryPoster | So, it sounds like you might want to put all your main utilities in the top site | 00:31 |
dman13 | so ... sites kill you or they make you feel good (temporarily)? | 00:31 |
dman13 | ;-) | 00:31 |
GaryPoster | StaveA: lol | 00:31 |
GaryPoster | So it sounds like you just want to get one skin in one site and another in skin in another | 00:32 |
* benji_york wonders what rock cocane has to do with sites | 00:32 | |
GaryPoster | You can do that without sites | 00:32 |
dman13 | I 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 |
GaryPoster | Not the most intuitive thing in the world yet--remember we have little to no TTW story | 00:33 |
dman13 | right | 00:33 |
dman13 | I know that apache can put the skins in the URL | 00:33 |
SteveA | in 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 zcml | 00:33 |
SteveA | no need for TTW sites | 00:33 |
SteveA | no need for folders created to put things at the URLs you want | 00:34 |
GaryPoster | SteveA: weren't you doing that at one point? | 00:34 |
SteveA | yes | 00:34 |
GaryPoster | what happened? :-) | 00:34 |
GaryPoster | life and work, I suppose? | 00:34 |
SteveA | yeah | 00:34 |
GaryPoster | aw, that's silly. ;-) | 00:35 |
GaryPoster | dman13: I'd try putting them all in the top site until you discover how that doesn't work for you | 00:35 |
SteveA | i'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 |
dman13 | GaryPoster: ok, I'll just do that then. | 00:36 |
dman13 | I 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 apply | 00:36 |
SteveA | philiKON: 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 |
d2m | SteveA: i just changed the topic, did i delete something ? there is a link to the posting describing how to help with translation, including links | 00:38 |
d2m | sorry, thought you ment the #zope channel | 00:39 |
*** douglasc has joined #zope3-dev | 00:40 | |
SteveA | d2m: cool. there are more people on #zope anyway | 00:40 |
*** suresh has quit IRC | 00:44 | |
*** niemeyer has quit IRC | 00:58 | |
*** GaryPoster has quit IRC | 01:00 | |
*** sm has joined #zope3-dev | 01:10 | |
*** Aiste has quit IRC | 01:10 | |
*** Aiste has joined #zope3-dev | 01:11 | |
*** Aiste has quit IRC | 01:25 | |
*** benji_york has quit IRC | 01:30 | |
*** sm has left #zope3-dev | 01:37 | |
*** d2m has quit IRC | 01:55 | |
*** bradb has quit IRC | 02:08 | |
*** BjornT has quit IRC | 02:14 | |
*** SteveA has quit IRC | 02:29 | |
*** stub has quit IRC | 02:29 | |
*** douglasc has quit IRC | 02:42 | |
*** yota has quit IRC | 02:54 | |
*** projekt01 has quit IRC | 04:07 | |
*** guido_g has quit IRC | 04:29 | |
*** mexiKON has joined #zope3-dev | 07:55 | |
*** philiKON has quit IRC | 08:05 | |
*** roym has quit IRC | 08:37 | |
*** timte has joined #zope3-dev | 08:47 | |
*** jhauser has quit IRC | 09:20 | |
*** d2m has joined #zope3-dev | 10:03 | |
*** sashav has joined #zope3-dev | 10:09 | |
*** mexiKON has quit IRC | 11:56 | |
*** jhauser has joined #zope3-dev | 12:01 | |
*** philiKON has joined #zope3-dev | 12:21 | |
*** jhauser has quit IRC | 12:27 | |
*** hdima has joined #zope3-dev | 12:46 | |
*** sashav_ has joined #zope3-dev | 13:12 | |
*** projekt01 has joined #zope3-dev | 13:14 | |
*** sashav__ has joined #zope3-dev | 13:15 | |
*** sashav_ has quit IRC | 13:22 | |
*** sashav has quit IRC | 13:25 | |
*** yota has joined #zope3-dev | 14:30 | |
*** guido_g has joined #zope3-dev | 14:43 | |
*** hdima has quit IRC | 15:41 | |
srichter | philiKON: I just noticed that you totally misread the devmode proposal the first time | 15:57 |
srichter | I was suggesting all the time to use a ZCML feature, merely the method of inclusion of that feature was the point of discussion | 15:58 |
*** theuni has quit IRC | 16:48 | |
*** Theuni has joined #zope3-dev | 16:48 | |
*** jhauser has joined #zope3-dev | 17:07 | |
*** Theuni has quit IRC | 17:20 | |
*** Theuni has joined #zope3-dev | 17:21 | |
*** Theuni has quit IRC | 17:21 | |
*** Theuni has joined #zope3-dev | 17:22 | |
*** sashav__ has quit IRC | 17:50 | |
*** roym has joined #zope3-dev | 18:18 | |
roym | Gentlemen, I have the following schema declaration for a member variable | 18:19 |
roym | 18:19 | |
roym | | specialties = List( | 18:19 |
roym | | title=u"Specialties", | 18:19 |
roym | | value_type=Choice(title=u"Specialties", vocabulary="specialties")) | 18:19 |
roym | 18:19 | |
roym | However, any attempt to assign a value to the specialties field results | 18:19 |
roym | in an error; what am I missing? | 18:19 |
roym | 18: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>]o | 18:19 |
*** Theuni has quit IRC | 18:19 | |
wiggy | how about giving the schema an id | 18:20 |
wiggy | you only give it a title | 18:20 |
roym | wiggy: not sure that I understand... | 18:21 |
roym | are you saying that the specialties field needs an id? | 18:21 |
wiggy | look at the documentation and compare with what you're doing | 18:22 |
srichter | roym: you got it wrong :-) | 18:22 |
srichter | class IFoo(Interface): | 18:23 |
srichter | list = List(value_type=Choice(title=u"Specialties", values=[1, 2, 3]) | 18:23 |
srichter | 18:23 | |
srichter | class Foo(object): | 18:24 |
srichter | implements(IFoo) | 18:24 |
srichter | list = [] | 18:24 |
srichter | 18:24 | |
srichter | foo = Foo() | 18:24 |
srichter | foo.list = [1, 2] | 18:24 |
srichter | 18:24 | |
wiggy | replace list with specialties | 18:24 |
srichter | Of course there is no validation going on right now | 18:24 |
srichter | you can use field properties for this: | 18:25 |
srichter | class Foo(object): | 18:25 |
srichter | implements(IFoo) | 18:25 |
roym | aha: I think I see why. | 18:25 |
srichter | list = FieldProperty(IFoo['list']) | 18:25 |
srichter | 18:25 | |
srichter | foo = Foo() | 18:25 |
srichter | foo.list = [1, 2] | 18:25 |
srichter | foo.list = [1, 2, 4] | 18:25 |
srichter | should raise error here | 18:26 |
roym | In my implementation object, I didn't declare a default value... | 18:26 |
roym | there was no variable to assign to... | 18:26 |
bob2 | what's the advantage of using a FieldProperty instead of just using it on Foo directly? | 18:26 |
srichter | bob2: the value gets validated on assignment | 18:27 |
bob2 | oh, of course | 18:27 |
srichter | roym: Note that you cannot use the Choice field as a value for your object | 18:33 |
srichter | Particularly those lines are plain wrong: | 18:33 |
srichter | | choice0 = Choice(values=[u'EM']) | 18:33 |
srichter | | qdatum.specialties= [choice0] | 18:34 |
srichter | it should be: | 18:34 |
roym | srichter: I did try plain old ['EM'] and [u'EM'] - to no avail | 18:34 |
srichter | qdatum.specialties = [u'EM'] | 18:34 |
srichter | no this should work | 18:34 |
roym | I took your suggestion and changed the code to use a list of values - it worked. | 18:35 |
roym | ie: qdatum.specialties=['EM'] was OK | 18:35 |
srichter | well, with a vocabulary you need more setup | 18:35 |
srichter | note that the values are converted to a simple vocabulary anyways | 18:35 |
roym | indeed - thats what I am struggling with... | 18:35 |
*** sm has joined #zope3-dev | 18:36 | |
srichter | but when you specify a string as a vocabulary, you must provide a vocabulary of that name as a utility | 18:36 |
roym | I did: | 18:36 |
roym | xmlconfig.file('meta.zcml', zope.app.schema) | 18:36 |
roym | xmlconfig.file('/var/lib/zope3/instances/instance1/etc/site.zcml') | 18:36 |
roym | shouldn't that take care of making the test harness "vocabulary aware"? | 18:37 |
roym | After executing the zcml code above, the following lines work: | 18:40 |
roym | | from zope.app import zapi | 18:40 |
roym | | from zope.app.schema.vocabulary import IVocabularyFactory | 18:40 |
roym | | spVocab = zapi.getUtility(IVocabularyFactory, 'specialties')('junk-context') | 18:40 |
roym | | print [e.value for e in list(spVocab)] | 18:40 |
roym | so I am assuming that is all the setup I need. | 18:41 |
roym | are there any unit tests that exercise this scenario that I might look at? | 18:44 |
*** MrTopf has joined #zope3-dev | 19:35 | |
philiKON | roym, um, why are you executing site.zcml?! | 19:41 |
philiKON | you should do: xmlconfig.file('meta.zcml', zope.app.schema) ; xmlconfig.string("""<configure ...><vocabulary ... /> </configure>""") | 19:42 |
philiKON | or, instead of that last xmlconfig.string(), do a xmlconfig.file('configure.zcml', my.package) if that configure.zcml works when loading in a test | 19:42 |
philiKON | (but probably it won't) | 19:42 |
roym | philiKON: I did try narrowing the configfile directives to my package, viz: | 19:47 |
roym | xmlconfig.file('configure.zcml', anoobe.quiztaker) | 19:47 |
roym | but I get: | 19:47 |
roym | ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/zope', u'content') | 19:48 |
roym | and I am not sure how to work around that. | 19:48 |
philiKON | roym, well, if you really only need to set up the vocuablary | 19:49 |
philiKON | just use xmlconfig.string | 19:49 |
philiKON | and include the ZCML strin gfor the vocabulary directive | 19:50 |
roym | thanks - I will try that. | 19:50 |
MrTopf | hi | 19:51 |
philiKON | MrTopf, hi | 19:52 |
* MrTopf somehow did choose an ugly hotel in munich ;-) | 19:52 | |
philiKON | ouch | 19:53 |
philiKON | *MrTopf (~cs@ehw.hotels-on-air.de) has joined #zope3-dev | 19:53 |
philiKON | funny | 19:53 |
MrTopf | 10EUR/day for that | 19:53 |
philiKON | :( | 19:53 |
roym | philiKON: when I try executing a string, I get: | 19:54 |
MrTopf | well, won't need it that often and might choose some icafe | 19:54 |
roym | ConfigurationError: ('Unknown directive', u'http://namespaces.zope.org/zope', u'vocabulary') | 19:54 |
roym | Seems like I have a bootstrap problem | 19:54 |
roym | of making my directives known. | 19:54 |
philiKON | roym, <configure ...><include package="zope.app.schema" file="meta.zcml" /> <vocabulary ... /> </configure> | 19:54 |
roym | aha - I see.... thanks | 19:55 |
MrTopf | btw, in Five/Z2.8.1: when do I have to derive my adapter from object actually? | 19:55 |
philiKON | srichter, by the way, is somewhere in the release notes of 3.1.0 explained what happened with securitypolicy.zcml? | 19:55 |
MrTopf | just noticed that it won't work for a class without that | 19:55 |
philiKON | MrTopf, huh? | 19:55 |
philiKON | MrTopf, deriving from object or not is optional | 19:56 |
philiKON | IOW, new-style classes are optional for adapters | 19:56 |
MrTopf | well, it said in my test that it cannot adapt | 19:56 |
MrTopf | I though so, too | 19:56 |
MrTopf | and it was working before without, e.g. in the FiveDemo | 19:56 |
philiKON | are you sure it's becausde of that?!? | 19:56 |
MrTopf | I will test it again | 19:56 |
MrTopf | ok, now it's also working without | 19:58 |
MrTopf | that's very strange now because I think I did not change anything except that | 19:58 |
MrTopf | I really should use svn with that project so I can track that down | 20:02 |
MrTopf | OTOH I wouldn't have checked in a not working version | 20:03 |
MrTopf | but 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 |
MrTopf | maybe some different dummy.py is somewhere in the way | 20:04 |
MrTopf | nope, dummy2 also does not work, full path like Products.MyProducts.tests.dummy works | 20:06 |
MrTopf | strange.. | 20:06 |
philiKON | MrTopf, python absolute import weirdness | 20:08 |
philiKON | MrTopf, i've gotten used to *always* using the full import pat | 20:08 |
philiKON | h | 20:08 |
MrTopf | annoying if you e.g. rename it or so | 20:08 |
philiKON | yes | 20:10 |
MrTopf | well, one need to know that ;-) | 20:12 |
MrTopf | but is it only with interfaces, adapters? | 20:12 |
MrTopf | or does it also make problems otherwise? because for me it's the first time I think | 20:12 |
*** sm has quit IRC | 20:16 | |
philiKON | it happens all the time | 20:16 |
philiKON | but in z2 it isn't that much relevant when objects aren't the same | 20:17 |
*** sm has joined #zope3-dev | 20:17 | |
philiKON | in z3 with the meaning of interfaces it is | 20:17 |
roym | I am getting a rather strange error (to do with "chickens" :) when I | 20:24 |
roym | use the xmlconfig.string() function: | 20:24 |
roym | 20:24 | |
roym | File "/usr/local/Zope3-trunk/src/zope/configuration/config.py", line 184, in resolve | 20:24 |
roym | mod = __import__(mname, *_import_chickens) | 20:24 |
roym | zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "<string>", line 25.3-28.54 | 20:24 |
roym | ValueError: Empty module name | 20:24 |
roym | 20:24 | |
roym | Seems like I am missing a way to tell the system what module the ZCML | 20:24 |
roym | configuration belongs to... is this correct? | 20:24 |
roym | 20:24 | |
roym | My call looks like this: | 20:28 |
roym | | xmlconfig.string(''' | 20:28 |
roym | | <configure | 20: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-dev | 20:31 | |
philiKON | roym, do you rconfigure directives for vocabularies / adapters use the '.' prefix for dotted names? | 20:35 |
roym | yes - should I switch to absolute naming? | 20:38 |
*** suresh has joined #zope3-dev | 20:38 | |
philiKON | roym, yes | 20:38 |
roym | many thanks. | 20:38 |
philiKON | roym, zcml wouldn't know how to interpret the '.' | 20:38 |
philiKON | so, you either pass a package as context | 20:38 |
philiKON | or use <configure package="..."> in the zcml string | 20:38 |
philiKON | or use absolute dotted names | 20:39 |
roym | ok | 20:42 |
*** SureshZ has quit IRC | 20:45 | |
*** SureshZ has joined #zope3-dev | 20:46 | |
*** suresh has quit IRC | 20:51 | |
*** MrTopf has quit IRC | 20:51 | |
*** suresh has joined #zope3-dev | 20:51 | |
*** SureshZ has quit IRC | 20:56 | |
*** SureshZ has joined #zope3-dev | 20:57 | |
*** suresh has quit IRC | 21:02 | |
roym | Does anyone know what zcml file makes the zope.ManageContent | 21:10 |
roym | permission known to my tests. I have tried: | 21:10 |
roym | 21:10 | |
roym | xmlconfig.string(''' | 21:10 |
roym | <include package="zope.app.security" file="meta.zcml" /> | 21:10 |
roym | ... ''') | 21:10 |
roym | 21:10 | |
roym | but I am still looking at: | 21:10 |
roym | 21:10 | |
roym | File "/usr/local/Zope3-trunk/src/zope/app/security/permission.py", | 21:10 |
roym | line 124, in checkPermission | 21: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 |
roym | Never mind - I found that I can simply say: | 21:14 |
roym | <include package="zope.app.security" file="configure.zcml" /> | 21:14 |
roym | and 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-dev | 21:32 | |
*** SureshZ has quit IRC | 21:40 | |
*** SureshZ has joined #zope3-dev | 21:43 | |
*** suresh has quit IRC | 21:50 | |
philiKON | roym, yep. so that the <permission /> directive is also known | 22:01 |
*** projekt01 has quit IRC | 22:01 | |
*** projekt01 has joined #zope3-dev | 22:01 | |
*** suresh has joined #zope3-dev | 22:04 | |
*** tav has joined #zope3-dev | 22:06 | |
*** GvaderTH has joined #zope3-dev | 22:08 | |
GvaderTH | Hi | 22:08 |
philiKON | hi | 22:09 |
*** SureshZ has quit IRC | 22:19 | |
*** SureshZ has joined #zope3-dev | 22:20 | |
*** suresh has quit IRC | 22:27 | |
*** suresh has joined #zope3-dev | 22:27 | |
*** alienoid has joined #zope3-dev | 22:33 | |
*** SureshZ has quit IRC | 22:34 | |
*** suresh has left #zope3-dev | 22:35 | |
*** SureshZ has joined #zope3-dev | 22:35 | |
alienoid | hi | 22:37 |
philiKON | hey alienoid | 22:37 |
alienoid | hi philiKON | 22:39 |
*** suresh has joined #zope3-dev | 22:47 | |
*** SureshZ has quit IRC | 22:55 | |
roym | Gentlemen, What incantation should I use to specify a single valued | 23:52 |
roym | choice, so that preferably a radio button is shown in the edit view, | 23:52 |
roym | somewhat like the following spec for a multi-valued field: | 23:52 |
roym | 23:52 | |
roym | | specialties = List( | 23:52 |
roym | | title=u"Specialties", | 23:52 |
roym | | unique=True, | 23:52 |
*** suresh has quit IRC | 23:52 | |
roym | | value_type=Choice(title=u"Specialties", vocabulary="specialties"),) | 23:52 |
*** suresh has joined #zope3-dev | 23:52 | |
*** yota has quit IRC | 23:58 | |
*** yota has joined #zope3-dev | 23:59 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!