Menu

How to add specific code to the generated methods?

2023-06-17
2023-06-17
  • David Camperos

    David Camperos - 2023-06-17

    Hello,

    I have issues when I try to run the generated code from external modules.

    I have generated Python classes using subclass, so I have a model.py and a model_subs.py files. From my external code I can reach models_subs but from it I cannot reach model.py, so something is happening with the interpreter path.

    I am able to workaround it by applying in models_subs the following statement: sys.path.append(os.path.abspath(__file__ + "/.."))

    I place it before the import models as supermod, and everything works good.

    Is there a way to instruct cli to do it automatically?

    I am attaching an screenshot on how it does look.

    Thank you!

     
  • David Camperos

    David Camperos - 2023-06-17

    Forgot to mention: I have added an __init__.py file in the same directory as the models.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.