Skip to content

Instantly share code, notes, and snippets.

Suor /
Last active Feb 27, 2018 — forked from krakiun/
def api_service_vote(product_id, direction):
''' thi api need for vote up/down the services'''
product = Product.query.get_or_404(product_id)
query = Product_Vote.query.filter(Product_Vote.voter_id ==,
Product_Vote.product_id ==
Suor /
Last active Aug 29, 2015 — forked from ir4y/
# Предполагая m2m такого вида
class Tag(model.Model):
text = model.CharField()
class News(models.Model):
tags = models.ManyToManyField(Tag)
def index(request):
# Текущий мастер умеет инвалидировать по событиям на связанных моделях,