
    fz[                        d dl mZ d dlmZ d dlmZ d dlZd dlmZ d dl	m
Z
 d dlmZ d dl d d	lmZ d d
lmZ d dlmZmZ d dlZd dlmZ d Z G d de      Z G d dee      Z ej4                  ede        G d dej8                        Z G d dej8                        Z G d dej8                        Z G d dej8                        Z  G d dej8                        Z! ej4                  e"de!        G d dej8                        Z# G d  d!ej8                        Z$ G d" d#ej8                        Z% G d$ d%ej8                        Z& G d& d'ej8                        Z' G d( d)ej8                        Z( G d* d+ej8                        Z) G d, d-ej8                        Z* G d. d/ej8                        Z+ G d0 d1ej8                        Z, G d2 d3ej8                        Z- G d4 d5ej8                        Z.y)6    )unicode_literals)timezone)modelsN)
ImageField)slugify)	post_save)*)get_random_string)BaseUserManager)AbstractBaseUserPermissionsMixinc                     | j                   }|}|j                  j                  |      j                         r:|t	        d      z   }|j                  j                  |      j                         r:|S )N)slug   )length)	__class__objectsfilterexistsr
   )instancer   modelunique_slugs       /Users/christophesurbier/Dropbox/Mon Mac (MacBook-Air-de-christophe.local)/Documents/Programmation/SellTix/tixsellbackend/backoffice/models.pyunique_slugifyr      sf    EK
--

K

0
7
7
9.a88 --

K

0
7
7
9    c                   $    e Zd ZdZd ZddZd Zy)UserManagerTc                     |st        d      | j                  |      } | j                  dd|i|}|j                  |       |j	                  | j
                         |S )zM
        Creates and saves a User with the given email and password.
        zThe given email must be setemail)using )
ValueErrornormalize_emailr   set_passwordsave_db)selfr   passwordextra_fieldsusers        r   _create_userzUserManager._create_user   s`     :;;$$U+tzz666(#			!r   Nc                 N    |j                  dd        | j                  ||fi |S )Nis_superuserF)
setdefaultr+   r'   r   r(   r)   s       r   create_userzUserManager.create_user&   s,    6 t  ALAAr   c                     |j                  dd       |j                  d      durt        d       | j                  ||fi |S )Nr-   Tz&Superuser must have is_superuser=True.)r.   getr"   r+   r/   s       r   create_superuserzUserManager.create_superuser*   sK    5N+47EFF t  ALAAr   N)__name__
__module____qualname__use_in_migrationsr+   r0   r3   r!   r   r   r   r      s    
BBr   r   c            
          e Zd Z ej                  dej                  d      Z ej                  dd      Z	 ej                  ddd      Z ej                  d	dd      Z ej                  d
d      Z ej                  dd      Z ej                  dd      Z ej                  ddd      Z ej                  ddd      Z ej                  d      Z ej                  ddd      Z ej                  ddd      Z ej                  ddd      Z ej                  ddd      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej                  d      Z ej>                  dd      Z  ej                  ddd      Z! ej                  ddd      Z" ej                  ddd      Z# ej                  ddd      Z$ ej                  ddd      Z% ej                  ddd      Z& ej                  ddd      Z' ej                  ddd      Z( ej                  ddd      Z) ej                  dd      Z* ej                  ddd      Z+ ej                  ddd      Z, ej                  d      Z- ej                  d      Z. ej^                  d      Z0 ej                  ddd      Z1 ej                  dd      Z2 ej                  d      Z3 ej                  ddd      Z4 ej                  dde5jl                  D  cg c]  }||f c}} d       Z7 ej                  d      Z8 ej^                  d!      Z9 ej                  dd      Z: ej                  dd      Z; ej                  d"d#      Z< ej                  d$d%      Z=d&Z>g Z? e@       ZAd' ZBy(c c}} w ))UserTFprimary_keydefaulteditablezemail address)uniquez
first name   
max_lengthblankz	last namezdate joinedauto_now_addactiver=   is_staffzphone number(   d   rB   nullrC      i   rL   rC      
      FRrB   r=         2   Europe/PariszUser's preferred timezone)rB   r=   choices	help_textr      eur   inactiver   c                     | j                   S r4   )r   r'   s    r   __str__zUser.__str__m   s    zzr   N)Cr5   r6   r7   r   	UUIDFielduuiduuid4id
EmailFieldr   	CharField
first_name	last_nameDateTimeFielddate_joinedBooleanField	is_activerH   phoneNumberwalletAddressgeneratedWallet	publicKey
privateKeywordspinCodeisOrganizercryptoAcceptedmaticAcceptedusdtAcceptedusdcAccepted
cbAccepted	TextFielddescriptionorganizerContractorganizerCompanyorganizerAddressorganizerCityorganizerZipCode	vatNumberorganizeWebsitetransactionHashnoncecountrysignInTokenstripeCustomerIdaccountLockedappleGoogleWalletIntegerFieldqrcodeTimeoutlastLoginCodelastLoginCodeDate	maticSent
webhookUrlpytzall_timezonesr   subscriptionsubscriptionPricesubscriptionStartDatesubscriptionEndDatesubscriptionCurrencysubscriptionStatusUSERNAME_FIELDREQUIRED_FIELDSr   r   r`   ).0tzs   00r   r:   r:   2   s   			dDJJ	OBF=E!!!<RtLJ   +2TJI&&&&TJK###X=I"v""J>H"&""NNK$F$$DIM)f))%8O   CTEI!!!SdFJF$TBEf#4dCG%&%%e4K(V((6N'F''5M&6&&u5L&6&&u5L$$$T2J"&""48K)))SdN(((CTM(((CTM%V%%$TJM(((CTM!!!SdFI'v''3DtLO&f&&#4dKOVDAEf!D9G"&""ct$GK'v''3DtL'F''6M+++E:'F''2M$F$$t$GM,,,$TB###E2I!!!SdFJv$($6$67b"b7-	H '6&&u5L+++A60F00dF.&..DtD+6++qG)))R
KNOmG 8s   O1r:   signal_updateuser)dispatch_uidsenderc                       e Zd Z ej                  eej                        Z ej                  dd      Z	 ej                  dd      Z
 ej                  d      Z ej                  d      Zd Zy	)
Seller	on_delete   TrA   FrG    c                 .    | j                   j                  S r4   )r*   r   r_   s    r   r`   zSeller.__str__x   s    yyr   N)r5   r6   r7   r   OneToOneFieldr:   CASCADEr*   rf   stripe_user_idstripe_access_tokenrk   stripe_charges_enabledrz   stripe_account_jsonr`   r!   r   r   r   r   r   sn    6?D%V%%DAN*&**cF0V00?*&**26r   r   c                       e Zd Z ej                  dej                  d      Z ej                  e	ej                        Z ej                  dd      Z ej                  d      Z ej                  d	      Z ej                  d
      Zy)	ScanUsersTFr;   r   rJ   )rB   r?   r\   rB   rD   auto_nowN)r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   r*   rf   loginr(   ri   	createdAt	updatedAtr!   r   r   r   r   |   s~    			dDJJ	OB6?DF48Ev2.H$$$$7I$$$d3Ir   r   c                       e Zd Z ej                  dej                  d      Z ej                  ddd      Z	 ej                  d      Z ej                  d      Z G d	 d
      Zd Zy)CategoryTFr;   r   zCategory Name)rB   rY   r?   rD   r   c                       e Zd ZdZy)Category.Meta
CategoriesNr5   r6   r7   verbose_name_pluralr!   r   r   Metar      s    (r   r   c                 ,    t        | j                        S r4   )strnamer_   s    r   r`   zCategory.__str__   s    499~r   N)r5   r6   r7   r   ra   rb   rc   rd   rf   r   ri   r   r   r   r`   r!   r   r   r   r      se    			dDJJ	OB6s_DQD$$$$7I$$$d3I) )r   r   c                       e Zd Z ej                  dej                  d      Z ej                  ddd      Z	 e
d      Z ej                  d      Z ej                  d	      Zd
 Zy)EventPageTemplateTFr;   rJ   rK   images)	upload_torD   r   c                 8    d| j                   | j                  fz  S Nz%d - %srd   r   r_   s    r   r`   zEventPageTemplate.__str__       TWWdii000r   N)r5   r6   r7   r   ra   rb   rc   rd   rf   r   r   imageri   r   r   r`   r!   r   r   r   r      se    			dDJJ	OBFDAD*E$$$$7I$$$d3I1r   r   c                       e Zd Z ej                  dej                  d      Z ej                  e	ej                  dd      Z ej                  eej                  dddd      Z ej                  eej                  ddd	
      ZdZ ej"                  edd      ZdZ ej"                  eddd      Z ej*                  dd      Z ej.                  ddd      Z ej.                  ddd      Z ej.                  ddd      Z ej.                  ddd      Z ej.                  ddd      Z ej.                  dd      Z ej<                  dddd      Z ej@                         Z! ej.                  d      Z" ej.                  d      Z# ej.                  d      Z$ ejJ                  de&jN                        Z( ej.                  dd !      Z& ej.                  d"d#!      Z) ej"                  d$%      Z* ejV                  dd&      Z, ej.                  d'dd      Z- ej.                  d'ddd()      Z. ej.                  d'ddd*)      Z/ ej.                  d+d,      Z0 ej*                  d-      Z1 ej*                  d-      Z2 ej*                  d-      Z3 ejh                  d.-      Z5 ejh                  d/-      Z6 ej*                  d-      Z7 ej"                  d-      Z8 ej*                  d-      Z9 ej.                  d'dd      Z: ej*                  d-      Z;d0Z< ej"                  e<dd      Z= ej*                  d-      Z> ej*                  d-      Z? ej                  d1dd2      ZA ej.                  d'dd      ZB ej*                  d-      ZC ej*                  d-      ZD ejJ                  d3      ZE ejJ                  d4      ZF G d5 d6      ZG fd7ZHd8 ZI xZJS )9EventTFr;   event_organiserr   rL   related_nameevent_categoryz"Category associated with the event)r   rL   rC   r   rY   event_page_template)r   rL   rC   r   ))r   Online)rT   Venue)rQ   Contentr   rX   r=   db_index)r   CreatedrT   	Published)rQ   CancelrT   z3Status of the event: 0:Created 1:Published 2:Cancel)rX   r=   r   rY   zFOrganizer does not want SellTix to reference this event on its website)r=   rY   rJ   rK      z
Event Name)rB   rY   r   )rB   r=   rL   r?   r   r   z6The UTC date of the event in format %Y-%m-%dT%H:%M:%SZ)rY   r=   rV   rW   rS   rP   EURz Duration of the event in minutes)rY   rN   rO   z6Link of the conference event if not managed by SellTixrB   rL   rC   rY   z#URL of the website to present event   z An image to illustrate the EventrG   i  i  ))r   SD)rT   HDvideosr   rL   rC   rD   r   c                       e Zd ZdZy)
Event.MetaEventsNr   r!   r   r   r   r      s    $r   r   c                     | j                   s$t        | t        | j                              | _         t	        |   |i | y r4   )r   r   r   r   superr%   )r'   argskwargsr   s      r   r%   z
Event.save   s2    yy&tWTYY-?@DId%f%r   c                 8    d| j                   | j                  fz  S r   )	eventTyper   r_   s    r   r`   zEvent.__str__   s    T^^TYY777r   )Kr5   r6   r7   r   ra   rb   rc   rd   
ForeignKeyr:   SET_NULLrefOrganiserr   refCategoryr   refEventPageTemplate
type_eventr   r   status_eventstatusrk   	isPrivaterf   eventContractticketContractpaymentContractticketTypeContractr   r   	SlugFieldr   rz   r{   	venueNamevenueAddressvenueGeolocri   r   now	eventDatecurrencyduration	TimeField	entryTimepreviewVideo	onlineUrlwebsiter   ru   ry   
webHookSet
FloatFieldroyaltysellTixRoyaltieValuer   r   isConferencestreamingIdstreamWithSelltixstreaming_qualitystreamingQualityrecordStreamingrecordedVideo	FileFieldrecordedFilerecordedStreamingUrlmailRappelSentendedr   r   r   r%   r`   __classcell__)r   s   @r   r   r      s2   			dDJJ	OB$6$$TFOO[lmL#&##HvDW[iy  Ei  jK,6,,->^bim  |Q  RJ
 $##JDQIL
 !V  q4  [P  QF###E  =G  HI%V%%$TJM&f&&#4dKN'v''3DtLO*&**ct$O&f&&#4dKO6s\BD6s2END"&""$K   C0I#6##s3L"&""c2K$$$/gqyq}q}~Iv H  v2e<H"v""-OPH   d6I#6##s4HL   CT  PH  IIf#4dMrsGV7YZE(V((6N$$$T2J%&%%e4J v  -G,6,,T:+++E:'F''2M&6&&u5L"&""ct$GK+++E: +v**3DaZ^_)f))%8O'F''6M#6##hDtLL+6++s4P(V((7NF.E$$$$7I$$$d3I% %&8r   r   update_eventc                   6   e Zd Z ej                  dej                  d      Z ej                  e	ej                  dd      Z ej                  d      Z ej                  d	      Z ej                   d
      Z ej                   d      Z G d d      Zy)EventPayeesTFr;   event_payeesr   rJ   r   r   rG   rD   r   c                       e Zd ZdZdZy)EventPayees.Meta)refEventrn   r  N)r5   r6   r7   unique_togetherr   r!   r   r   r   r     s    8)r   r   N)r5   r6   r7   r   ra   rb   rc   rd   r   r   r   r  rf   rn   r  shareAmountri   r   r   r   r!   r   r   r  r     s    			dDJJ	OB v  dXfgH%V%%5M#&##A.K$$$$7I$$$d3I* *r   r  c                      e Zd Z ej                  dej                  d      Z ej                  ddd      Z	 ej                  d      Z ej                  d      Z ej                  d	      Z ej                  d
d      Z ej                  d
d      Z ej                  d      Z ej                  ddd      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  d      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  d
d      Z ej                  ddd      Z ej                  ddd      Z ej@                  d      Z! ej@                  d      Z"d Z#y)TicketTypeTemplateTFr;   rJ   rK   r   r   rT   rG   rP   z#0dcaf0rS   z#FF0090r@   30z#fff2025P   1521rD   r   c                 8    d| j                   | j                  fz  S r   r   r_   s    r   r`   zTicketTypeTemplate.__str__  r   r   N)$r5   r6   r7   r   ra   rb   rc   rd   rf   r   URLFieldr   fontUrlr   
templateIdgradient1Colorgradient2ColoreventTitleOneeventTitleTWoeventTitleFont
eventColorcategoryFontcategoryColorticketTypeFontticketTypeColorprice
priceColor	priceFonttypeEventColortypeEventFontvenuesvgUrlri   r   r   r`   r!   r   r   r  r     s   			dDJJ	OBFDADFOOs+Efoo-G$$$Q/J&f&&"YGN&f&&"YGN$F$$3M$F$$4HM%V%%DAN!!!R?J#6##r$?L$F$$6BM%V%%DAN&f&&"VDOF+E!!!R?J   Bt<I%V%%FCN$F$$4@MF4@EV__DAF$$$$7I$$$d3I1r   r  c                   T   e Zd Z ej                  dej                  d      Z ej                  e	ej                  dd      Z ej                  eej                  dd      Z ej                  d      Z ej                   ddd      Z ej                   ddd      Z ej                  d	      Z ej                  d	      Z ej*                  d
      Z ej.                  ej2                        Z ej.                  ej2                        Z ej8                  dd      Z ej<                  d      Z ej.                  ddej2                        Z  ej<                  d      Z! ej*                  d
      Z" ej*                  d
      Z# ej<                  d      Z$ ej*                  d
      Z% ej.                  ddej2                        Z& ej                   ddd      Z' ej<                  d      Z( ej*                  d
      Z) ej<                  d      Z* ej<                  d      Z+ ej<                  d      Z, ej<                  d      Z-dZ. ej                  e.d
d      Z/ ej.                  d      Z0 ej.                  d      Z1 G d d      Z2d Z3y)
TicketTypeTFr;   r   rL   rC   rG   rJ   rK   rT   r   rN   )rL   rC   r=   r   )r   r   rQ   Deletedr   rD   r   c                       e Zd ZdZy)TicketType.MetaTicketsTypeNr   r!   r   r   r   rB  :  s    )r   r   c                 N    d| j                   | j                  | j                  fz  S )Nz%s - %d : %s)r  ticketTypeIdr   r_   s    r   r`   zTicketType.__str__=  s"    $--1B1B499!MMMr   N)4r5   r6   r7   r   ra   rb   rc   rd   r   r   r   r  r  refTicketTypeTemplater   rE  rf   r   r   
maxTicketsmaxTicketsPerUserr  ticketPriceri   r   r   bookingStartDatebookingEndDaterz   r{   rk   revealedrevealStartDatesellablemaxSellablePriceroyaltySellableearlyBiddiscountPricediscountEndDate	hiddenurihasRule	fixAmount	freeDrinkpriorityQueue	canStreamtransferablestatus_ticketTyper   r   r   r   r`   r!   r   r   r<  r<    s   			dDJJ	OB v  dQUVH-F--.@6??`dkop&6&&r2L&f&&#4dKOFDAD$$$Q/J,,,Q7#&##A.K+v++HLLA)V))(,,?N"&""48K"v""51H*f**4UO"v""51H)))!4(v((3O###E2H%F%%a0M*f**4UO!!!SdFI!f!!%0G!!!!,I###E2I'F''6M###E2I&6&&t4L
 !V  ):APTUF$$$$7I$$$d3I* *Nr   r<  c                   @   e Zd Z ej                  dej                  d      Z ej                  e	ej                  dd      Z ej                  ddd      Z ej                  d      Z ej                   d	      Z ej                   d
      Z G d d      Zd Zy)TicketHistoryTFr;   r=  rJ   rK   r   rG   rD   r   c                       e Zd ZdZy)TicketHistory.Metar]  Nr   r!   r   r   r   r_  I  s    +r   r   c                      d| j                   z  S )Nz%s)rd   r_   s    r   r`   zTicketHistory.__str__L  s      r   N)r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   refUserrf   walletr  	pricePaidri   r   r   r   r`   r!   r   r   r]  r]  B  s    			dDJJ	OBfvDtTGf#4dCF!!!!,I$$$$7I$$$d3I, ,!r   r]  c                      e Zd Z ej                  dej                  d      Z ej                  e	ej                  dd      Z ej                  eej                  dd      Z ej                  ddd      Z ej                          Z ej                  ddd      Z ej                  d      Z ej(                  d	      Z ej,                  ed
      Z ej2                  d	      ZdZ ej                   edd      Z ej2                  d	      Z ej<                  d      Z ej<                  d      Z  G d d      Z!d Z"y)TicketTFr;   r=  rJ   rK   r   r   rG   )rC   ))r   zTo be minted)rT   mintedr?  r   rD   r   c                       e Zd ZdZy)Ticket.MetaTicketsNr   r!   r   r   r   rh  d  s    %r   r   c                     | j                   r%d| j                   j                  | j                  fz  S d| j                  z  S )N%s - %dz%d)refTicketTyper  ticketIdr_   s    r   r`   zTicket.__str__g  s:    !3!3!<!<dmm LLL&&r   N)#r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   ra  r<  rl  rf   r   r   rm  	lastOwnerhashedTicketr  rc  ManyToManyFieldr]  ownersrk   hasBeenOfferedstatus_ticketr   scannedri   r   r   r   r`   r!   r   r   re  re  O  s@   			dDJJ	OBfvDtTG%F%%j6??PT[_`M&f&&#4dKO"v""$H!!!SdFI#6##s3L!!!!,I#V##M=F(V((7NM
 !V  DQF!f!!%0G$$$$7I$$$d3I& &'r   re  c                      e Zd Z ej                  dej                  d      Z ej                  e	ej                  ddd      Z ej                  eej                  dd      Z ej                  d      Z ej                   dd	      Z ej$                  d
ddd      Z ej(                         Z ej(                  d      Z ej(                  d      Z ej$                  ddd      Z ej2                  d      ZdZ ej                  edd      Z ej:                  d      Z ej:                  d      Zd Z y)PaymentTFr;   	paiementsr   r   rL   r=  rT   rG   rN   r   z'Stripe PaymentIntent or transactionHashr   r      rK   ))r   	InitiatedrT   Done)rQ   Refundedr   rD   r   c                 8    d| j                   | j                  fz  S )Nu   %s - %d €)ra  amountr_   s    r   __unicode__zPayment.__unicode__  s    dkk :::r   N)!r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   ra  r<  rl  r   	nbTicketsrz   
jsonStriperf   paymentIntentr  r  feesSelltixfeesStripeForSellTix
withWalletrk   web2status_paymentr   ri   r   r   r  r!   r   r   rv  rv  n  s>   			dDJJ	OBffooKZ^dhiG%F%%j6??PT[_`M###A.I!!!t$7J$F$$DS|}MV F#&##A.K,6,,Q7!!!RTEJ6t,DN
 !V  TRF$$$$7I$$$d3I;r   rv  c                   J   e Zd Z ej                  dej                  d      Z ej                  e	ej                  ddd      Z ej                  ed      Z ej                         Z ej                         Z ej$                  d	      Z ej$                  d	      Z ej$                  d	      Z ej,                  d	      Z ej0                  ddd
      Z ej4                  ddd      Z ej8                  d      Z ej8                  d      Zd Z G d d      Z y)InvoiceTFr;   user_invoicesrx  invoices)r   r   rG   r   rJ   rK   rD   r   c                 d    d| j                   | j                  | j                  | j                  fz  S )Nu   %s - %d %d : %d €)ra  monthyeartotalVATIncludedr_   s    r   r  zInvoice.__unicode__  s(    %djj4K`K`(aaar   c                       e Zd ZdZy)Invoice.Meta)ra  r  r  N)r5   r6   r7   r  r!   r   r   r   r    s    6r   r   N)!r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   ra  rp  rv  paymentsr   r  r  r  totalVATExcluded	vatAmountr  rk   paidr  pdfFilerf   stripeInvoiceIdri   r   r   r  r   r!   r   r   r  r    s   			dDJJ	OBffooO^bhlmG%v%%gJGHF!E6 D(v((3!!!!,I(v((36u-DfDIG&f&&#4dKO$$$$7I$$$d3Ib7 7r   r  c                   ,   e Zd Z ej                  dej                  d      Z ej                  e	ej                  ddd      Z ej                  eej                  dd      Z ej                  eej                  dd      Z ej                   d	      Z ej                   d
dd      ZdZ ej                   ddd      Z ej*                  edd      Z ej*                  d      Z ej0                  d      Z ej0                  d      Zd Zy)TicketToMintTFr;   
ticketuserrx  r=  r   r   rL   r   r   ry  rK   )r   To_dor{  )rQ   Failed)   MintingrJ   r   r   rG   rD   r   c                 8    | j                   d| j                  S Nz - )rl  
refPaymentr_   s    r   r  zTicketToMint.__unicode__  s    !//@@r   N)r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   ra  r<  rl  rv  r  rf   reservationIdr  status_mintr   r   r   	nbFailureri   r   r   r  r!   r   r   r  r    s   			dDJJ	OBffooL[_eijG%F%%j6??PT[_`M"""7V__tY]^J$F$$4M!!!RTEJK 'f&&#4dKO V  a$OF###A.I$$$$7I$$$d3IAr   r  c                       e Zd Z ej                  dej                  d      Z ej                  d      Z	 ej                  dd      Z ej                  d      Z ej                  d      Zd	 Zy
)WebHookTFr;   rJ   r   rN   rD   r   c                 8    | j                   d| j                  S r  )	webhookIdr   r_   s    r   r  zWebHook.__unicode__  s    !^^DNN;;r   N)r5   r6   r7   r   ra   rb   rc   rd   rf   r  rz   payloadri   r   r   r  r!   r   r   r  r    sk    			dDJJ	OB   C0IvT5G$$$$7I$$$d3I<r   r  c                      e Zd Z ej                  dej                  d      Z ej                  e	ej                  ddd      Z ej                  eej                  ddd      Z ej                  d      Z ej                  d	      Z ej"                  dd
      Z ej&                  d      Z ej*                  d      Z ej*                  d      Zd Zy)NotificationTFr;   
organizersrx  eventsr   r   rJ   rN   rG   rD   r   c                 N    d| j                   | j                  | j                  fz  S )Nz%s - %s : %d)refOrganizernotifIdsuccessr_   s    r   r  zNotification.__unicode__  s"    $"3"3DLL!NNNr   N)r5   r6   r7   r   ra   rb   rc   rd   r   r:   r   r  r   r  rf   r  typerz   messagerk   r  ri   r   r   r  r!   r   r   r  r    s    			dDJJ	OB$6$$T6??`djnoL v  hY]cghHf#.G6s+DfDt4G!f!!%0G$$$$7I$$$d3IOr   r  c                      e Zd Z ej                  dej                  d      ZdZ ej                  edd      Z
 ej                  d      Z ej                  dd	      Z ej                  d
      Z ej                  d      Zd Zy)TasksTFr;   )r  )rT   Doing)rQ   r|  )r  Errorr   r   rJ   r   rN   rD   r   c                 8    d| j                   | j                  fz  S )Nrk  )rd   r   r_   s    r   r  zTasks.__unicode__  s    TWWT[[111r   N)r5   r6   r7   r   ra   rb   rc   rd   status_batchr   r   rf   actionrz   metadatari   r   r   r  r!   r   r   r  r    s    			dDJJ	OBL !V  q4PFV-FvT5H$$$$7I$$$d3I2r   r  c                   *   e Zd Z ej                  dej                  d      Z ej                  ddd      Z	 ej                  d      Z ej                  ddd      Z ej                  eej                  d	dd
      Z ej                  dd      Z ej                  ddd      Z ej                  eej                  dd      Z ej                  eej                  dd      Z ej.                  d      Z ej.                  d      Zd Zy)
InvitationTFr;   r\   )rB   rC   rL   rG   rJ   rK   
userinviterx  r   r   rS   r=  r  rD   r   c                 8    | j                   d| j                  S r  )'refTicket__refTicketType__refEvent_namecoder_   s    r   r  zInvitation.__unicode__  s    !II$))TTr   N)r5   r6   r7   r   ra   rb   rc   rd   rf   r  rk   burnedwalletSellTixUsedForTransferr   r:   r   fromUsertoUser	emailSentre  	refTicketrv  r  ri   r   r   r  r!   r   r   r  r    s
   			dDJJ	OB6r$?D V  /F#36#3#3sSW#X  v  v\\`fjkHVR8F   CTEI!!!&6??SWXI"""7V__tY]^J$$$$7I$$$d3IUr   r  )/
__future__r   datetimer   	django.dbr   rb   sorl.thumbnailr   django.utils.textr   django.db.models.signalsr   backoffice.signalsdjango.utils.cryptor
   django.contrib.auth.base_userr   django.contrib.auth.modelsr   r   r   django.utilsr   r   r:   connectr   Modelr   r   r   r   r   signal_modifEventr  r  r<  r]  re  rv  r  r  r  r  r  r  r!   r   r   <module>r     s   '    % % .   1 9 H  !B/ B6<- <| 	  #2ET RV\\ 4 4
v|| 
	1 	1K8FLL K8Z 	  #. N	*&,, 	*1 1<)N )NZ!FLL !'V\\ '>;fll ;07fll 7&A6<< A,<fll <O6<< O2FLL 2$U Ur   