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
Proposal - store generated object field value to generate depended fields #107
Comments
from elizabeth import Personal
p = Personal('en')
saved_age = p.age(18, 25)
do_something(saved_age) |
:) |
I understand and i think that it's not good idea. We have to many methods in all providers. |
SO lib should be used for generate for unrelated, noise data. |
@yn-coder You don't understand. Depended data is very cool, but i think that saving data in object is not good idea. We need something else. |
Some cash? |
@yn-coder Not yet. |
Why? Can you explain? |
@yn-coder Maybe I do not understand what you want. You can try add your feature in your fork. If everything is okay we also add it to Elizabeth. Maybe like that: from elizabeth import Personal
p = Personal(locale='en', dependent=True) Give us example of how it will work. |
I read your examples of Elizabeth usage, and now I think I understood.
Now I see the root of our miscommunication. I'll prepare a some example for my proposal in a fork. |
Exactly! |
This is a simple illustration for my idea in my fork Code is not production ready, just a demo. |
@yn-coder Generally it looks good. But i think that this def __init__(self, locale='en'):
"""
:param locale: Current language.
"""
self.locale = locale
self.data = pull('personal.json', self.locale)
self.stored_age = 0 Should be: def __init__(self, locale='en'):
"""
:param locale: Current language.
"""
self.locale = locale
self.data = pull('personal.json', self.locale)
self._store = {'age': 0} What do you think about it? |
Now i see that it's can be really useful. |
You think |
@yn-coder Yes, we can store in |
@yn-coder Great! Please, check it with pycodestyle (or with similar tool) and send us PR. |
Also don't forget about tests. |
This is a proposal.
Right now I type
And got output
Because age is generated by request and doesn't store in object
p
. What if I want to add the fieldchild_count
orwork experience
, depend on previously generatedage
value?The text was updated successfully, but these errors were encountered: