Beispiel #1
0
    def update(self):
        self.portal_type = self.context.portal_type
        super(DefaultEditForm, self).update()

        # fire the edit begun only if no action was executed
        if len(self.actions.executedActions) == 0:
            notify(EditBegunEvent(self.context))
Beispiel #2
0
 def __call__(self, field_name):
     """ """
     # notify that edit befun, will especially lock content
     notify(EditBegunEvent(self.context))
     self.field_name = field_name
     self.widget = get_dx_widget(self.context, field_name, mode=INPUT_MODE)
     return self.index()
Beispiel #3
0
    def setup(self):
        self.context = aq_inner(self.context)
        vocab = TileStylesVocabulary()
        items = [{
            'content': item.title,
            'value': item.value,
            'selected': False,
        } for item in vocab(self.context) if item.value != 'tile-default']
        self.css_classes = json.dumps(items)

        # lock the object when someone is editing it
        notify(EditBegunEvent(self.context))
    def update(self):
        if (getattr(self.context, "collective_immediatecreate", None) !=
                "initial"  # noqa: W503
            ):
            url = self.context.absolute_url() + "/edit"
            url = addTokenToUrl(url)
            raise Redirect(url)
        self.portal_type = self.context.portal_type

        if ILocking.providedBy(self.context):
            lockable = ILockable(self.context)
            if lockable.locked():
                lockable.unlock()

        super().update()

        # fire the edit begun only if no action was executed
        if len(self.actions.executedActions) == 0:
            notify(EditBegunEvent(self.context))
Beispiel #5
0
 def setup(self):
     self.context = aq_inner(self.context)
     vocab = TileStylesVocabulary()
     self.css_classes = vocab(self.context)
     # lock the object when someone is editing it
     notify(EditBegunEvent(self.context))
 def update(self):
     self.context = aq_inner(self.context)
     # XXX: used to lock the object when someone is editing it
     notify(EditBegunEvent(self.context))
Beispiel #7
0
 def __call__(self):
     # lock the object when someone is editing it
     notify(EditBegunEvent(self.context))
     return self.index()