Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
from django.db import models
from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from tagging.fields import TagField
from tagging.models import Tag
class KategoriManager(models.Manager):
def live(self):
return self.model.objects.filter(kategori_kullanim=True)
class Kategori(models.Model):
baslik = models.CharField(max_length=255, verbose_name="baslik", help_text="Baslik")
slug = models.SlugField(max_length=255, verbose_name="slug")
aciklama = models.CharField(max_length=400, verbose_name="aciklama", help_text="Aciklama")
kategori_title = models.CharField(max_length=400, verbose_name="sef_aciklama", help_text="Fare ile uzerine gelindiginde cikacak yazi")
kategori_kullanim = models.BooleanField(default=True, verbose_name="kullanimda", help_text="Kategori aktif mi?")
objects = KategoriManager()
def __unicode__(self):
return self.baslik
class Meta:
verbose_name_plural = 'Kategori'
@models.permalink
def get_absolute_url(self):
return ('kategori:detail',(),{'slug':self.slug})
class YaziManager(models.Manager):
def live(self):
return self.model.objects.filter(yayinlanmis=True)
class Yazi(models.Model):
yayinlanma_tarihi = models.DateTimeField(auto_now_add=True, editable=False)
guncelleme_tarihi = models.DateTimeField(auto_now=True, editable=False)
baslik = models.CharField(max_length=255)
slug = models.SlugField(max_length=255, blank=True, default='')
icerik = models.TextField(verbose_name="icerik")
home_sabit = models.BooleanField(verbose_name="anasayfa",name="Anasayfa",help_text="Yazı anasayfada gözüksün mü?")
kategori = models.ForeignKey(Kategori)
etiketler = TagField(verbose_name="etiketler")
yayinlanmis = models.BooleanField(default=True,verbose_name="yayinlanmis",help_text="Yazı simdi yayinlansin mi?")
yazar = models.ForeignKey(User)
objects = YaziManager()
def yayinlanmis_admin(self):
return self.yayinlanmis
yayinlanmis_admin.order_field = 'yayinlanmis'
yayinlanmis_admin.short_description = 'Yayınlanmış'
yayinlanmis_admin.boolean = True
class Meta:
ordering = ['-yayinlanma_tarihi','baslik']
verbose_name = 'Makale'
verbose_name_plural = 'makale'
def __unicode__(self):
return self.baslik
def yayinlanmis_admin(self):
if self.yayinlanmis:
return True
else:
return False
def baslik_admin(self):
return self.baslik
def yayinlanma_admin(self):
return self.yayinlanma_tarihi
# Admin paneli için tasarım özelleştirmeleri
yayinlanmis_admin.admin_order_field = 'yayinlanmis'
yayinlanmis_admin.short_description = 'Yayınlanmış'
yayinlanmis_admin.boolean = True
baslik_admin.admin_order_field = 'baslik'
baslik_admin.short_description = 'Yazı Başlığı'
yayinlanma_admin.admin_order_field = 'yayinlanma_tarihi'
yayinlanma_admin.short_description = 'Yayınlanma Tarihi'
def save(self, *args, **kwargs):
if not self.slug:
self.slug = slugify(self.baslik)
super(Yazi, self).save(*args, **kwargs)
@models.permalink
def get_absolute_url(self):
return ('yazi:detail',(),{'slug':self.slug})
class YorumManager(models.Manager):
def live(self):
return self.model.objects.filter(onayli=True)
class Yorum(models.Model):
tarih = models.DateTimeField(auto_now_add=True, verbose_name="tarih")
yazar = models.CharField(max_length=255, verbose_name="yazar")
posta = models.EmailField(max_length=255, verbose_name="eposta")
icerik = models.TextField(verbose_name="yorum")
website = models.URLField(max_length=400,verbose_name="website",null=True)
yazi = models.ForeignKey(Yazi)
onayli = models.BooleanField(default=False, verbose_name="onay")
objects = YorumManager()
class Meta:
ordering = ['-tarih','yazar']
verbose_name = 'Yorum'
verbose_name_plural = 'yorum'
def __unicode__(self):
return self.icerik
def save(self, *args, **kwargs):
if not self.yazar:
self.yazar = "Anonim"
super(Yorum, self).save(*args,**kwargs)
def onayli_admin(self):
if self.onayli:
return True
else:
return False
onayli_admin.admin_order_field = 'yayinlanmis'
onayli_admin.short_description = 'Yayınlanmış'
onayli_admin.boolean = True
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team