devtools/fill.py
branchstable
changeset 8238 087bb529035c
parent 7995 9a9f35ef418c
child 9207 c99e97e9f566
equal deleted inserted replaced
8235:c2a91d6639d8 8238:087bb529035c
   304 def make_entity(etype, schema, vreg, index=0, choice_func=_default_choice_func,
   304 def make_entity(etype, schema, vreg, index=0, choice_func=_default_choice_func,
   305                 form=False):
   305                 form=False):
   306     """generates a random entity and returns it as a dict
   306     """generates a random entity and returns it as a dict
   307 
   307 
   308     by default, generate an entity to be inserted in the repository
   308     by default, generate an entity to be inserted in the repository
   309     elif form, generate an form dictionnary to be given to a web controller
   309     elif form, generate an form dictionary to be given to a web controller
   310     """
   310     """
   311     eschema = schema.eschema(etype)
   311     eschema = schema.eschema(etype)
   312     valgen = ValueGenerator(eschema, choice_func)
   312     valgen = ValueGenerator(eschema, choice_func)
   313     entity = attrdict()
   313     entity = attrdict()
   314     # preprocessing to deal with _format fields
   314     # preprocessing to deal with _format fields