question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inheriting models depends on filename

See original GitHub issue

I have the following models:

models/Repair.js
models/Maintenance.js
models/Service.js

and want Maintenance and Repair to inherit Service:

Maintenance.js

    ...
    var Maintenance = new keystone.List('Maintenance', {
        inherits: keystone.list('Service'),
    });
    ...

but I get the following error:

ReferenceError: Unknown keystone list "Service"

If I change the name of Service.js to AAService.js, it works fine.

Is there any way to remove the alphabetic dependency for inherits:, e.g., to specify a List/modelcreation order?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
webteckiecommented, Feb 2, 2016

@morenoh149 there’s a lot of info here that probably should be documented. Perhaps create a doc issue to handle it.

0reactions
morenoh149commented, Feb 2, 2016

@webteckie so do we need to document this implementation detail? no way to fix this right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Inheritance of a class depending on another inherited class
I'm modeling an Epub book. An Epub is basically a .zip file containing .html documents as the chapters. so that is the structure...
Read more >
Inherit Model File Name/Use drawing model file na...
In Windchill and Creo 6 it is possible use auto-numbering for Parts and Assemblies but having the Drawing use the number/filename of is ......
Read more >
SQL models - dbt Developer Hub
The model name is inherited from the filename. Models can be nested in subdirectories within the models directory. When you execute the dbt...
Read more >
Manage DTDL models - Azure Digital Twins | Microsoft Learn
The RetrieveModelWithDependencies call returns not only the requested model, but also all models that the requested model depends on. Models ...
Read more >
Writing two models toghether, in the same module, shows me ...
I am writing this code: class my_class_a(models. ... two models toghether, in the same module, shows me a key error "account.invoice" (inherited model) ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found