Exemple #1
0
from django.conf import settings
from akuna.component import register_component
from ztreecrud.component.views import GenericCreateView, GenericUpdateView, GenericDeleteView

# create view context=(<tree parent obj> , <content type of obj being create>)
register_component(GenericCreateView, context=("object", "ContentType"))
register_component(GenericUpdateView, context=("object",))
register_component(GenericDeleteView, context=("object",))


###########commented out#####
# XXX check this needed
# from ztree.component.contentname import ContentName
# register_component(ContentName, NameUtilTag, (ContentTag,))
###########


if hasattr(settings, "ZTREE_WS_BASE_URL"):
    # ZTree store is behind a remote ws backend
    # register remote factories
    from ztreecrud.component.factories import RemoteCreateFactory

    remote_create_factory = RemoteCreateFactory()
    register_component(remote_create_factory, is_a="CreateFactory")

    from ztreecrud.component.factories import RemoteUpdateFactory

    remote_update_factory = RemoteUpdateFactory()
    register_component(remote_update_factory, is_a="UpdateFactory")

    from ztreecrud.component.factories import RemoteDeleteFactory
Exemple #2
0
from akuna.component import register_component

# LocalUserProxy just a front-end proxy for LocalUser model
# so have to do some manual type tagging
#from ztree.models import TreeContentTag
#from ztreeauth.models import LocalUserProxy, LocalUserTag
#tag_class(LocalUserProxy, tag=LocalUserTag)
#tag_class(LocalUserProxy, tag=ContentTag)
#tag_class(LocalUserProxy, tag=TreeContentTag)

from ztreeauth.component.view import LocalUserCreateView
register_component(LocalUserCreateView, context=('object', 'ContentType'), is_a='CreateView', name='ztreeauth.localuser')

#from ztreeauth.component.view import LocalUserView
#register_component(LocalUserView, context=('LocalUser',), is_a='DetailView')
##XXX is the Proxy hack going to work
#register_component(LocalUserView, context=('LocalUserProxy',), is_a='DetailView')

from django.conf import settings

if hasattr(settings, 'ZTREE_WS_BASE_URL'):
    pass
else:
    from ztreeauth.component.factories import local_user_factory
    register_component(local_user_factory, is_a='CreateFactory', name='ztreeauth.localuser')

from ztreeauth.component.serializers import LocalUserDeserializerUtil
local_user_deserializer_util = LocalUserDeserializerUtil()
register_component(local_user_deserializer_util, is_a='DeserializerUtil', name='ztreeauth.localuser')
Exemple #3
0
from akuna.component import register_component

# LocalUserProxy just a front-end proxy for LocalUser model
# so have to do some manual type tagging
#from ztree.models import TreeContentTag
#from ztreeauth.models import LocalUserProxy, LocalUserTag
#tag_class(LocalUserProxy, tag=LocalUserTag)
#tag_class(LocalUserProxy, tag=ContentTag)
#tag_class(LocalUserProxy, tag=TreeContentTag)

from ztreeauth.component.view import LocalUserCreateView
register_component(LocalUserCreateView,
                   context=('object', 'ContentType'),
                   is_a='CreateView',
                   name='ztreeauth.localuser')

#from ztreeauth.component.view import LocalUserView
#register_component(LocalUserView, context=('LocalUser',), is_a='DetailView')
##XXX is the Proxy hack going to work
#register_component(LocalUserView, context=('LocalUserProxy',), is_a='DetailView')

from django.conf import settings

if hasattr(settings, 'ZTREE_WS_BASE_URL'):
    pass
else:
    from ztreeauth.component.factories import local_user_factory
    register_component(local_user_factory,
                       is_a='CreateFactory',
                       name='ztreeauth.localuser')
Exemple #4
0
from akuna.component import register_component

#
# Generic JSON Detail View
#
from ztreews.component.view import JSONDetailView
# adapting Request and Content object being viewed
register_component(JSONDetailView, JsonDetailViewTag, (HttpRequestTag, ContentTag))

#
# Generic JSON List View
#
from ztreews.component.view import JSONNodeListView
register_component(JSONNodeListView, JsonListViewTag, (IHttpRequestTag,))

Exemple #5
0
from django.conf import settings
from akuna.component import register_component
from ztree.component.views import GenericDetailView

register_component(GenericDetailView, context=('object', ))

###########commented out#####
# XXX check this needed
#from ztree.component.contentname import ContentName
#register_component(ContentName, NameUtilTag, (ContentTag,))
###########

from ztree.component.portlets import ChildrenListPortlet
register_component(ChildrenListPortlet,
                   ('object', 'HttpRequest', 'View', 'HeaderPortlets'),
                   is_a='Portlet')
Exemple #6
0
from django.conf import settings
from akuna.component import register_component
from ztree.component.views import GenericDetailView

register_component(GenericDetailView, context=('object',) )

###########commented out#####
# XXX check this needed
#from ztree.component.contentname import ContentName
#register_component(ContentName, NameUtilTag, (ContentTag,))
###########

from ztree.component.portlets import ChildrenListPortlet
register_component(ChildrenListPortlet, ('object', 'HttpRequest', 'View', 'HeaderPortlets'), is_a='Portlet')
Exemple #7
0
from django.conf import settings
from akuna.component import register_component
from ztreecrud.component.views import GenericCreateView, GenericUpdateView, GenericDeleteView

# create view context=(<tree parent obj> , <content type of obj being create>)
register_component(GenericCreateView, context=('object', 'ContentType',) )
register_component(GenericUpdateView, context=('object',) )
register_component(GenericDeleteView, context=('object',) )


###########commented out#####
# XXX check this needed
#from ztree.component.contentname import ContentName
#register_component(ContentName, NameUtilTag, (ContentTag,))
###########


if hasattr(settings, 'ZTREE_WS_BASE_URL'):
    # ZTree store is behind a remote ws backend 
    # register remote factories
    from ztreecrud.component.factories import RemoteCreateFactory
    remote_create_factory = RemoteCreateFactory()
    register_component(remote_create_factory, is_a='CreateFactory')

    from ztreecrud.component.factories import RemoteUpdateFactory
    remote_update_factory = RemoteUpdateFactory()
    register_component(remote_update_factory, is_a='UpdateFactory')

    from ztreecrud.component.factories import RemoteDeleteFactory
    remote_delete_factory = RemoteDeleteFactory()
    register_component(remote_delete_factory, is_a='DeleteFactory')
Exemple #8
0
from akuna.component import register_component

#
# Generic JSON Detail View
#
from ztreews.component.view import JSONDetailView
# adapting Request and Content object being viewed
register_component(JSONDetailView, JsonDetailViewTag,
                   (HttpRequestTag, ContentTag))

#
# Generic JSON List View
#
from ztreews.component.view import JSONNodeListView
register_component(JSONNodeListView, JsonListViewTag, (IHttpRequestTag, ))