equal
deleted
inserted
replaced
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 |