mirror of
https://github.com/Rushilwiz/NewViewsNews.git
synced 2025-04-20 19:40:16 -04:00
started tinymce and added score fields
This commit is contained in:
parent
ed92fee6a9
commit
4f2f8b3df2
|
@ -85,6 +85,7 @@ INSTALLED_APPS = [
|
||||||
'django.contrib.sessions',
|
'django.contrib.sessions',
|
||||||
'django.contrib.messages',
|
'django.contrib.messages',
|
||||||
'django.contrib.staticfiles',
|
'django.contrib.staticfiles',
|
||||||
|
'tinymce',
|
||||||
'social_django',
|
'social_django',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,9 @@ urlpatterns = [
|
||||||
|
|
||||||
path('oauth/', include('social_django.urls', namespace='social')),
|
path('oauth/', include('social_django.urls', namespace='social')),
|
||||||
|
|
||||||
|
|
||||||
|
path('tinymce/', include('tinymce.urls')),
|
||||||
|
|
||||||
path('', include('news.urls')),
|
path('', include('news.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
19
news/migrations/0007_auto_20200815_2100.py
Normal file
19
news/migrations/0007_auto_20200815_2100.py
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Generated by Django 3.1 on 2020-08-16 01:00
|
||||||
|
|
||||||
|
from django.db import migrations
|
||||||
|
import tinymce.models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('news', '0006_article_tag'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='article',
|
||||||
|
name='content',
|
||||||
|
field=tinymce.models.HTMLField(),
|
||||||
|
),
|
||||||
|
]
|
|
@ -6,6 +6,8 @@ from django.urls import reverse
|
||||||
|
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
|
||||||
|
from tinymce.models import HTMLField
|
||||||
|
|
||||||
# Create your models here.
|
# Create your models here.
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ class Article(models.Model):
|
||||||
]
|
]
|
||||||
|
|
||||||
headline = models.CharField(max_length=100)
|
headline = models.CharField(max_length=100)
|
||||||
content = models.TextField()
|
content = HTMLField()
|
||||||
date_published = models.DateTimeField(auto_now_add=True)
|
date_published = models.DateTimeField(auto_now_add=True)
|
||||||
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
author = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||||
likes = models.IntegerField(default=0)
|
likes = models.IntegerField(default=0)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
django==3.1
|
django==3.1
|
||||||
django-crispy-forms==1.9.2
|
django-crispy-forms==1.9.2
|
||||||
|
django-tinymce==3.0.2
|
||||||
pillow==7.2.0
|
pillow==7.2.0
|
||||||
pip-chill==1.0.0
|
pip-chill==1.0.0
|
||||||
social-auth-app-django==4.0.0
|
social-auth-app-django==4.0.0
|
||||||
|
|
30
users/migrations/0009_auto_20200815_2308.py
Normal file
30
users/migrations/0009_auto_20200815_2308.py
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Generated by Django 3.1 on 2020-08-16 03:08
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('users', '0008_remove_profile_tag'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='profile',
|
||||||
|
name='economicScore',
|
||||||
|
field=models.IntegerField(blank=True, default=-5),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='profile',
|
||||||
|
name='gaveValues',
|
||||||
|
field=models.BooleanField(default=False),
|
||||||
|
),
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='profile',
|
||||||
|
name='socialScore',
|
||||||
|
field=models.IntegerField(blank=True, default=-5),
|
||||||
|
preserve_default=False,
|
||||||
|
),
|
||||||
|
]
|
|
@ -9,6 +9,10 @@ class Profile(models.Model):
|
||||||
|
|
||||||
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
user = models.OneToOneField(User, on_delete=models.CASCADE)
|
||||||
profile_pic = models.ImageField(default='default-pfp.jpg', upload_to='profile_pics')
|
profile_pic = models.ImageField(default='default-pfp.jpg', upload_to='profile_pics')
|
||||||
|
gaveValues = models.BooleanField(default=False)
|
||||||
|
economicScore = models.IntegerField(default=True,blank=True)
|
||||||
|
socialScore = models.IntegerField(default=True,blank=True)
|
||||||
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return f'{self.user.username} Profile'
|
return f'{self.user.username} Profile'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user