2011-12-07 6 views
0

私たちはuniの学生プロジェクトに取り組んでおり、PloneとDexterityのコンテンツタイプを扱わなければなりません。Plone&DexterityでカスタムeditFormを作成すると、オブジェクトへの変更を保存する方法は?

カスタムコンテンツタイプを作成し、カスタムの編集フォームを作成しようとしています。しかし、編集フォームに入力したものをObject自体に保存することはできないようです。任意の助けを事前に

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" 
    xmlns:tal="http://xml.zope.org/namespaces/tal" 
    xmlns:metal="http://xml.zope.org/namespaces/metal" 
    xmlns:i18n="http://xml.zope.org/namespaces/i18n" 
    lang="en" 
    metal:use-macro="context/main_template/macros/master" 
    i18n:domain="pacs.content"> 
<body> 



<metal:main fill-slot="main"> 
    <metal:main define-macro="main" 
     tal:define="currentSelection view/selected_org_unit"> 

    <div tal:replace="structure provider:plone.abovecontenttitle" /> 

    <h1 class="documentFirstHeading" tal:content="context/title" /> 

    <div tal:replace="structure provider:plone.belowcontenttitle" /> 

    <p class="documentDescription" tal:content="context/shortname" /> 

    <div tal:replace="structure provider:plone.abovecontentbody" /> 

    <div tal:content="structure context/projectnr" />   
    <div> 
    <fieldset style="border:1px #000 solid"> 
    <legend>Bereichszuordnung</legend> 

     <select name="org_unit" size="1"> 
      <option value="">Bitte auswählen</option> 
      <option 
        tal:repeat="code view/org_units" 
        tal:attributes="value code; 
              selected python:currentSelection == code and 'selected' or None" 
        tal:content="code" 
      /> 
     </select> 
    </fieldset> 
    </div> 

    <div tal:content="structure context/org_unit" /> 
    <div tal:content="structure context/project_head" /> 
    <div tal:content="structure context/confidential" /> 

    <input id="form-buttons-save" 
    name="form.buttons.save" class="submit-widget button-field context" value="Save" type="submit" />   
    <div tal:replace="structure provider:plone.belowcontentbody" /> 
    <div metal:use-macro="context/batch_macros/macros/navigation" /> 

</metal:main> 
</metal:main> 

おかげであなたが提供できると私は喜んで任意の関連するコードをアップロードします。

+0

編集フォームのコードを少し用意して、既に行ったことを確認できますか? –

答えて

1

編集フォームを登録していますか?

class EditForm(dexterity.EditForm): 
    grok.context(IYourContentType) 

詳細については、Custom add and edit formsをご覧ください。

+0

はい、私たちはそれをやっています。 – MarkZ

関連する問題