Skip to content

Commit

Permalink
apps/classifications: add user classification model
Browse files Browse the repository at this point in the history
  • Loading branch information
Rine authored and philli-m committed Apr 7, 2021
1 parent 4d0416e commit 7c1d89d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 13 deletions.
2 changes: 1 addition & 1 deletion apps/classifications/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

from . import models

# admin.site.register(models.UserClassification)
admin.site.register(models.UserClassification)
admin.site.register(models.AIClassification)
34 changes: 34 additions & 0 deletions apps/classifications/migrations/0002_userclassification.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 2.2.19 on 2021-04-07 13:41

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('a4comments', '0007_comment_is_moderator_marked'),
('a4_candy_classifications', '0001_initial'),
]

operations = [
migrations.CreateModel(
name='UserClassification',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(default=django.utils.timezone.now, editable=False)),
('modified', models.DateTimeField(blank=True, editable=False, null=True)),
('classification', models.CharField(choices=[('OFFENSIVE', 'Offensive'), ('OTHER', 'Other')], max_length=50)),
('comment_text', models.TextField(max_length=4000)),
('user_message', models.TextField(max_length=1024)),
('comment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='a4comments.Comment')),
('creator', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
options={
'abstract': False,
},
),
]
12 changes: 0 additions & 12 deletions apps/classifications/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,9 @@ def save(self, *args, **kwargs):
super().save(*args, **kwargs)


"""
We use the a4 reports for user classifications for now
until we decided on a final reporting/classification procedure.
Since we would have to disconnect reports and instead connect
UserClassification to the comments, this seemed too complicated
without a clear goal.
The reports can then be shown in moderation dashboard without
a classification.
"""

"""
class UserClassification(Classification, base.UserGeneratedContentModel):

user_message = models.TextField(max_length=1024)
"""


class AIClassification(Classification, base.TimeStampedModel):
Expand Down

0 comments on commit 7c1d89d

Please sign in to comment.