-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: store each uploaded MyClippings.txt (#38)
* add: gitginore db folder and .vscode settings * feat: add MyClippings file model * feat: add saving MyClippings to db * feat: add language header field to MyClippings model * feat: add manager for MyClippings model * refactor: rename MyClippingsFiles model, file & DateTime field * feat: trim long language headers in MyClippingsFileManager * fix: imports old names * refactor: squash MyClippingsFile migration file * fix: wrong language_header len limit
- Loading branch information
Showing
6 changed files
with
85 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
# Generated by Django 1.11.23 on 2021-07-27 07:43 | ||
from __future__ import unicode_literals | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('clipping_manager', '0012_data_generate_clipping_hashs'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='MyClippingsFile', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('content', models.TextField(verbose_name='Content')), | ||
('uploaded_at', models.DateTimeField(auto_now_add=True, verbose_name='Upload datetime')), | ||
('language_header', models.CharField(blank=True, max_length=255, null=True, verbose_name='Accept-Language header')), | ||
], | ||
options={ | ||
'verbose_name': 'MyClippings file', | ||
'verbose_name_plural': 'MyClippings files', | ||
}, | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from .book import * | ||
from .clipping import * | ||
from .email_delivery import * | ||
from .email_delivery import * | ||
from .my_clippings_file import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
from clipping_manager.managers import MyClippingsFileManager | ||
|
||
|
||
class MyClippingsFile(models.Model): | ||
objects = MyClippingsFileManager() | ||
|
||
content = models.TextField( | ||
verbose_name=_('Content'), | ||
blank=False | ||
) | ||
|
||
uploaded_at = models.DateTimeField( | ||
verbose_name=_('Upload datetime'), | ||
auto_now_add=True, | ||
blank=False | ||
) | ||
|
||
language_header = models.CharField( | ||
verbose_name=_('Accept-Language header'), | ||
max_length=255, | ||
blank=True, | ||
null=True | ||
) | ||
|
||
class Meta: | ||
verbose_name = _('MyClippings file') | ||
verbose_name_plural = _('MyClippings files') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters