Skip to content

Conversation

erys
Copy link
Collaborator

@erys erys commented Jun 30, 2018

Adding model for collectible photo. Also contains the changes from the photo-collection pr, so that one should probably be merged first.

erys added 29 commits May 19, 2018 23:16
…into idol-collection

adding updates from idol-model following review of idol-model pull request
… photo-model

merging idol model changes from master
…s without breaking stuff, so taking it back out
…into collectible-photo-model

pulling in some photo model changes
… collectible-photo-model

pulling in photo-model and idol-collection from master
@erys erys requested a review from db0company June 30, 2018 03:11
Copy link
Member

@db0company db0company left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, amazing work! Especially on the collectible model!

title = _('Photo')
plural_title = _('Photos')
icon = 'cards'
navbar_title = _('Photos')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should already be the same value as plural_title by default.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean navbar_title does not need to be set?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly :)

def to_fields(self, view, item, *args, **kwargs):
_photo_images = PHOTO_IMAGES.copy()
_photo_images.update({'color': '{static_url}img/color/{value}.png'.format(**{'value':item.color, 'static_url':RAW_CONTEXT['static_url']}),
'rarity': '{static_url}img/rarity/{value}.png'.format(**{'value':item.rarity, 'static_url':RAW_CONTEXT['static_url']})})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'{static_url}img... -> u'{static_url}img...

Othwerwise if the name of the image contains special characters it will crash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually you can use staticImageURL in magi.utils:

        _photo_images.update({
            'color': staticImageURL(item.color, folder='color', extension='png'),
            'rarity': staticImageURL(item.rarity, folder='rarity', extension='png'),
        })


rank = models.PositiveIntegerField(_('Rank'), default=1)

# TODO: moment based things are the same across, do I need an intermediate model for moment things?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean by that, can you tell me which models share the data?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also don't know what this means...


@property
def art(self):
return self.photo.art_special_shot if self.special_shot_unlocked and not self.prefer_normal_shot else self.photo.art
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may also need art_url, http_art_url, image_url and http_image_url in the future.

AlexaDeGrandmont pushed a commit to AlexaDeGrandmont/MajiLove that referenced this pull request Jul 15, 2019
db0company added a commit that referenced this pull request Jul 17, 2019
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.

3 participants