diff options
author | luxagraf <sng@luxagraf.net> | 2023-07-19 15:50:29 -0500 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2023-07-19 15:50:29 -0500 |
commit | a22d349573d60564e582b9a314c9463385d03dac (patch) | |
tree | a8bb9d9d6e3edbb75e454539cd7cd7caab7e0744 /app/posts/models.py | |
parent | 46ecd030e8d2b68f155c6f8d2d4ad653500391c6 (diff) |
posts: made create and update forms for notes
Diffstat (limited to 'app/posts/models.py')
-rw-r--r-- | app/posts/models.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/posts/models.py b/app/posts/models.py index 91420e1..8781bc1 100644 --- a/app/posts/models.py +++ b/app/posts/models.py @@ -1,4 +1,5 @@ from django.db import models +from django.urls import reverse from django.utils.html import format_html, format_html_join from django.utils import timezone import settings @@ -93,7 +94,7 @@ class Post(models.Model): class Note(models.Model): title = models.CharField(max_length=400) - url = models.CharField(max_length=400) + url = models.CharField(max_length=400, blank=True, null=True) body_markdown = models.TextField(blank=True, null=True) date_created = models.DateTimeField(default=timezone.now) post = models.ForeignKey(Post, on_delete=models.CASCADE, null=True) @@ -104,6 +105,8 @@ class Note(models.Model): def __str__(self): return self.title + def get_absolute_url(self): + return reverse('notes:edit', kwargs={"pk": self.pk}) #URL,This Article,Type,Lead,Previous Leads,Other Testers,Notes/Docs,Last Pub Date,Update Next,Months Since Update,Update Frequency (Months),Updates per year,Prev. Updates,"18 Mo Traffic Trend ''' |