Esempio n. 1
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()])
Esempio n. 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()
Esempio n. 3
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()
     self.category.query = (
         Category.query.join(ItemCollection)
         .filter(Category.item_collection == self.edit_parent)
         .options(db.load_only('id', 'title'))
     )
Esempio n. 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()
        ],
    )
Esempio n. 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()])
Esempio n. 6
0
def locale_testview():
    country_list = localized_country_list()
    return dict(country_list)['DE']
Esempio n. 7
0
 def set_queries(self):
     self.place_supply_country_code.choices = [('', '')] + localized_country_list()
Esempio n. 8
0
 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'))