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

QueryAjaxModelLoader usage with subdocument (case unmentioned in documentation) #1979

Open
rkhaled0 opened this issue Apr 28, 2020 · 1 comment

Comments

@rkhaled0
Copy link

Hi,

In this following condition, the name of the QueryAjaxModelLoader instantiated must match a specific syntax !

For example,

with these models :

class Item:
  name = fields.StringField()

class ProvisioningPlan:
  on = fields.ReferencedField(Item)

class Order:
  name = fields.StringField()
  provisioningPlan = fields.EmbeddedDocumentField(ProvisioningPlan)

My view inherits from ModelView

With this one, it's works

class OrderView:
    form_subdocuments = {
        'provisioningPlan': {
            'form_ajax_refs': {
                'on': QueryAjaxModelLoader(name='provisioningplan-on', model=Item, fields=['name',])
            }
        }
    }

So, I have concatenate the subdocument name with his attribute.

It would be very helpful to add a mention in the documentation.

@forlAIght
Copy link

Could you explained what functions have been added to the View?

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

No branches or pull requests

2 participants