Commit ec33d53e authored by cynddl's avatar cynddl

Minimal support for Article objects

parent 95060813
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-22 14:14
from __future__ import unicode_literals
from django.db import migrations, models
import taggit.managers
class Migration(migrations.Migration):
initial = True
dependencies = [
('taggit', '0002_auto_20150616_2121'),
]
operations = [
migrations.CreateModel(
name='Article',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('url', models.URLField(verbose_name='URL')),
('lang', models.CharField(max_length=50, verbose_name='Language')),
('metadata', models.TextField(verbose_name='Opengraph metadata')),
('screenshot', models.ImageField(upload_to='', verbose_name='Article screenshot')),
('title', models.CharField(max_length=255, verbose_name='Article title')),
('extracts', models.TextField(verbose_name='Content extracts')),
('published_at', models.DateTimeField(verbose_name='Publication date')),
('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Creation date')),
('updated_at', models.DateTimeField(auto_now=True, verbose_name='Last update')),
('published', models.BooleanField(verbose_name='Published')),
('tags', taggit.managers.TaggableManager(help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')),
],
),
]
from django.db import models
from django.utils.translation import ugettext_lazy as _
from taggit.managers import TaggableManager
# Create your models here.
class Article(models.Model):
url = models.URLField("URL")
lang = models.CharField(_("Language"), max_length=50)
metadata = models.TextField(_("Opengraph metadata"))
screenshot = models.ImageField(_("Article screenshot"))
title = models.CharField(_("Article title"), max_length=255)
extracts = models.TextField(_("Content extracts"))
published_at = models.DateTimeField(_("Publication date"))
created_at = models.DateTimeField(_("Creation date"), auto_now_add=True)
updated_at = models.DateTimeField(_("Last update"), auto_now=True)
published = models.BooleanField(_("Published"))
tags = TaggableManager()
......@@ -18,6 +18,7 @@ CONTRIB_APPS = [
"rest_framework", # http://www.django-rest-framework.org/
# https://github.com/philipn/django-rest-framework-filters
# "rest_framework_filters",
"taggit",
]
if DEBUG:
......@@ -28,7 +29,8 @@ if DEBUG:
PROJECT_APPS = [
"userprofile",
"core"
"core",
"rp"
]
INSTALLED_APPS = DJANGO_APPS + CONTRIB_APPS + PROJECT_APPS
......@@ -3,3 +3,4 @@ djangorestframework==3.6.2
django-extensions==1.7.8
Pillow==4.1.0
django-imagekit==4.0
django-taggit==0.22.0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment