*** menesis has quit IRC | 01:39 | |
*** replaceafill has quit IRC | 04:03 | |
*** aks has joined #schooltool | 05:08 | |
*** aks has quit IRC | 06:03 | |
*** replaceafill has joined #schooltool | 06:25 | |
*** aks has joined #schooltool | 06:33 | |
*** th1a has quit IRC | 06:56 | |
*** yvl has quit IRC | 07:43 | |
*** yvl has joined #schooltool | 07:51 | |
aelkner | hey yvl | 07:52 |
---|---|---|
yvl | good evening aelkner | 07:52 |
aelkner | and good afternoon to you | 07:52 |
aelkner | what to discuss first... | 07:53 |
aelkner | actually, i just realized, it's morning for you :) | 07:53 |
yvl | right :) | 07:53 |
aelkner | have you had your coffee? | 07:53 |
yvl | not yet | 07:54 |
yvl | gimme 3 minutes :) | 07:54 |
aelkner | sure thing | 07:54 |
yvl | and I'm good :) | 07:56 |
aelkner | yvl, did you mean now you're good? | 08:01 |
yvl | I have my coffee | 08:02 |
yvl | http://forum.wordreference.com/showthread.php?t=33963 | 08:03 |
aelkner | yeah, i'm good is the less proper, hence, cooler way to say i'm fine | 08:04 |
aelkner | anyway | 08:04 |
yvl | right | 08:05 |
aelkner | can i ask you first about what you thought i could do with the widget to get rid of isAdding()? | 08:05 |
aelkner | you see, the widget gets called in the add or edit view | 08:05 |
yvl | well, I forgot it's formlib | 08:05 |
aelkner | and the context is different | 08:05 |
aelkner | and also, the condition of what to expect from the request is different | 08:06 |
aelkner | anyway, i looked at the registration and the zope formlib code where the widget gets looked up | 08:06 |
yvl | component.getMultiAdapter((field, request), viewType) | 08:07 |
aelkner | and i don't see any difference in the adapter call in edit or add | 08:07 |
aelkner | right | 08:07 |
aelkner | viewType is IInputWdiget | 08:07 |
aelkner | but that's in edit and add both | 08:07 |
yvl | yes | 08:07 |
aelkner | so i don't now what you would suggest it would do | 08:08 |
yvl | umm | 08:08 |
aelkner | i would do | 08:08 |
yvl | listening | 08:08 |
aelkner | no, that's my question | 08:09 |
aelkner | what would you suggest? | 08:09 |
yvl | ah | 08:10 |
yvl | well, you could set up custom widget in one of the views | 08:10 |
yvl | but I'm not sure if it's worth the hassle | 08:10 |
yvl | I mean - | 08:11 |
yvl | have the common widget, then special child class for adding | 08:11 |
yvl | and set a custom widget in the adding view | 08:11 |
aelkner | oh | 08:11 |
yvl | it's a good refactoring exercise | 08:12 |
yvl | so it's your choice really | 08:13 |
aelkner | in the addform directive, there are things like: | 08:13 |
aelkner | <widget field="presenting_concerns" width="54" height="10" /> | 08:13 |
aelkner | but that is just for adjusting the attributes of the automatically found widget | 08:14 |
aelkner | how would one suggest a custom widget? | 08:14 |
aelkner | oh, is this assuming z3c.formlib? | 08:14 |
replaceafill | aelkner, i think it assumes zope.app.form | 08:16 |
yvl | no, zope.app.form has it | 08:16 |
yvl | but yes, it's just **keywords passed to custom widget factory | 08:16 |
aelkner | do we have an example in schooltool core? | 08:17 |
yvl | lookin | 08:17 |
* replaceafill thinks <addform... />, <editform ... />, <menuItem... /> should die and go to hell!!! | 08:18 | |
yvl | from zope.app.form import CustomWidgetFactory | 08:18 |
yvl | view.persons_list_widget = CustomWidgetFactory(YourWidgetClass, param1=x, param2=x) | 08:20 |
yvl | params are optional | 08:20 |
aelkner | so you're saying in the __init__ for the add view say: | 08:20 |
aelkner | self.persons_list_widget = CustomWidgetFactory(YourWidgetClass, param1=x, param2=x) | 08:21 |
aelkner | it would help if we had done this kind of thing before in core | 08:21 |
yvl | just not the init | 08:22 |
yvl | def _setUpWidgets(self): | 08:22 |
yvl | self.persons_list_widget = CustomWidgetFactory(YourWidgetClass) | 08:22 |
yvl | BaseClass._setUpWidgets(self) | 08:23 |
yvl | I think in the old days there may have been custom widgets in core | 08:23 |
yvl | btw, hey replaceafill :) | 08:25 |
replaceafill | hey yvl :P | 08:25 |
aelkner | replaceafill, you still up? | 08:25 |
* yvl has slow reaction time this morning for some reason :) | 08:25 | |
replaceafill | aelkner, nope... zzzzzz | 08:25 |
replaceafill | zzzz | 08:25 |
aelkner | talked to the family yet? | 08:26 |
replaceafill | yvl, not enough coffee? | 08:26 |
yvl | yes! :D | 08:26 |
replaceafill | aelkner, indeed | 08:26 |
aelkner | are you sprinting this week? | 08:26 |
aelkner | with jelkner? | 08:26 |
replaceafill | not the whole week | 08:26 |
replaceafill | i'm going back on wednesday | 08:26 |
aelkner | ah, well are you working with jelkner and/or filip | 08:27 |
replaceafill | yep | 08:27 |
aelkner | cool | 08:27 |
replaceafill | :) | 08:27 |
replaceafill | filip is the one doing the work actually, i just clean his laptop screen when it's dirty | 08:28 |
yvl | :D | 08:28 |
replaceafill | bring him coffee and stuff | 08:28 |
aelkner | so you're having lots of fun i see :) | 08:30 |
aelkner | yvl, i'll look into the whole custom widget thing later, but i'd like to talk catalog | 08:32 |
yvl | sure | 08:32 |
aelkner | can you explain the task performed by the contact catalog diff you referred me to? | 08:32 |
yvl | I removed the catalog utility there | 08:33 |
yvl | and replaced it with another catalog implementation | 08:33 |
yvl | the one I wrote :) | 08:33 |
aelkner | what is point of the new style catalog? | 08:33 |
yvl | well, first - less evolution | 08:33 |
yvl | you change the version string, app takes care of the rest | 08:33 |
yvl | if you change cataloged attributes defined explicitly in attributes = ('', '') | 08:34 |
yvl | app creates relevant indexes | 08:34 |
yvl | and it's not a subscriber, so people can replace / remove it | 08:35 |
yvl | class PersonCatalog(AttributeCatalog): | 08:36 |
yvl | version = '1 - replaced catalog utility' | 08:36 |
yvl | interface = IBasicPerson | 08:36 |
yvl | attributes = ('__name__', 'title', 'first_name', 'last_name') | 08:36 |
yvl | getPersonCatalog = PersonCatalog.get | 08:36 |
yvl | and thats it for the person catalog | 08:36 |
aelkner | so it allows for customization where the subscriber wouldn't? | 08:37 |
yvl | yes | 08:37 |
yvl | also, in zcml: | 08:37 |
yvl | <adapter factory=".person.PersonCatalog" | 08:37 |
yvl | name="schooltool.person.person.PersonCatalog" /> | 08:37 |
yvl | <adapter | 08:37 |
yvl | for="schooltool.person.interfaces.IPersonContainer" | 08:37 |
yvl | factory=".person.getPersonCatalog" | 08:37 |
yvl | provides="zope.catalog.interfaces.ICatalog" /> | 08:37 |
yvl | and that's it | 08:37 |
yvl | but mostly I did this for evolution | 08:39 |
aelkner | to prevent for the need for future evolutions? | 08:39 |
yvl | yes | 08:41 |
yvl | at least to reduce it | 08:41 |
yvl | also, UtilitySetup is going away at some point | 08:42 |
yvl | so it would be nice to do replace the catalog now | 08:42 |
yvl | as for first_name / last_name refresh problem... | 08:45 |
yvl | I would add 'student' index to the catalog | 08:46 |
yvl | and store the intid of the student of messages/goal | 08:46 |
yvl | s | 08:46 |
yvl | then, looking at app/catalog.py | 08:46 |
yvl | mkay, catalog.py uses subscribers :/ | 08:47 |
yvl | anyway | 08:47 |
aelkner | oops :) | 08:47 |
yvl | you'd need an adaptersubscriber to (IntIdAddedEvent, IContact) | 08:48 |
yvl | also, modified event and removed event | 08:48 |
aelkner | and what do i do, for instance in the added event subscriber | 08:49 |
yvl | that fires similar event to | 08:49 |
aelkner | this is called whenever a contact is added, right? | 08:49 |
yvl | related intervention objects | 08:49 |
yvl | added, when added | 08:49 |
yvl | and so on | 08:49 |
yvl | yes | 08:49 |
yvl | so, obj_id = util.getId(obj) | 08:49 |
yvl | then get interventions catalog | 08:49 |
yvl | if you use the new style catalogs, it's | 08:50 |
yvl | InterventionCatalog.get() | 08:50 |
yvl | intervention_object_intids = catalog['student'].values_to_documents.get(obj_id) | 08:51 |
yvl | if intervention_object_intids: | 08:51 |
yvl | for intid in intervention_object_intids | 08:51 |
yvl | notify(IntIdAdded event for util.getObject(intid)) | 08:51 |
yvl | but also it would be good to put XXX'es there | 08:52 |
yvl | that this event forwarding is done ONLY because: | 08:52 |
yvl | 1) schooltool table formatter does not support values drawn from multiple catalogs | 08:53 |
yvl | (I mean, easily - I know it can be hacked) | 08:53 |
yvl | well, there's no reason number two | 08:54 |
aelkner | why are you talking about a student catalog? | 08:54 |
aelkner | we don't have one | 08:54 |
yvl | it's not a student catalog | 08:54 |
yvl | it's intervention catalog | 08:54 |
aelkner | and the only one that is causing a problem is the persons_responsible catalog | 08:54 |
yvl | with additional index | 08:55 |
yvl | student | 08:55 |
aelkner | ok, wait | 08:55 |
yvl | ah, righ, that one also | 08:55 |
aelkner | let's slow down for a sec | 08:55 |
aelkner | right now we have on intervention catalog | 08:55 |
aelkner | that has multiple indeces | 08:55 |
aelkner | it is setup in the old way | 08:55 |
aelkner | via utility call | 08:55 |
aelkner | so changing that is one thing | 08:56 |
aelkner | but dealing with the problem at hand, we have a persons_responsible index that is a list of ids | 08:56 |
aelkner | including the student_id:2, for example | 08:56 |
aelkner | what would we be changing the to, a list of intids instead? | 08:57 |
aelkner | intids of contacts? | 08:57 |
yvl | a tuple preferably, yes | 08:57 |
aelkner | so that cold be done without changing to new style, rght? | 08:57 |
yvl | yes | 08:57 |
aelkner | i just want to separate the tasks | 08:57 |
yvl | sorry, I should have started with this | 08:57 |
yvl | sure | 08:57 |
aelkner | it is important to solve the crisis first | 08:57 |
yvl | :) | 08:58 |
yvl | true | 08:58 |
aelkner | ten worry about new style stuff, am i right? | 08:58 |
yvl | absolutely | 08:58 |
aelkner | ok, remember, i confuse easily :) | 08:58 |
aelkner | so in theory, i could keep it simple in my next change | 08:59 |
aelkner | i could update the getPersonsResponsible adapter | 08:59 |
aelkner | to return the list of initds rather than obj.persoins_responsible | 08:59 |
yvl | but that adapter is used in other places, isn't it? | 09:00 |
aelkner | no, only by the index | 09:00 |
aelkner | that's why it lives in catalog.py | 09:00 |
aelkner | it's the only case where i need to adapt an object of unknow type (goal or message) | 09:01 |
aelkner | to an attribute | 09:01 |
aelkner | it was the first time i ever did anything like that | 09:01 |
aelkner | but i understood it was necessary because the index is defined as follows: | 09:01 |
aelkner | def _setUpWidgets(self): | 09:01 |
aelkner | no, sorry | 09:02 |
aelkner | bad paste buffer | 09:02 |
aelkner | catalog['persons_responsible'] = ConvertingIndex( | 09:02 |
aelkner | converter=interfaces.IInterventionPersonsResponsible) | 09:02 |
aelkner | that's it | 09:02 |
aelkner | so the auto-magic of catalog would call that adapter for a goal or message and get back the attribute | 09:02 |
aelkner | then it would just put that as the key of the index entry | 09:03 |
aelkner | so if i just change the adapter to return a list of initids | 09:03 |
aelkner | then the only other thing that needs to change is the table filter widget | 09:04 |
aelkner | that currently says: | 09:04 |
yvl | hmm | 09:04 |
yvl | I see it is used for crowds | 09:04 |
aelkner | user_contact = IContact(IPerson(self.request.principal)) | 09:04 |
aelkner | pr_idx = catalog['persons_responsible'] | 09:04 |
aelkner | items = [item for item in items | 09:04 |
aelkner | if user_contact in pr_idx.documents_to_values[item['id']]] | 09:04 |
aelkner | which fails, of course because the idex currently has lists of ids | 09:05 |
aelkner | and need to evolve | 09:05 |
aelkner | so i would change the adapter as suggested | 09:05 |
yvl | umm, IF you are willing to change to new catalogs | 09:06 |
aelkner | and in the filter i would change to have user_contact = IContact(IPerson(self.request.principal)) | 09:06 |
yvl | you can postpone writing evolution | 09:06 |
aelkner | user_contact = initids.getId(user_contact) | 09:06 |
aelkner | or something like that | 09:06 |
yvl | yeah | 09:06 |
aelkner | yeah is for the change to adapter and filter i just suggested, right? | 09:07 |
yvl | yes :) | 09:07 |
aelkner | ok, and the new catalog idea would avoid need for evolving the index | 09:08 |
aelkner | only that i would need to evolve the catalog to remove the utility as you did in the diff | 09:08 |
yvl | you would still need the evolution that removes the utility | 09:08 |
aelkner | beat you :) | 09:08 |
yvl | but index update would become obsolete | 09:08 |
yvl | :))) | 09:08 |
aelkner | you'll have to explain why that is the case | 09:09 |
aelkner | why can i change an adapter and automatically the index changes? | 09:09 |
yvl | well, new-style catalogs will reindex themselves | 09:09 |
aelkner | why? | 09:09 |
aelkner | what event? | 09:10 |
yvl | if you change the adapter, the index does not change | 09:10 |
yvl | whait what? | 09:10 |
yvl | event? | 09:10 |
aelkner | what action causes the reindex? | 09:10 |
yvl | ah | 09:10 |
yvl | when you register catalog | 09:10 |
yvl | it has it's own AppStartUp | 09:10 |
yvl | or... | 09:11 |
yvl | CatalogStartUp event to be precise | 09:11 |
yvl | then some mechanism checks catalogs registered for this | 09:11 |
yvl | looks who got expired | 09:11 |
yvl | catalogs expire when: | 09:12 |
yvl | their version string changes | 09:12 |
yvl | for AttributeCatalog, alos: | 09:12 |
yvl | when the list of catalogged attributes changes | 09:12 |
yvl | attributes = (aaa,aaa,aa) | 09:12 |
yvl | or cataloged interface name changes | 09:12 |
yvl | interface = IFooSomething | 09:12 |
yvl | if you add your own indexes, or reimplement some adapter, or change the interface name | 09:13 |
yvl | you need to change the version string | 09:13 |
yvl | sorry, I didn't write documentation for that yet | 09:13 |
aelkner | i'm confused about the correspondence | 09:14 |
aelkner | in my catalog setup, i create indeced each time saying something like: | 09:15 |
aelkner | catalog['first_name'] = ConvertingIndex(converter=getStudentFirstName) | 09:15 |
aelkner | or: | 09:15 |
aelkner | catalog['created'] = ValueIndex('created') | 09:15 |
aelkner | so the catalog is a dict | 09:15 |
aelkner | and the setup method populates the dict with various indeces | 09:16 |
aelkner | accessible via dict key lookup | 09:16 |
aelkner | but the values can be any index type, ConvertingIndex or ValueIndex | 09:16 |
aelkner | or whatever | 09:16 |
aelkner | i don't see how a list of attributes replaces that | 09:16 |
aelkner | ValueIndex seems to go by attribute | 09:17 |
aelkner | but ConvertingIndex goes by adapter | 09:17 |
aelkner | so you see my confusion? | 09:18 |
*** yvl has quit IRC | 09:18 | |
*** replaceafill has quit IRC | 09:27 | |
*** yvl has joined #schooltool | 09:27 | |
yvl | sorry | 09:28 |
yvl | it seems I pingged out or something | 09:28 |
yvl | ping aelkner ? | 09:28 |
aelkner | np | 09:28 |
yvl | <yvl> ah | 09:28 |
yvl | <yvl> when you register catalog | 09:28 |
yvl | <yvl> it has it's own AppStartUp | 09:28 |
yvl | <yvl> or... | 09:28 |
yvl | <yvl> CatalogStartUp event to be precise | 09:28 |
yvl | <yvl> then some mechanism checks catalogs registered for this | 09:28 |
yvl | <yvl> looks who got expired | 09:28 |
yvl | <yvl> catalogs expire when: | 09:28 |
yvl | <yvl> their version string changes | 09:28 |
yvl | <yvl> for AttributeCatalog, alos: | 09:28 |
yvl | <yvl> when the list of catalogged attributes changes | 09:28 |
yvl | <yvl> attributes = (aaa,aaa,aa) | 09:28 |
yvl | <yvl> or cataloged interface name changes | 09:29 |
yvl | <yvl> interface = IFooSomething | 09:29 |
yvl | <yvl> if you add your own indexes, or reimplement some adapter, or change the interface name | 09:29 |
yvl | <yvl> you need to change the version string | 09:29 |
yvl | <yvl> sorry, I didn't write documentation for that yet | 09:29 |
yvl | <yvl> for reference: | 09:29 |
yvl | <yvl> class PersonCatalog(AttributeCatalog): | 09:29 |
*** yvl has quit IRC | 09:29 | |
*** yvl_ has joined #schooltool | 09:29 | |
aelkner | holy channel flood batman! | 09:29 |
*** yvl_ is now known as yvl | 09:29 | |
yvl | right | 09:29 |
yvl | <yvl> for reference: | 09:30 |
yvl | <yvl> class PersonCatalog(AttributeCatalog): | 09:30 |
yvl | <yvl> version = '1 - replaced catalog utility' | 09:30 |
yvl | <yvl> interface = IBasicPerson | 09:30 |
yvl | <yvl> attributes = ('__name__', 'title', 'first_name', 'last_name') | 09:30 |
yvl | <yvl> if you rename the interface, or add/remove attributes, it will be reindexed next time the server starts | 09:30 |
yvl | <yvl> Another example: | 09:31 |
yvl | <yvl> class ContactCatalog(AttributeCatalog): | 09:31 |
aelkner | why are you flooding the channel with stuff you already said? | 09:31 |
yvl | <yvl> version = '1 - replaced catalog utility' | 09:31 |
yvl | what was the last thing I said? | 09:31 |
aelkner | what's your chat client? | 09:31 |
yvl | xchat, but that does not matter | 09:32 |
yvl | what was the last thing I said? | 09:32 |
aelkner | whenever i rejoin, XCHAT, it gives me whatever i missed | 09:32 |
aelkner | what about all the stuff i said? | 09:32 |
aelkner | you should look at the saved log | 09:32 |
aelkner | http://schooltool.pov.lt/irclogs/latest.log.html | 09:33 |
yvl | yes | 09:33 |
yvl | the last thing I said there was sorry, I didn't write documentation for that yet | 09:33 |
yvl | and then pingged out | 09:33 |
aelkner | then you see what i said/asked | 09:33 |
aelkner | ending with see my confusion? | 09:34 |
yvl | yes | 09:34 |
aelkner | i think your new catalog assumes all value indeces, right? | 09:34 |
yvl | no | 09:34 |
yvl | I was kind of explaining that | 09:34 |
yvl | after pinging out | 09:34 |
yvl | an example of this is contact catalog: | 09:35 |
yvl | class ContactCatalog(AttributeCatalog): | 09:35 |
yvl | version = '1 - replaced catalog utility' | 09:35 |
yvl | interface = IContact | 09:35 |
yvl | attributes = ('first_name', 'last_name') | 09:35 |
yvl | def setIndexes(self, catalog): | 09:35 |
yvl | super(ContactCatalog, self).setIndexes(catalog) | 09:35 |
yvl | catalog['form_keys'] = ConvertingIndex(converter=IUniqueFormKey) | 09:35 |
aelkner | ah, ok | 09:35 |
aelkner | fair enough | 09:36 |
yvl | so you add those manually | 09:36 |
yvl | if you change the way IUniqueFormKey gets the form key | 09:36 |
yvl | you need to change version string | 09:36 |
yvl | if you add, say catalog['simple_keys'] = ConvertingIndex(converter=simple_form_key) | 09:36 |
yvl | again - change the version string | 09:36 |
yvl | there :) | 09:36 |
yvl | flood complete :) | 09:36 |
aelkner | :) | 09:36 |
aelkner | so if my catalog was already new style | 09:36 |
aelkner | then changing the version would cause it to reindex | 09:37 |
yvl | yes | 09:37 |
aelkner | hence the lists of ids would automatically be changed to lists of intids | 09:37 |
aelkner | because i had changed the adapter | 09:37 |
yvl | yes | 09:37 |
aelkner | so starting with now, if i make it a new style, i just write the same evolution to remove the old catalog | 09:38 |
aelkner | and i'm done | 09:38 |
yvl | yes | 09:38 |
aelkner | i'll try that then :) | 09:38 |
yvl | :) | 09:38 |
aelkner | no when a contact is removed | 09:39 |
aelkner | i need to write my own event subscriber | 09:39 |
aelkner | adaptersubscriber | 09:39 |
aelkner | for (IntIdAddedEvent, IContact) | 09:40 |
aelkner | no | 09:40 |
aelkner | (IntIdRemovedEvent, IContact) | 09:40 |
aelkner | i don't care about new contacts being added | 09:40 |
aelkner | because they wouldn't be in my index anyway | 09:40 |
aelkner | only the ones that are removed are important | 09:41 |
yvl | or modified | 09:41 |
yvl | but that would solve first_name, last_name caching problem | 09:41 |
aelkner | what first_name, last_name caching problem? | 09:41 |
aelkner | didn't know we had one | 09:41 |
yvl | change the last name of the contact | 09:41 |
yvl | catalogs won't be updated | 09:41 |
yvl | because contact is not a intervention message | 09:42 |
yvl | sorry | 09:42 |
yvl | by contact I meant student | 09:42 |
aelkner | so you are referring to a problem where the student's name changes | 09:42 |
yvl | yes | 09:42 |
aelkner | and the intervention catalog would not change | 09:43 |
yvl | yes | 09:43 |
aelkner | wow, didn't realize we had that hanging over us | 09:43 |
yvl | it's not that bad, because the situation is unlikely | 09:44 |
yvl | but I wanted you to know that | 09:44 |
yvl | if you cache the object itself, it's one thing | 09:44 |
aelkner | so that's always been the case with all of our indeces that rely on attibutes from other objects | 09:44 |
yvl | yep | 09:44 |
yvl | scary, ain't it? ;) | 09:45 |
aelkner | yeah | 09:45 |
yvl | more importantly, persons_responsible also relies on relationships | 09:46 |
yvl | that are stored somewhere | 09:46 |
aelkner | yeah, so if a contact is removed from the system | 09:47 |
aelkner | it will automatically disappear from all intervention objects that refer to it | 09:47 |
aelkner | but not from the indeces? | 09:47 |
yvl | yes | 09:47 |
aelkner | unless i write the adaptersubscriber for (IntIdRemovedEvent, IContact) | 09:48 |
yvl | well, you actually cache objects by relationship there | 09:48 |
yvl | so *that* should be hooked with RelationshipAdded and RelationshipRemoved subscribers | 09:49 |
yvl | those are somewhat crappy at the moment | 09:49 |
yvl | see app/relationship.py | 09:50 |
yvl | and configuration | 09:50 |
yvl | <subscriber | 09:50 |
yvl | for="schooltool.relationship.interfaces.IRelationshipAddedEvent" | 09:50 |
yvl | handler=".relationships.updateStudentCalendars" | 09:50 |
yvl | /> | 09:50 |
aelkner | lots of providedBy calls :) | 09:51 |
yvl | yes | 09:51 |
yvl | well, for you it won't matter | 09:51 |
yvl | because you need to ping catalog for both adding and removing relationships | 09:51 |
aelkner | ping catalog? | 09:52 |
yvl | I'll get to that | 09:52 |
aelkner | what do mean by that? | 09:52 |
yvl | you'll need to check if event.rel_type != URIPersonsResponsibleOrSomething | 09:52 |
yvl | then get object = event[URIMessage] | 09:52 |
yvl | or similar, I don't recall exact URIs | 09:53 |
yvl | then, | 09:53 |
yvl | obj_intid = getIntId(object) | 09:53 |
yvl | catalog = InterventionCatalog.get.() | 09:54 |
yvl | catalog.index_doc(obj_intid, object) | 09:54 |
yvl | this will make catalog to index the message again | 09:54 |
yvl | thus re-reading the persons_responsible | 09:54 |
aelkner | readapting to IPersonsResponsible you mean | 09:55 |
yvl | yes | 09:55 |
aelkner | so i use the subscriber to IRelationshipAddedEvent | 09:56 |
aelkner | to so the code you just laid out there | 09:56 |
aelkner | to do the code, i mean | 09:56 |
yvl | yes | 09:57 |
aelkner | adn i need one for IRelationshipRemovedEvent | 09:57 |
aelkner | that does the same | 09:57 |
yvl | yes | 09:58 |
yvl | you can use the same method for both subscribers | 09:58 |
yvl | one more thing | 09:58 |
aelkner | if they are classes, i can ave a base class for both | 09:59 |
yvl | you need to check if obj_intid is in catalog | 09:59 |
yvl | no, they're simple functions | 09:59 |
yvl | that is sufficient | 09:59 |
aelkner | ok | 09:59 |
yvl | oh, you meant event | 09:59 |
yvl | s | 09:59 |
yvl | they have a base class, but you should not use it | 09:59 |
aelkner | but they can call the same method that does the lookup | 09:59 |
yvl | because IRelationshipEvent is also used for IBeforeRelationshipAdded | 09:59 |
yvl | yes | 10:00 |
yvl | the check if int_id is in catalog is important | 10:00 |
yvl | say, you delete a message | 10:00 |
yvl | relationships get removed of course | 10:00 |
yvl | and message is unindexed from catalogs | 10:00 |
yvl | in random order | 10:01 |
yvl | so you can accidentally index it again, if you're not careful | 10:01 |
yvl | oh, and you the check is: | 10:02 |
yvl | if obj_intid in catalog.extent: | 10:02 |
yvl | catalog.index_doc(obj_intid, object) | 10:02 |
aelkner | so only reindex if it's in the index | 10:02 |
yvl | yes | 10:02 |
yvl | all of this should come from core, but you know how it is | 10:03 |
yvl | I didn't implement that yet :D | 10:03 |
aelkner | well, you only have a thousand different projects on your plate | 10:04 |
yvl | :D | 10:04 |
aelkner | speaking of which | 10:04 |
aelkner | i'm going to leave it at that for tonight, allowing you to get to your own stuff | 10:05 |
aelkner | i'll look it over carfully tomorrow and try stuff out | 10:05 |
yvl | sure | 10:05 |
aelkner | will i be able to find you reliably at 2am all week? | 10:05 |
aelkner | that would help me to know that i can | 10:05 |
yvl | at 3am - definitely | 10:05 |
yvl | I usually come to work 2am-4am your time | 10:06 |
yvl | most likely 2am-3am | 10:06 |
aelkner | ok, i'll be keeping a late sleep schedule to allow for that | 10:06 |
yvl | or we can switch to early mornings | 10:06 |
aelkner | you can see that although email s nice | 10:06 |
aelkner | this ype of back and forth gets a lot more done | 10:07 |
yvl | true :) | 10:07 |
yvl | well then | 10:07 |
yvl | good night to you, sir :) | 10:07 |
aelkner | if i can't hold out till 3am for some reason, i can always try to wake up early and catch you that way | 10:07 |
aelkner | and good day to you :) | 10:08 |
yvl | just email me that you want to chat | 10:08 |
aelkner | will do, if i need to catch you early morning after i sleep, i'll email you the night before | 10:09 |
aelkner | anyway, thanks for the edumication :) | 10:09 |
aelkner | it was an experience | 10:10 |
yvl | you're welcome :) | 10:16 |
*** alga has joined #schooltool | 11:39 | |
*** menesis has joined #schooltool | 12:19 | |
*** aks has quit IRC | 13:21 | |
*** povbot has joined #schooltool | 14:04 | |
*** alga has joined #schooltool | 14:08 | |
*** ignas has joined #schooltool | 14:37 | |
*** menesis has quit IRC | 14:44 | |
*** th1a has joined #schooltool | 15:06 | |
*** menesis has joined #schooltool | 15:48 | |
*** yvl has quit IRC | 16:47 | |
*** yvl has joined #schooltool | 16:53 | |
*** alga has quit IRC | 16:57 | |
th1a | yvl: ayt? | 17:02 |
*** menesis has quit IRC | 19:34 | |
*** ignas has quit IRC | 20:14 | |
*** menesis has joined #schooltool | 20:34 | |
*** alga has joined #schooltool | 22:59 |
Generated by irclog2html.py 2.15.1 by Marius Gedminas - find it at mg.pov.lt!