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

Adding object twice #49

Closed
romaninsh opened this issue May 5, 2017 · 1 comment
Closed

Adding object twice #49

romaninsh opened this issue May 5, 2017 · 1 comment

Comments

@romaninsh
Copy link
Member

When an object is already added into the container, adding it again may cause some problems (e.g. maybe same ID, or project needs additional initialization).

One scenario would be if you create field object, add to one form then add to another one, what should happen? Or if you take field from one model and add it into another?

History

Initially, this was permitted and init() would be called again when added the second time.

In #41 we added protection preventing from second initialization, but it created some problems.

In #48 we changed so that init() is not called the second time.

Ideas

When adding the existing object into another container, call attach() method.

@romaninsh
Copy link
Member Author

addressed in #48

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

No branches or pull requests

1 participant