-
Notifications
You must be signed in to change notification settings - Fork 1
Collectible photo model #25
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?
Conversation
…into idol-collection adding updates from idol-model following review of idol-model pull request
…ant before views are added
…er event and photoset models are added
…into idol-collection merging in typo fix
… photo-model merging idol model changes from master
… idol-collection merging idol model from master
…s without breaking stuff, so taking it back out
…into collectible-photo-model pulling in some photo model changes
…Love into photo-collection Merging in idol-collection
… collectible-photo-model Merge from main
… collectible-photo-model pulling in photo-model and idol-collection from master
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.
LGTM, amazing work! Especially on the collectible model!
title = _('Photo') | ||
plural_title = _('Photos') | ||
icon = 'cards' | ||
navbar_title = _('Photos') |
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.
It should already be the same value as plural_title by default.
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.
Does this mean navbar_title does not need to be set?
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.
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']})}) |
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.
'{static_url}img...
-> u'{static_url}img...
Othwerwise if the name of the image contains special characters it will crash.
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.
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? |
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.
Not sure what you mean by that, can you tell me which models share the data?
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 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 |
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.
You may also need art_url
, http_art_url
, image_url
and http_image_url
in the future.
Continuing erys' merge from PR #25
Adding model for collectible photo. Also contains the changes from the photo-collection pr, so that one should probably be merged first.