Re: Dexterity DataGridField Default Factory

Simon Richardson <[email protected]>
Newsgroups gmane.comp.web.zope.plone.user
Message-ID <[email protected]>
Espen

I appreciate the tip but the XML doesn't really help.  It shows a list 
of dicts but I'm not sure who these can be created in the Default Factory?

         <item>
             <key><string id="7552.38" encoding="">events</string></key>
             <value>
               <list id="7552.39">
                   <dictionary id="7552.40">
                     <item>
                         <key><string id="7552.41" 
encoding="">stroke</string></key>
                         <value><unicode id="7552.42" 
encoding="">50Free</unicode></value>
                     </item>
                     <item>
                         <key><string id="7552.43" 
encoding="">notes</string></key>
                         <value>
                           <none/>
                         </value>
                     </item>
                   </dictionary>
                   <dictionary id="7552.44">
                     <item>
                         <key><reference id="7552.41"/></key>
                         <value><unicode id="7552.45" 
encoding="">100Free</unicode></value>
                     </item>
                     <item>
                         <key><reference id="7552.43"/></key>
                         <value><unicode id="7552.46" encoding="">Some 
text</unicode></value>
                     </item>
                   </dictionary>
               </list>
             </value>
         </item>

Simon


On 04/03/2015 18:49, espen wrote:
> A shot in the dark, probably:
>
> Could you try to export some content and see how it is saved ?
> (maybe it is possible to export the site as xml  instead of zexp ) and 
> have a look.
>
> In case it could be of any help: ny registry settings exports like this:
>
>   <record 
> name="medialog.lxml.interfaces.ILxmlSettings.scrape_url_pair" 
> interface="medialog.lxml.interfaces.ILxmlSettings" 
> field="scrape_url_pair">
>     <field type="plone.registry.field.List">
>       <title>scrape_url_pair</title>
>     </field>
>     <value>
>       <element>{'scrape_selector': '.test', 'scrape_base_url': 
> 'http://vg.no' <http://vg.no%27>}</element>
>     </value>
>   </record>
>
> ---------
>
> PS: I never managed to import these settings in registry.xml (so you 
> are not alone with not getting this to work)
>
>
>
> Espen
>
> 4. mars 2015 kl. 19:28 skrev Simon Richardson-2 [via Plone] <[hidden 
> email] </user/SendEmail.jtp?type=node&node=7573331&i=0>>:
>
>> Tuple does get me further but now the default value fails validation 
>> in the innards of datafgridfield.row.
>>
>> I'm going to park this now
>>
>> Simon
>> ------------------------------------------------------------------------
>> From:<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=0" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> Sent:?03/?03/?2015 12:37
>> To:<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=1" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> Subject:RE: [Plone-Users] Dexterity DataGridField Default Factory
>>
>> Christian,
>> I'll try that although I suspect it might fail because my array 
>> contains dicts and they don't have a hash value.  I'll give it a go 
>> tonight and let you know.
>> Simon
>> ------------------------------------------------------------------------
>> From:<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=2" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> Sent:?03/?03/?2015 10:42
>> To:<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=3" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> Subject:Re: [Plone-Users] Dexterity DataGridField Default Factory
>>
>> untested just of the top of my head: what happens if you return a 
>> tuple() ?
>>
>> On 2 March 2015 at 15:45, Simon Richardson <<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=4" 
>> target="_top" rel="nofollow" link="external">[hidden email]> wrote:
>>
>> > Hi Espen
>> >
>> > I haven't seen the issues:
>> >
>> > #33 I'll check the version is the latest and try again if not.
>> >
>> > #31 I have a vocabulary defined using a factory and it's working as
>> > required. So I don't think this will be my problem.
>> >
>> > I believe I should return a list of dicts from my  default factory 
>> (maybe
>> > I'm wrong?), but I get the unhashable error for the list. It seems that
>> > maybe a default can't be a list?
>> >
>> > ________________________________
>> > From: espen
>> > Sent: ?02/?03/?2015 15:13
>> > To:<a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=5" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> > Subject: Re: [Plone-Users] Dexterity DataGridField Default  Factory
>> >
>> > be sure to use the latest version
>> > 
>> https://github.com/collective/collective.z3cform.datagridfield/issues/33
>> >
>> > Also: did you see this:
>> > 
>> https://github.com/collective/collective.z3cform.datagridfield/issues/31
>> >
>> >
>> > 2. mars 2015 kl. 15:33 skrev Simon Richardson-2 [via Plone] <[hidden
>> > email]>:
>> >
>> > Hi Plone users
>> >
>> > I'm unable to create a default factory for a datagridfield field, 
>> due to
>> > running into a
>> >
>> > 'unhashable type: list' error
>> >
>> > Does anyone have an example of a datagridfield with a default value 
>> defined?
>> >
>> > Simon
>> >
>> > 
>> ------------------------------------------------------------------------------
>> > Dive into the World of Parallel Programming The Go Parallel Website,
>> > sponsored
>> > by Intel and developed in partnership with Slashdot Media, is your 
>> hub for
>> > all
>> > things parallel software development, from weekly thought 
>> leadership blogs
>> > to
>> > news, videos, case studies, tutorials and more. Take a look and 
>> join the
>> > conversation now. http://goparallel.sourceforge.net/
>> > _______________________________________________
>> > Plone-Users mailing list
>> > <a href="<a 
>> href="x-msg://30/user/SendEmail.jtp?type=node&amp;amp;node=7573305&amp;amp;i=0">x-msg://30/user/SendEmail.jtp?type=node&amp;node=7573305&amp;i=0"
>> > target="_top" rel="nofollow" link="external">[hidden email]
>> > https://lists.sourceforge.net/lists/listinfo/plone-users
>> >
>> >
>> > ________________________________
>> > If you reply to this email, your message will be added to the 
>> discussion
>> > below:
>> >http://plone.293351.n2.nabble.com/Dexterity-DataGridField-Default-Factory-tp7573305.html
>> > To start a new topic under General Questions, email [hidden email]
>> > To unsubscribe from Plone, click here.
>> > NAML
>> >
>> >
>> >
>> > ________________________________
>> > View this message in context: Re: Dexterity DataGridField Default 
>> Factory
>> > Sent from the General Questions mailing list archive atNabble.com 
>> <http://nabble.com/>.
>> >
>> > 
>> ------------------------------------------------------------------------------
>> > Dive into the World of Parallel Programming The Go Parallel Website,
>> > sponsored
>> > by Intel and developed in partnership with Slashdot Media, is your 
>> hub for
>> > all
>> > things parallel software development, from weekly thought 
>> leadership blogs
>> > to
>> > news, videos, case studies, tutorials and more. Take a look and 
>> join the
>> > conversation now.http://goparallel.sourceforge.net/
>> > _______________________________________________
>> > Plone-Users mailing list
>> ><a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=6" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> >https://lists.sourceforge.net/lists/listinfo/plone-users
>> >
>>
>>
>> --
>> Best Regards,
>>
>> Christian Ledermann
>>
>> London - UK
>> Mobile : +44 7474997517
>>
>> <*)))>{
>>
>> If you save the living environment, the biodiversity that we have left,
>> you will also automatically save the physical environment, too. But If
>> you only save the physical environment, you will ultimately lose both.
>>
>> 1) Don't drive species to extinction
>>
>> 2) Don't destroy a habitat that species rely on.
>>
>> 3) Don't change the climate in ways that will result in the above.
>>
>> }<(((*>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming The Go Parallel Website, 
>> sponsored
>> by Intel and developed in partnership with Slashdot Media, is your 
>> hub for all
>> things parallel software development, from weekly thought leadership 
>> blogs to
>> news, videos, case studies, tutorials and more. Take a look and join the
>> conversation now.http://goparallel.sourceforge.net/
>> _______________________________________________
>> Plone-Users mailing list
>> <a 
>> href="x-msg://12/user/SendEmail.jtp?type=node&amp;node=7573330&amp;i=7" 
>> target="_top" rel="nofollow" link="external">[hidden email]
>> https://lists.sourceforge.net/lists/listinfo/plone-users
>>
>>
>> ------------------------------------------------------------------------
>> If you reply to this email, your message will be added to the 
>> discussion below:
>> http://plone.293351.n2.nabble.com/Dexterity-DataGridField-Default-Factory-tp7573305p7573330.html
>> To start a new topic under General Questions, email[hidden email] 
>> </user/SendEmail.jtp?type=node&node=7573331&i=1>
>> To unsubscribe from Plone,click here.
>> NAML 
>> <http://plone.293351.n2.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
>
> ------------------------------------------------------------------------
> View this message in context: Re: Dexterity DataGridField Default 
> Factory 
> <http://plone.293351.n2.nabble.com/Dexterity-DataGridField-Default-Factory-tp7573305p7573331.html>
> Sent from the General Questions mailing list archive 
> <http://plone.293351.n2.nabble.com/General-Questions-f293352.html> at 
> Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming The Go Parallel Website, sponsored
> by Intel and developed in partnership with Slashdot Media, is your hub for all
> things parallel software development, from weekly thought leadership blogs to
> news, videos, case studies, tutorials and more. Take a look and join the
> conversation now. http://goparallel.sourceforge.net/
>
>
> _______________________________________________
> Plone-Users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/plone-users

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/

_______________________________________________
Plone-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.