File tree Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Expand file tree Collapse file tree 2 files changed +24
-7
lines changed Original file line number Diff line number Diff line change 3
3
<Document name =" iris-python-template.ZPM" >
4
4
<Module >
5
5
<Name >iris-python-template</Name >
6
- <Version >1 .0.4 </Version >
6
+ <Version >2 .0.1 </Version >
7
7
<Description >The simplest template to run embedded python</Description >
8
8
<Packaging >module</Packaging >
9
9
<SourcesRoot >src</SourcesRoot >
Original file line number Diff line number Diff line change @@ -4,25 +4,42 @@ Class dc.python.PersistentClass Extends %Persistent
4
4
/// Description
5
5
Property Test As %VarString ;
6
6
7
- ClassMethod CreateRecord (ByRef id As %Integer ) As %Status
7
+ ClassMethod CreateRecord (propValue As %VarString = " TestString " , ByRef id As %Integer ) As %Status
8
8
{
9
9
set sc =$$$OK
10
- set objPC =..%New ()
11
- set objPC .Test =" Test string"
12
- set sc =objPC .%Save ()
13
- set id =objPC .%Id ()
10
+ set obj =..%New ()
11
+ set obj .Test =propValue
12
+ set sc =obj .%Save ()
13
+ set id =obj .%Id ()
14
+ return sc
15
+ }
16
+
17
+ ClassMethod CreateRecordPython (propValue As %VarString , ByRef id As %Integer ) [ Language = python ]
18
+ {
19
+ import iris
20
+ obj =iris .cls (__name __)._New ()
21
+ obj .Test =propValue
22
+ sc =obj ._Save ()
23
+ id =obj ._Id ()
14
24
return sc
15
25
}
16
26
17
27
/// opens the record by id and reads its property
18
- ClassMethod ReadProperty (id As %Integer ) As %Status
28
+ ClassMethod PrintProperty (id As %Integer ) As %Status
19
29
{
20
30
Set sc = $$$OK
21
31
set obj =..%OpenId (id ,,.sc )
22
32
if $ISOBJECT (obj ) write obj .Test
23
33
Return sc
24
34
}
25
35
36
+ ClassMethod PrintPropertyPython (id As %Integer ) [ Language = python ]
37
+ {
38
+ import iris
39
+ obj =iris .cls (__name __)._OpenId (id )
40
+ print (obj .Test )
41
+ }
42
+
26
43
Storage Default
27
44
{
28
45
<Data name =" PersistentClassDefaultData" >
You can’t perform that action at this time.
0 commit comments