Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: KalpakD on May 16, 2021, 09:25:52 pm

Title: Output of python code generation..
Post by: KalpakD on May 16, 2021, 09:25:52 pm
Generated code from "basic python model" the Class A code is:
Code: [Select]
import ClassC
import ClassB

class ClassA:
    classC= ClassC()

    classB= ClassB()

    def OperationA(ParameterOne : int, ParameterTwo : int) -> int:
        pass

    def OperationB(ParameterOne : int, ParameterTwo : int) -> int:
        pass
The attributes have not generated any code.
Any other setting required?
Title: Re: Output of python code generation..
Post by: Takeshi K on May 17, 2021, 10:26:58 am
Hello KalpakD,

To generate Python attributes, you need to assign initial values.

Press Ctrl+5 to open the Feature window, then select the ClassA and enter some value to the Initial field. Then, generate source code again.

HTH,
Title: Re: Output of python code generation..
Post by: KalpakD on May 17, 2021, 03:10:53 pm
Dear Takeshi,
   That worked.
But is there a way to do model syntax check before generating code?
Thanks,