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

Private fields and db_field arg’ #153

Open
jul-grnx opened this issue Sep 2, 2020 · 0 comments
Open

Private fields and db_field arg’ #153

jul-grnx opened this issue Sep 2, 2020 · 0 comments

Comments

@jul-grnx
Copy link

jul-grnx commented Sep 2, 2020

Hello,

I’m playing with private fields with MongoEngine and Graphene-Mongo like this:

class MyDocument(Document):
    # define a “private” field (with underscore)
    # but set the database field without the underscore:
    _private = StringField(db_field="private")

class MyType(MongoengineObjectType):
    class Meta:
        model = MyDocument

And… the generated MyType has a field named Private (not private).

That make me ask 2 questions:

  • It seems the conversion snake_case to camelCase does not make any special case for leading underscore: is it normal?
  • Why not consider the database field?
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

1 participant