Skip to content

Instantly share code, notes, and snippets.

@cloudjumper2000
Last active July 28, 2018 11:39
Show Gist options
  • Save cloudjumper2000/7e7f71fce4c23a7c26694429b8b52fe6 to your computer and use it in GitHub Desktop.
Save cloudjumper2000/7e7f71fce4c23a7c26694429b8b52fe6 to your computer and use it in GitHub Desktop.
Sec6,vid93: Error: unresolved attribute reference 'title' for class 'Meta; line 20
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models
from django.urls import reverse
# Create your models here.
class Post(models.Model):
title = models.CharField(max_length=255)
slug = models.SlugField(max_length=255, unique=True)
summary = models.CharField(max_length=300)
content = models.TextField()
published = models.BooleanField(default=True)
created = models.DateField(auto_now_add=True)
class Meta:
ordering = ['-created']
def __unicode__(self):
return u'%s' % self.title
def get_absolute_url(self):
return reverse('blog.views.post', args=[self.slug])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment