Skip to content

Conversation

@LavergneC
Copy link

No description provided.

@LavergneC LavergneC marked this pull request as draft June 6, 2025 14:56
for faction in Card.Faction.as_list():
heroes = [
card.name
for card in Card.objects.filter(type=Card.Type.HERO, faction=faction)
Copy link
Owner

@Ajordat Ajordat Jun 8, 2025

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.

Copy link
Author

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,
Copy link
Author

@LavergneC LavergneC Jun 12, 2025

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,
Copy link
Author

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

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

Successfully merging this pull request may close these issues.

2 participants