def save_year(): i = 1950 n = 2016 while i < n: i = i + 1 print(i) Years.create(year=i)
def about(): brands = Brands.select() brands = brands.order_by(Brands.brand) years = Years.select() years = years.order_by(Years.year.desc()) pop_brands = Pop_Brands.select() pop_brands = pop_brands.order_by(Pop_Brands.brand) return render_template('about.html', brands=brands, years=years, pop_brands=pop_brands)
def index(): brands = Brands.select() brands = brands.order_by(Brands.brand) years = Years.select() years = years.order_by(Years.year.desc()) pop_brands = Pop_Brands.select() pop_brands = pop_brands.order_by(Pop_Brands.brand) print(url_for('static', filename='css/styles.css')) return render_template('index2.html', brands=brands, years=years, pop_brands=pop_brands)
def different_services(service): brands = Brands.select() brands = brands.order_by(Brands.brand) years = Years.select() years = years.order_by(Years.year.desc()) pop_brands = Pop_Brands.select() pop_brands = pop_brands.order_by(Pop_Brands.brand) filename = os.path.join(DIRNAME, service + '.yaml') if not os.path.exists(filename): abort(404) with open(filename) as f: services = yaml.load(f) return render_template('services.html', services=services, brands=brands, years=years, pop_brands=pop_brands)
def different_models(name): brands = Brands.select() brands = brands.order_by(Brands.brand) try: model = Brands.select().where(Brands.brand == name).get() models = Models.select().where(Models.brand == model) except Brands.DoesNotExist: abort(404) years = Years.select() years = years.order_by(Years.year.desc()) pop_brands = Pop_Brands.select() pop_brands = pop_brands.order_by(Pop_Brands.brand) return render_template('brands.html', brands=brands, years=years, pop_brands=pop_brands, model=model, models=models)