collective / collective.contact.core

part of the collective.contact.* suite that provides a directory where you create persons, organizations, sub-organizations and positions
https://github.com/collective/collective.contact.demo
6 stars 10 forks source link

Remove grok dependency #61

Closed tdesvenain closed 4 years ago

tdesvenain commented 5 years ago

cc @agitator

agitator commented 4 years ago

working on this in https://github.com/collective/collective.contact.core/tree/plone5-only

agitator commented 4 years ago

Degroking is almost done but I can't get the adapters to work correctly...

Can someone enlighten me about the interface dependencies in https://github.com/collective/collective.contact.core/blob/plone5-only/src/collective/contact/core/adapters.py ?

What I've tried so far...

<adapter
  for="*"
  provides="collective.contact.core.interfaces.IVCard"
  factory=".adapters.ContactDetailsVCard"
  />

<adapter
  for="collective.contact.core.content.held_position.HeldPosition"
  provides="collective.contact.core.interfaces.IVCard"
  factory=".adapters.HeldPositionVCard"
  />

<adapter
  for="collective.contact.core.content.organization.Organization"
  provides="collective.contact.core.interfaces.IVCard"
  factory=".adapters.OrganizationVCard"
  />

and

class ContactDetailsVCard(ContactableVCard):

    def __init__(self, context):
        self.context = context
    ...

@implementer(IHeldPosition)
class HeldPositionVCard(ContactableVCard):

    def __init__(self, context):
        self.context = context
    ...

@implementer(IOrganization)
class OrganizationVCard(ContactableVCard):

    def __init__(self, context):
        self.context = context
...

ping @sgeulette @gbastien @boulch @tdesvenain

agitator commented 4 years ago

I think I adapters are working now, was misled by https://github.com/collective/collective.contact.core/issues/67

agitator commented 4 years ago

all grok removed in https://github.com/collective/collective.contact.core/tree/plone5-only