Index: /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_create_do.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_create_do.py	(revision 442)
+++ /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_create_do.py	(revision 442)
@@ -0,0 +1,41 @@
+##parameters=type_name, datamodel
+# $Id: cpsdocument_create_do.py 34091 2006-03-06 18:37:08Z atchertchian $
+"""
+Create an empty object in the context according to the datamodel.
+
+Datamodel may be examined to create a suitable id.
+
+Returns the created object (usually a proxy).
+"""
+from Products.CMFCore.utils import getToolByName
+
+id = datamodel.get('prefix').upper()
+datamodel.set('prefix',id)
+bl = context.portal_catalog({'meta_type': "ScratchCardBatch"})
+b_ids = [b.getId(), for b in bl]
+next = 1
+while "%(prefix)s_%(next)d" % vars() in b_ids:
+    next += 1
+id = "%(prefix)s_%(next)d" % vars()
+##if not id:
+##    id = 'my ' + type_name
+##id = context.computeId(compute_from=id) # XXX shouldn't use a skin
+##
+language = datamodel.get('Language')
+if not language:
+    ts = getToolByName(context, 'translation_service')
+    language = ts.getSelectedLanguage()
+
+# Datamodel is passed so that flexti can initialize the object.
+new_id = context.invokeFactory(type_name, id, datamodel=datamodel,
+                               language=language,
+                               )
+if new_id is not None:
+    id = new_id
+
+ob = getattr(context, id)
+ob.getContent().edit(mapping=datamodel)
+
+context.notifyCPSDocumentCreation(ob=ob) # BBB obsolete in CPS 3.5.0
+
+return ob
Index: /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_created.py
===================================================================
--- /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_created.py	(revision 442)
+++ /WAeUP_SRP/trunk/skins/waeup_student/scratch_card_batch_created.py	(revision 442)
@@ -0,0 +1,4 @@
+##parameters=
+# $Id: cpsdocument_create_do.py 34091 2006-03-06 18:37:08Z atchertchian $
+
+return
