in
PYL-R1714103 count = 0
104 for order_ticket in order_tickets:
105 order = Order.query.filter_by(id=order_ticket.order_id).first()
106 if order.status == "completed" or order.status == "placed":107 count += 1
108
109 return bool(count > 0)
61
62 def __setattr__(self, name, value):
63 if (
64 name == 'short_biography'65 or name == 'long_biography'
66 or name == 'speaking_experience'
67 or name == 'sponsorship_required'
135 return '<Session %r>' % self.title
136
137 def __setattr__(self, name, value):
138 if name == 'short_abstract' or name == 'long_abstract' or name == 'comments':139 super().__setattr__(name, clean_html(clean_up_string(value), allow_link=True))
140 else:
141 super().__setattr__(name, value)
285 def __setattr__(self, name, value):
286 allow_link = name == 'description' or 'owner_description' or 'after_order_message'
287 if (
288 name == 'owner_description'289 or name == 'description'
290 or name == 'code_of_conduct'
291 or name == 'after_order_message'
250 :param view_kwargs:
251 :return:
252 """
253 if ticket.type == 'paid' or ticket.type == 'donation':254 try:
255 event = (
256 db.session.query(Event)
To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained in
it instead of checking for equality against each of the values.
This is faster, less verbose, and more readable.
if x == 1 or x == 2 or x == 3:
do_something()
if x in (1, 2, 3):
do_something()