-
-
Save aleksey-rezvov/6fa1d762508d405142e6ce771b195c17 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
class Product(models.Model): | |
categories = models.ManyToManyField(Category, | |
related_name='products', | |
blank=True, verbose_name=u"категории") | |
related_products = models.ManyToManyField('Product', | |
blank=True, | |
verbose_name="связанные продукты") | |
sku = models.CharField(u'артикул', max_length=128, validators=[validators.check_bad_symbols], unique=True) | |
price = models.DecimalField(u'цена', max_digits=12, decimal_places=4) | |
slug = models.SlugField(u'slug', max_length=80, db_index=True, unique=True) | |
name = models.CharField(u'название', max_length=128) | |
title = models.CharField(u'заголовок страницы (<title>)', max_length=256, blank=True) | |
description = models.TextField(u'описание', blank=True) | |
def live_search(request): | |
q = request.GET.get("q", "") | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment