Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HiddenIn & ViewedIn syntax #57

Open
stepanzalis opened this issue Mar 15, 2023 · 1 comment
Open

HiddenIn & ViewedIn syntax #57

stepanzalis opened this issue Mar 15, 2023 · 1 comment

Comments

@stepanzalis
Copy link

stepanzalis commented Mar 15, 2023

Hey! First, I would like to thank you for your package, so far I really like it.
I currently struggle with @HiddenIn and @ViewedIn syntax. Let's say I have following entities:

  • Project
  • Task
  • Subtask

Example:

@Model(views: [...])
abstract class Project {
  List<Task> get tasks;
}

Project has many tasks:

@Model(views: [...])
abstract class Task {
  Project get project;
  List<Subtask> get subtasks;
}

and access to subtasks (for example from Task entity I need to show how many subtasks are in there.

@Model(views: [..])
abstract class Subtask {
  Task get task;
}

Problem:

I don't understand the @hiddenin & @ViewedIn syntax in order not to get cyclic dependencies. Can you please provide me example how to add the Views in order to get List<Task> from Project and List<Subtask> from Task?
Thanks!

@schultek
Copy link
Owner

Thanks.

Did you have a look at the example? What exactly is unclear?

Generally I know its quite hard to get and I'm also not really happy with the system right now, but I couldn't figure out a better way yet. If you have some pointers I'm happy to try and improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants