override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let cell = tableView.dequeueReusableCell(withIdentifier: "fullList", for: indexPath) as! DetailListTableViewCell
tableView.allowsSelection = false
cell.selectionStyle = .none
if indexPath.row == 1 {
tableView.allowsSelection = true
cell.selectionStyle = .default
}
}
def handle_post_slug(sender, instance, *args, **kwargs):
from pytils import translit
slug = translit.slugify(instance.title)
if Post.objects.filter(slug=slug).exclude(id=instance.id):
slug = "-".join([slug, str(instance.id)])
instance.slug = slug
pre_save.connect(handle_post_slug, sender=Post)
def handle_post_slug(sender, instance, *args, **kwargs):
from pytils import translit
slug = translit.slugify(instance.title)
if Post.objects.filter(slug=slug).exclude(id=instance.id).extists():
slug = "-".join([slug, str(instance.id)])
instance.slug = slug
pre_save.connect(handle_post_slug, sender=Post)