initial
This commit is contained in:
commit
45e3c1f698
3462 files changed
+617437
No files matched your search
@@ -0,0 +1,16 @@
|
||||
from django.db import models
|
||||
from ckeditor.fields import RichTextField
|
||||
from django.utils.text import slugify
|
||||
|
||||
class customPage(models.Model):
|
||||
title = models.CharField(max_length=100)
|
||||
slug = models.SlugField(unique=True, blank=True, null=True)
|
||||
content = RichTextField()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
self.slug = slugify(self.title)
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
Reference in new issue
Block a user