Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is it possible to import a specific template from a module?Forum ↗

Is it possible to import a specific template from a module?

App Development7 posts524 views9 likesLast activity May 2020
ME
meetOP
Apr 2020 2

Is it possible to import a specific template from a module?

RO
rohanjr
Apr 2020 1

You could try using an import list, something like

import M (T(..))

where M is the module and T is the template name.

CO
cocreature
Apr 2020 5

Note that this will only import the template. If your template has choices other than Archive that you want to exercise you will need to import them separately, e.g.,

import M (T(..), MyChoice(..))

There is currently no way to say “import a template and all its choices”.

ME
meet
May 2020 1

@cocreature I see - that feels awkward from a developer experience perspective. Are there any future plans to allow automatic import of all choices of a template when you import the template?

CO
cocreature
May 2020
meet:

Are there any future plans to allow automatic import of all choices of a template when you import the template?

Right now we don’t have plans for this.

ME
meet
May 2020
cocreature:

Note that this will only import the template. If your template has choices other than Archive that you want to exercise you will need to import them separately, e.g.,

import M (T(..), MyChoice(..))

There is currently no way to say “import a template and all its choices”.

I assume the reason is you’re importing the underlying data records autogenerated for every template and choice so need to explicitly specify each one?

CO
cocreature
May 2020
meet:

I assume the reason is you’re importing the underlying data records autogenerated for every template and choice so need to explicitly specify each one?

Exactly, we just piggy-back on top of the standard Haskell exports and imports so there is nothing special for templates here.

← Back to Discussions