-
-
Notifications
You must be signed in to change notification settings - Fork 5
Draft: Advanced filters with buttons for own deck page #69
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
base: master
Are you sure you want to change the base?
Draft: Advanced filters with buttons for own deck page #69
Conversation
| for faction in Card.Faction.as_list(): | ||
| heroes = [ | ||
| card.name | ||
| for card in Card.objects.filter(type=Card.Type.HERO, faction=faction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, heroes need to be filtered further. That's because each set reprints heroes but are still considered different cards. Furthermore, promos are also extracted with this query.
We should extract the cards that:
- type = hero
- set = CORE
- not promo
I can also see with DJDT (button on the right) that there are six queries that are very similar. That happens because this query is run one time per faction. I was wondering if we could reduce that to a single query and sorting heroes by faction and reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both Done
+ some setup modification
| set=set, | ||
| main_effect=main_effect, | ||
| stats={"reserve_count": reserve_count, "permanent_count": permanent_count}, | ||
| **kwargs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I needed this in order to specify "is_promo" from generate_card
| name=data["name"], | ||
| faction=faction, | ||
| card_set=data["card_set"] if card_set else None, | ||
| set=data["card_set"] if card_set else None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've changed "card_set" to "set". I looked like an error and was preventing my set selection
No description provided.