예제 #1
0
파일: order.py 프로젝트: hasgeek/boxoffice
def jsonify_invoices(data_dict):
    invoices_list = []
    for invoice in data_dict['invoices']:
        invoices_list.append(jsonify_invoice(invoice))
    return jsonify(invoices=invoices_list, access_token=data_dict['order'].access_token,
        states=[{'name': state['name'], 'code': state['short_code_text']} for state in sorted(indian_states, key=lambda k: k['name'])],
        countries=[{'name': name, 'code': code} for code, name in localized_country_list()])
예제 #2
0
 def set_queries(self):
     self.place_supply_state_code.choices = [(0, '')] + [
         (state['short_code'], state['name'])
         for state in sorted(indian_states, key=lambda k: k['name'])
     ]
     self.place_supply_country_code.choices = [('', '')
                                               ] + localized_country_list()
예제 #3
0
파일: item.py 프로젝트: hasgeek/boxoffice
 def set_queries(self):
     self.place_supply_state_code.choices = [(0, '')] + [
         (state['short_code'], state['name'])
         for state in sorted(indian_states, key=lambda k: k['name'])
     ]
     self.place_supply_country_code.choices = [('', '')] + localized_country_list()
     self.category.query = (
         Category.query.join(ItemCollection)
         .filter(Category.item_collection == self.edit_parent)
         .options(db.load_only('id', 'title'))
     )
예제 #4
0
def render_boxoffice_js():
    return render_template(
        'boxoffice.js.jinja2',
        base_url=request.url_root.rstrip('/'),
        razorpay_key_id=app.config['RAZORPAY_KEY_ID'],
        states=[
            {'name': state['name'], 'code': state['short_code_text']}
            for state in sorted(indian_states, key=lambda k: k['name'])
        ],
        countries=[
            {'name': name, 'code': code} for code, name in localized_country_list()
        ],
    )
예제 #5
0
def jsonify_invoices(data_dict):
    invoices_list = []
    for invoice in data_dict['invoices']:
        invoices_list.append(jsonify_invoice(invoice))
    return jsonify(
        invoices=invoices_list,
        access_token=data_dict['order'].access_token,
        states=[{
            'name': state['name'],
            'code': state['short_code_text']
        } for state in sorted(indian_states, key=lambda k: k['name'])],
        countries=[{
            'name': name,
            'code': code
        } for code, name in localized_country_list()])
예제 #6
0
def locale_testview():
    country_list = localized_country_list()
    return dict(country_list)['DE']
예제 #7
0
 def set_queries(self):
     self.place_supply_country_code.choices = [('', '')] + localized_country_list()
예제 #8
0
파일: item.py 프로젝트: hasgeek/boxoffice
 def set_queries(self):
     self.place_supply_country_code.choices = [('', '')] + localized_country_list()
     self.category.query = Category.query.join(ItemCollection).filter(
         Category.item_collection == self.edit_parent).options(db.load_only('id', 'title'))