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

Support nested custom schemas for models #76

Closed
mcaldas opened this issue Aug 25, 2017 · 11 comments
Closed

Support nested custom schemas for models #76

mcaldas opened this issue Aug 25, 2017 · 11 comments

Comments

@mcaldas
Copy link

mcaldas commented Aug 25, 2017

Hi,
Is there a chance you can add support for custom schemas inside a model?
For example, lets say i have a user model, and on of its fields is a custom schema, lets say

var subscriptionSchema = new mongoose.Schema({
  type: {
    type: String,
    enum: ['type1', 'type2', 'type3'],
  },
  data: mongoose.Schema.Types.Mixed,
  expires_at: Date
});

And in the user schema we have among others:

userSchema = new mongoose.Schema({
    subscription: subscriptionSchema
});

Right now there is no way to handle or visualize those in the admin panel, they just appear as objects.

@arnaudbesnier
Copy link
Member

@mcaldas Thanks for the feedback!

We definitely need to work on this.
We might plan it for the next sprint.

@mcaldas
Copy link
Author

mcaldas commented Aug 25, 2017

@arnaudbesnier great!
When is your next sprint? :)

@arnaudbesnier
Copy link
Member

Next week ;)

@mcaldas
Copy link
Author

mcaldas commented Aug 25, 2017

Great!

@arnaudbesnier
Copy link
Member

The support is available on the latest liana version 1.2.3.

Thanks again!
Let us know if it does not work as expected.

🌲🌲🌲

@mcaldas
Copy link
Author

mcaldas commented Aug 29, 2017

@arnaudbesnier seems to be working thank you!
I realized that composite mongoose types aren't serialized either, for example mongoose.Schema.Types.Point
Is that a different issue?

@mcaldas
Copy link
Author

mcaldas commented Aug 29, 2017

@arnaudbesnier another issue is that on list view i see something like <client@model:forest-users-someschema::ember5328:owner(XXXXXXXX)>
Is that the expected behavior?

@arnaudbesnier
Copy link
Member

@mcaldas, you are right on both points. Can you create an issue for each comment?
We'll try to prioritise the fixes for next week.

@mcaldas
Copy link
Author

mcaldas commented Aug 29, 2017 via email

@mcaldas
Copy link
Author

mcaldas commented Aug 30, 2017

@arnaudbesnier just created the 2 issues: #78 #79

@aharon-vish
Copy link

Hi,
For me, it's doesn't work.
When I turn the field to mongoose.Schema.Types.Mixed the field in forest admin is disappear.

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

3 participants