# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.conf import settings
from django.db import models
# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later.
# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information.
#
from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
from django.db.models.signals import post_save, post_delete
from django.utils.translation import ugettext_lazy as _
from datetime import datetime
from django.db.models.signals import post_save, post_delete
class Author(models.Model):
name = models.CharField(_('name'), max_length=50, db_index=True)
slug = models.SlugField(_('slug'), max_length=120, db_index=True, unique=True)
sort_key = models.CharField(_('sort key'), max_length=120, db_index=True)
description = models.TextField(_('description'), blank=True)
class Author(models.Model):
name = models.CharField(_('name'), max_length=50, db_index=True)
slug = models.SlugField(_('slug'), max_length=120, db_index=True, unique=True)
sort_key = models.CharField(_('sort key'), max_length=120, db_index=True)
description = models.TextField(_('description'), blank=True)
gazeta_link = models.CharField(blank=True, max_length=240)
wiki_link = models.CharField(blank=True, max_length=240)
gazeta_link = models.CharField(blank=True, max_length=240)
wiki_link = models.CharField(blank=True, max_length=240)
def update_index(sender, instance, **kwargs):
from search.index import Index
idx = Index()
def update_index(sender, instance, **kwargs):
from search.index import Index
idx = Index()
post_delete.connect(update_index, Author)
post_delete.connect(update_index, BookStub)
post_delete.connect(update_index, Author)
post_delete.connect(update_index, BookStub)