def __init__(self, **kwargs): super().__init__(**kwargs) original_image_url = kwargs.get('original_image_url') self.original_image_url = (self.set_default_event_image( kwargs.get('event_topic_id')) if original_image_url is None else original_image_url) # TODO(Areeb): Test for cleaning up of these on __init__ self.description = clean_up_string(kwargs.get('description')) self.owner_description = clean_up_string( kwargs.get('owner_description')) self.code_of_conduct = clean_up_string(kwargs.get('code_of_conduct'))
def __setattr__(self, name, value): if (name == 'short_biography' or name == 'long_biography' or name == 'speaking_experience' or name == 'sponsorship_required'): super().__setattr__(name, clean_html(clean_up_string(value))) else: super().__setattr__(name, value)
def __setattr__(self, name, value): if (name == 'owner_description' or name == 'description' or name == 'code_of_conduct'): super(Event, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(Event, self).__setattr__(name, value)
def __setattr__(self, name, value): allow_link = name == 'description' or 'owner_description' or 'after_order_message' if (name == 'owner_description' or name == 'description' or name == 'code_of_conduct' or name == 'after_order_message'): super().__setattr__( name, clean_html(clean_up_string(value), allow_link=allow_link)) else: super().__setattr__(name, value)
def __init__( self, name=None, logo_url=None, starts_at=None, ends_at=None, timezone='UTC', is_event_online=False, latitude=None, longitude=None, location_name=None, description=None, external_event_url=None, original_image_url=None, thumbnail_image_url=None, large_image_url=None, icon_image_url=None, owner_name=None, owner_description=None, state=None, event_type_id=None, privacy=None, event_topic_id=None, event_sub_topic_id=None, events_orga_id=None, ticket_url=None, copyright=None, code_of_conduct=None, schedule_published_on=None, is_sessions_speakers_enabled=False, show_remaining_tickets=False, is_ticket_form_enabled=True, is_donation_enabled=False, is_map_shown=False, has_owner_info=False, searchable_location_name=None, is_ticketing_enabled=None, deleted_at=None, payment_country=None, payment_currency=None, paypal_email=None, speakers_call=None, can_pay_by_paypal=None, can_pay_by_stripe=None, can_pay_by_cheque=None, can_pay_by_omise=None, can_pay_by_alipay=None, identifier=None, can_pay_by_bank=None, is_featured=False, can_pay_onsite=None, cheque_details=None, bank_details=None, pentabarf_url=None, ical_url=None, xcal_url=None, discount_code_id=None, onsite_details=None, is_tax_enabled=None, is_billing_info_mandatory=False, is_sponsors_enabled=None, stripe_authorization=None, tax=None, refund_policy='All sales are final. No refunds shall be issued in any case.', is_stripe_linked=False): self.name = name self.logo_url = logo_url self.starts_at = starts_at self.ends_at = ends_at self.timezone = timezone self.is_event_online = is_event_online self.latitude = latitude self.longitude = longitude self.location_name = location_name self.description = clean_up_string(description) self.external_event_url = external_event_url self.original_image_url = original_image_url self.original_image_url = self.set_default_event_image(event_topic_id) if original_image_url is None \ else original_image_url self.thumbnail_image_url = thumbnail_image_url self.large_image_url = large_image_url self.icon_image_url = icon_image_url self.owner_name = owner_name self.owner_description = clean_up_string(owner_description) self.state = state self.is_map_shown = is_map_shown self.has_owner_info = has_owner_info self.privacy = privacy self.event_type_id = event_type_id self.event_topic_id = event_topic_id self.show_remaining_tickets = show_remaining_tickets self.copyright = copyright self.event_sub_topic_id = event_sub_topic_id self.events_orga_id = events_orga_id self.ticket_url = ticket_url self.code_of_conduct = code_of_conduct self.schedule_published_on = schedule_published_on self.is_sessions_speakers_enabled = is_sessions_speakers_enabled self.searchable_location_name = searchable_location_name self.is_ticketing_enabled = is_ticketing_enabled self.deleted_at = deleted_at self.payment_country = payment_country self.payment_currency = payment_currency self.paypal_email = paypal_email self.speakers_call = speakers_call self.can_pay_by_paypal = can_pay_by_paypal self.can_pay_by_stripe = can_pay_by_stripe self.can_pay_by_cheque = can_pay_by_cheque self.can_pay_by_bank = can_pay_by_bank self.can_pay_onsite = can_pay_onsite self.can_pay_by_omise = can_pay_by_omise self.can_pay_by_alipay = can_pay_by_alipay self.is_donation_enabled = is_donation_enabled self.is_featured = is_featured self.is_ticket_form_enabled = is_ticket_form_enabled self.identifier = get_new_event_identifier() self.cheque_details = cheque_details self.bank_details = bank_details self.pentabarf_url = pentabarf_url self.ical_url = ical_url self.xcal_url = xcal_url self.onsite_details = onsite_details self.discount_code_id = discount_code_id self.created_at = datetime.now(pytz.utc) self.is_tax_enabled = is_tax_enabled self.is_billing_info_mandatory = is_billing_info_mandatory self.is_sponsors_enabled = is_sponsors_enabled self.stripe_authorization = stripe_authorization self.tax = tax self.refund_policy = refund_policy self.is_stripe_linked = is_stripe_linked
def __setattr__(self, name, value): if name == 'description': super(Sponsor, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(Sponsor, self).__setattr__(name, value)
def __setattr__(self, name, value): if name == 'details': super().__setattr__(name, clean_html(clean_up_string(value))) else: super().__setattr__(name, value)
def __setattr__(self, name, value): if name == 'short_abstract' or name == 'long_abstract' or name == 'comments': super().__setattr__(name, clean_html(clean_up_string(value), allow_link=True)) else: super().__setattr__(name, value)
def __setattr__(self, name, value): if name == 'details': super(User, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(User, self).__setattr__(name, value)
def __setattr__(self, name, value): if name == 'short_abstract' or name == 'long_abstract' or name == 'comments': super(Session, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(Session, self).__setattr__(name, value)
def __setattr__(self, name, value): if name == 'organizer_description' or name == 'description' or name == 'code_of_conduct': super(Event, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(Event, self).__setattr__(name, value)
def __init__(self, name=None, logo_url=None, starts_at=None, ends_at=None, timezone='UTC', is_event_online=False, latitude=None, longitude=None, location_name=None, description=None, external_event_url=None, original_image_url=None, thumbnail_image_url=None, large_image_url=None, icon_image_url=None, organizer_name=None, organizer_description=None, state=None, event_type_id=None, privacy=None, event_topic_id=None, event_sub_topic_id=None, ticket_url=None, copyright=None, code_of_conduct=None, schedule_published_on=None, is_sessions_speakers_enabled=False, is_donation_enabled=False, is_map_shown=False, has_organizer_info=False, searchable_location_name=None, is_ticketing_enabled=None, deleted_at=None, payment_country=None, payment_currency=None, paypal_email=None, speakers_call=None, can_pay_by_paypal=None, can_pay_by_stripe=None, can_pay_by_cheque=None, identifier=None, can_pay_by_bank=None, can_pay_onsite=None, cheque_details=None, bank_details=None, pentabarf_url=None, ical_url=None, xcal_url=None, discount_code_id=None, onsite_details=None, is_tax_enabled=None, is_sponsors_enabled=None, stripe_authorization=None, tax=None, order_expiry_time=None, refund_policy='All sales are final. No refunds shall be issued in any case.', is_stripe_linked=False): self.name = name self.logo_url = logo_url self.starts_at = starts_at self.ends_at = ends_at self.timezone = timezone self.is_event_online = is_event_online self.latitude = latitude self.longitude = longitude self.location_name = location_name self.description = clean_up_string(description) self.external_event_url = external_event_url self.original_image_url = original_image_url self.original_image_url = self.set_default_event_image(event_topic_id) if original_image_url is None \ else original_image_url self.thumbnail_image_url = thumbnail_image_url self.large_image_url = large_image_url self.icon_image_url = icon_image_url self.organizer_name = organizer_name self.organizer_description = clean_up_string(organizer_description) self.state = state self.is_map_shown = is_map_shown self.has_organizer_info = has_organizer_info self.privacy = privacy self.event_type_id = event_type_id self.event_topic_id = event_topic_id self.copyright = copyright self.event_sub_topic_id = event_sub_topic_id self.ticket_url = ticket_url self.code_of_conduct = code_of_conduct self.schedule_published_on = schedule_published_on self.is_sessions_speakers_enabled = is_sessions_speakers_enabled self.searchable_location_name = searchable_location_name self.is_ticketing_enabled = is_ticketing_enabled self.deleted_at = deleted_at self.payment_country = payment_country self.payment_currency = payment_currency self.paypal_email = paypal_email self.speakers_call = speakers_call self.can_pay_by_paypal = can_pay_by_paypal self.can_pay_by_stripe = can_pay_by_stripe self.can_pay_by_cheque = can_pay_by_cheque self.can_pay_by_bank = can_pay_by_bank self.can_pay_onsite = can_pay_onsite self.is_donation_enabled = is_donation_enabled self.identifier = get_new_event_identifier() self.cheque_details = cheque_details self.bank_details = bank_details self.pentabarf_url = pentabarf_url self.ical_url = ical_url self.xcal_url = xcal_url self.onsite_details = onsite_details self.discount_code_id = discount_code_id self.created_at = datetime.now(pytz.utc) self.is_tax_enabled = is_tax_enabled self.is_sponsors_enabled = is_sponsors_enabled self.stripe_authorization = stripe_authorization self.tax = tax self.order_expiry_time = order_expiry_time self.refund_policy = refund_policy self.is_stripe_linked = is_stripe_linked
def __setattr__(self, name, value): if name == 'short_biography' or name == 'long_biography' or name == 'speaking_experience' or name == 'sponsorship_required': super(Speaker, self).__setattr__(name, clean_html(clean_up_string(value))) else: super(Speaker, self).__setattr__(name, value)