Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Daniel committed Mar 27, 2024
1 parent 606b938 commit 7184569
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions user_comments/contrib/is_core/cores.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from django import forms
from django.contrib.contenttypes.models import ContentType
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy

from is_core.generic_views.inlines.inline_objects_views import TabularInlineObjectsView

Expand All @@ -12,7 +12,7 @@

class CommentUiForm(SmartModelForm):

comment = forms.CharField(label=ugettext_lazy('add comment'), required=False, widget=forms.Textarea())
comment = forms.CharField(label=gettext_lazy('add comment'), required=False, widget=forms.Textarea())

def _post_save(self, obj):
super()._post_save(obj)
Expand All @@ -29,9 +29,9 @@ class CommentObjectsView(TabularInlineObjectsView):

model = Comment
fields = (
('author', ugettext_lazy('Author')),
('created_at', ugettext_lazy('Created at')),
('comment', ugettext_lazy('Comment')),
('author', gettext_lazy('Author')),
('created_at', gettext_lazy('Created at')),
('comment', gettext_lazy('Comment')),
)

def get_objects(self):
Expand All @@ -57,7 +57,7 @@ class CommentCoreMixin:
ui_detail_view = DetailCommentFormView

notes_fieldset = (
(ugettext_lazy('Comments'), {
(gettext_lazy('Comments'), {
'fieldsets': (
(None, {'inline_view': CommentObjectsView}),
(None, {'fields': ('comment',)}),
Expand Down
12 changes: 6 additions & 6 deletions user_comments/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils.translation import ugettext_lazy
from django.utils.translation import gettext_lazy

from chamber.models import SmartModel

Expand All @@ -20,15 +20,15 @@ class Comment(SmartModel):

objects = CommentQuerySet.as_manager()

author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=ugettext_lazy('author'), on_delete=models.CASCADE,
author = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=gettext_lazy('author'), on_delete=models.CASCADE,
null=True, blank=True, db_index=True)
comment = models.TextField(verbose_name=ugettext_lazy('comment'), null=False, blank=False)
comment = models.TextField(verbose_name=gettext_lazy('comment'), null=False, blank=False)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE)
object_pk = models.TextField(db_index=True)
content_object = GenericForeignKey('content_type', 'object_pk')
content_object.verbose_name = ugettext_lazy('object')
content_object.verbose_name = gettext_lazy('object')

class Meta:
verbose_name = ugettext_lazy('comment')
verbose_name_plural = ugettext_lazy('comments')
verbose_name = gettext_lazy('comment')
verbose_name_plural = gettext_lazy('comments')
ordering = ('-created_at',)

0 comments on commit 7184569

Please sign in to comment.