def reference_data(): etag_cache_keygen('static') return jsonify({ 'currencies': sorted(dicts(CURRENCIES), key=lambda d: d['label']), 'languages': sorted(dicts(LANGUAGES), key=lambda d: d['label']), 'territories': sorted(dicts(COUNTRIES), key=lambda d: d['label']), 'categories': sorted(dicts(CATEGORIES), key=lambda d: d['label']) })
def authz(): obj = Dataset.by_name(request.args.get('dataset')) etag_cache_keygen(obj, private=True) if obj is None: return jsonify({ 'read': False, 'update': False }) return jsonify({ 'read': dataset.read(obj), 'update': dataset.update(obj) })
def index(*a, **kw): from flask.ext.babel import get_locale from spendb.views.context import etag_cache_keygen etag_cache_keygen(RESERVED_TERMS) locale = get_locale() data = { 'current_language': locale.language, 'url_for': url_for, 'debug': current_app.config['DEBUG'], 'asset_link': asset_link, 'reserved_terms': RESERVED_TERMS, 'site_url': url_for('home.index').rstrip('/'), 'site_title': current_app.config.get('SITE_TITLE') } return render_template('layout.html', **data)
def index(*a, **kw): from flask.ext.babel import get_locale from spendb.views.context import etag_cache_keygen etag_cache_keygen(RESERVED_TERMS) locale = get_locale() data = { 'current_language': locale.language, 'url_for': url_for, 'reserved_terms': RESERVED_TERMS, 'templates': angular_templates(current_app), 'site_url': url_for('home.index').rstrip('/'), 'number_symbols_group': locale.number_symbols.get('group'), 'number_symbols_decimal': locale.number_symbols.get('decimal'), 'site_title': current_app.config.get('SITE_TITLE') } return render_template('layout.html', **data)
def authz(): obj = Dataset.by_name(request.args.get('dataset')) etag_cache_keygen(obj, private=True) if obj is None: return jsonify({'read': False, 'update': False}) return jsonify({'read': dataset.read(obj), 'update': dataset.update(obj)})
def view(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify(dataset)
def managers(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify({'managers': dataset.managers})
def model(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify(dataset.model_data)
def structure(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify({'fields': dataset.fields})
def structure(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify({ 'fields': dataset.fields })
def model(name): dataset = get_dataset(name) etag_cache_keygen(dataset, private=dataset.private) return jsonify(dataset.model or {})