forked from 00dani/lemoncurry
Some basic support for gross SEO metadata formats with django-meta
This commit is contained in:
parent
1aed52b75f
commit
8ef64d6a87
8 changed files with 40 additions and 5 deletions
|
@ -1,5 +1,6 @@
|
|||
from django.db import models
|
||||
from django.contrib.auth.models import AbstractUser
|
||||
from meta.models import ModelMeta
|
||||
|
||||
|
||||
def avatar_path(instance, name):
|
||||
|
@ -18,10 +19,20 @@ class Site(models.Model):
|
|||
ordering = ('name',)
|
||||
|
||||
|
||||
class User(AbstractUser):
|
||||
class User(ModelMeta, AbstractUser):
|
||||
avatar = models.ImageField(upload_to=avatar_path)
|
||||
note = models.TextField(blank=True)
|
||||
|
||||
@property
|
||||
def avatar_url(self):
|
||||
return self.avatar.url
|
||||
|
||||
_metadata = {
|
||||
'image': 'avatar_url',
|
||||
'description': 'note',
|
||||
'og_type': 'profile',
|
||||
}
|
||||
|
||||
|
||||
class Profile(models.Model):
|
||||
user = models.ForeignKey(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue