Maybe finally got this thing right
This commit is contained in:
parent
8cd49ce5e1
commit
6c8c9b69a7
|
@ -1,4 +1,5 @@
|
|||
from django.db import models
|
||||
from datetime import date
|
||||
|
||||
# Create your models here.
|
||||
|
||||
|
@ -16,5 +17,15 @@ class Contact(models.Model):
|
|||
url=models.CharField(max_length=500)
|
||||
proto=models.CharField(max_length=100)
|
||||
comment=models.CharField(max_length=100)
|
||||
group=models.CharField(max_length=100)
|
||||
group=models.IntegerField(choices={0:'Preferred',1:'Suitable',2:'Discouraged',3:'Ignored',4:'Discontinued',5:'NSFW'})
|
||||
priority=models.IntegerField()
|
||||
|
||||
def save(self,*args,**kwargs):
|
||||
a=Updates.objects.get(page='contact')
|
||||
a.date=date.today()
|
||||
a.save()
|
||||
super().save(*args,**kwargs)
|
||||
|
||||
class Updates(models.Model):
|
||||
page=models.CharField(max_length=100)
|
||||
date=models.DateField()
|
|
@ -4,7 +4,7 @@ from django.template import loader
|
|||
import random as ra
|
||||
import asyncio
|
||||
from . import mdl
|
||||
from .models import Page
|
||||
from .models import Page, Contact, Updates
|
||||
|
||||
import functools
|
||||
|
||||
|
@ -71,7 +71,7 @@ def contact():
|
|||
out2+='\n'.join([lii(*l) for l in v])
|
||||
out2+="\n</ul></p>"
|
||||
out3+=out2
|
||||
return {'title':'Contact','content':head+out3,'date':'2021/08/13'}
|
||||
return {'title':'Contact','content':head+out3,'date':Updates.objects.get(page='contact').date}
|
||||
|
||||
def specs(req):
|
||||
with open('main/pages/specs') as b:
|
||||
|
@ -124,6 +124,7 @@ NOTE:Anti-professionalism, pro-open standards
|
|||
CATEGORIES:programmer,biker
|
||||
SOURCE:https://rakka.tk/me.vcf
|
||||
END:VCARD""")
|
||||
|
||||
@rerender
|
||||
def autopage(page):
|
||||
p=Page.objects.get(url=page)
|
||||
|
|
Loading…
Reference in New Issue
Block a user