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

How connected models Position and SecurityQuote? #2

Open
pikhovkin opened this issue Dec 29, 2016 · 1 comment
Open

How connected models Position and SecurityQuote? #2

pikhovkin opened this issue Dec 29, 2016 · 1 comment
Assignees
Labels
Milestone

Comments

@pikhovkin
Copy link

class Account(Base):
    ...
    
    @hybrid_property
    def holdings_value(self):
        res = Counter()
        for position in self.positions:
            if position.is_open:
                latest_quote = object_session(position).query(SecurityQuote).order_by('date desc').limit(1).first()

I am not an expert in Alchemy. How connected models Position and SecurityQuote? In which field linked these models?

@llazzaro
Copy link
Owner

llazzaro commented Jan 2, 2017

There is a missing link in the model here. I think that holdings_value was a draft.
I will fix this soon

@llazzaro llazzaro self-assigned this Jan 2, 2017
@llazzaro llazzaro added the bug label Jan 2, 2017
@llazzaro llazzaro added this to the 0.1.7 milestone Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants