Thanks Carl! You're great! Now it works fine.
Octavian ----- Original Message ----- From: "Carl Franks" <fireart...@gmail.com> To: "HTML Form Creation,Rendering and Validation Framework" <html-formfu@lists.scsys.co.uk> Sent: Friday, June 25, 2010 4:17 PM Subject: Re: [html-formfu] Bug? > On 25 June 2010 13:15, Octavian Rasnita <orasn...@gmail.com> wrote: >> Thanks for telling me about that script. I didn't know about it. >> >> I have tested a config file that has a single <constraints>...</constraints> >> and the results printed was a hashref like: >> >> constraints => { >> type => 'Required', >> }, >> >> but if I added 2 constraints, the result was an arrayref: >> >> constraints => [ >> { >> type => 'Required', >> }, >> { >> type => 'Word', >> }, >> ], >> >> So I don't know what it should be, a hashref, or an arrayref that contains >> more hashrefs. >> >> Or maybe it works with both of them, but I don't know then why it gives that >> error when it is not a hashref. > > I've updated the _merge_hashes() method so it can also merge arrays > and hashes into a new array. > For example, this: > > --- > default_args: > elements: > DateTime: > constraints: > - type: DateTime > parser: > strptime: '%Y-%m-%d %H:%M:00' > elements: > - type: DateTime > name: foo > constraints: > type: Required > > Will now be munged into this, before being passed to populate() > > --- > elements: > - type: DateTime > name: foo > constraints: > - type: DateTime > parser: > strptime: '%Y-%m-%d %H:%M:00' > - type: Required > > This is fixed in svn -r1724 > > Cheers, > Carl > > _______________________________________________ > HTML-FormFu mailing list > HTML-FormFu@lists.scsys.co.uk > http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu