Created
January 4, 2017 16:34
-
-
Save ddahan/bcce8d6e19a406e98de6ec4283604759 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# views.py | |
# Création du 'modèle' de tuple | |
ClientInfosTuple = namedtuple( | |
'ClientInfosTuple', # Nom du tuple | |
['client_str', 'birth_date', 'gender', 'nb_points', 'first_scan', | |
'last_scan', 'nb_scans', 'nb_redeemdeals']) | |
# ... | |
# Création du tuple lui-même : | |
client_infos = [ClientInfosTuple( | |
client_str=c.user.mail_prefix, | |
birth_date=c.user.birth_date, | |
gender=c.user.gender, | |
nb_points=Points.get_client_points(c, shop_group).nb_current_points, | |
first_scan=ScanEvent.get_client_first_scan_sg(c, shop_group), | |
last_scan=ScanEvent.get_client_last_scan_sg(c, shop_group), | |
nb_scans=ScanEvent.get_client_scan_events_sg( | |
c, shop_group, True).count(), | |
nb_redeemdeals=DealRecipients.get_client_redeem_events( | |
c, shop_group).count()) \ | |
for c in clients] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment