Ticket #62 (closed review: fixed)

Opened 1 year ago

Last modified 1 year ago

Allow population of EntityList and EntitySet fields using initial/sample data

Reported by: mscott Assigned to: mscott
Priority: normal Milestone: Schevo 3.1a1
Component: Schevo Keywords:
Cc:

Description

From lekma via http://groups.google.com/group/schevo/browse_thread/thread/176a14025482018

Attached is a patch that allows the '_initial' Entity notation for 
EntityList and EntitySet. 
example: 
class Foo(E.Entity): 
    name = f.string() 
    _key(name) 
    _initial = [ 
                ("foo1",), 
                ("foo2",), 
               ] 
class Bar(E.Entity): 
    name = f.string() 
    foos = f.entity_list("Foo") 
    _initial = [ 
                ("bar1", [("foo2",), ("foo1",)]), 
                ("bar2", [("foo1",), ("foo2",)]), 
               ] 

Attachments

populate_set_list_transaction.py.diff (3.1 kB) - added by mscott on 09/05/07 17:47:13.

Change History

09/05/07 17:47:13 changed by mscott

  • attachment populate_set_list_transaction.py.diff added.

09/05/07 18:01:34 changed by mscott

  • owner set to mscott.
  • status changed from new to assigned.
  • type changed from discussion to implementation.

09/05/07 21:55:25 changed by mscott

  • type changed from implementation to review.

Made some minor modifications to the patch in order for it to work with fields like this:

foos_or_bars = f.entity_list('Foo', 'Bar')

...where initial values are presented using the (extent_name, value_tuple) format.

See source:branches/entitylist-initial-62/Schevo/schevo/test/test_field_entityset.py?rev=3518#L98 for an example of what I'm referring to.

Ready for review and merge.

09/06/07 12:38:06 changed by mscott

  • status changed from assigned to closed.
  • resolution set to fixed.

Merged at r3519.