Code Monkey home page Code Monkey logo

django-fluent-comments's People

Contributors

ayeowch avatar baffolobill avatar bee-keeper avatar benedictking avatar bzimor avatar grahammcculloch avatar jpic avatar kobold avatar koniiiik avatar matejbadin avatar matmoxam avatar mickael9 avatar mozza avatar petrdlouhy avatar philippeluickx avatar rchrd2 avatar santosh8011 avatar shubbard76 avatar tbabej avatar vdboor avatar whoknowwhat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

django-fluent-comments's Issues

get_query_set method should be renamed get_queryset

Warning on running server:

site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: FluentCommentsAdmin.queryset method should be renamed get_queryset.
.new(mcs, name, bases, attrs))

site-packages/django/forms/widgets.py:143: RemovedInDjango18Warning: FluentCommentsAdmin.queryset method should be renamed get_queryset.
.new(mcs, name, bases, attrs))

Convert ajaxcomments.js to jQuery plugin

Have you considered rewriting the thing to a proper jQuery plugin?
Right now it is just a bunch functions in the global namespace. It would be nice to convert it to a configurable plugin.

Reinitialize the plugin when fetching more forms via ajax

Hello,

if I fetch additional comment form via ajax I need to reinitialize the plugin. What would be the best way to do that ? I have endless scrollable feed with content which user can comment on , as the user scrolls down the new content is fetched with the comment form.

Thanks,

Jorge

Filtering not working with postgreSQL: " No operator matches the given name and argument type(s). You might need to add explicit type casts."

There's a "bug" in postgreSQL (in fact, it's more a feature: strong typed, contrary to MySQL which is "weakly typed", since PostgreSQL 8.3):

Now if you've got:
models.py

class ArticlesTable(models.Model):
    id = models.IntegerField(primary_key=True) 
    comments_set = CommentsRelation()
    ...

and if you want to display the Articles, for which there's comment, for example, you do:
views.py
latest_comments = ArticlesTable.objects.filter(comments_set__isnull=False)

But PostgreSQL doesn't like that!
error:

ProgrammingError at /

operator does not exist: integer = text
LINE 1: ...ango_comments" ON ( "articles_articlesTable"."id" = "django_...
                                                             ^
HINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.

How can we avoid this error when using simple filtering?
Hint here: http://stackoverflow.com/questions/16044754/heroku-postgresql-django-comments-tastypie-no-operator-matches-the-given-na

But I don't now how to change that...

Fix location of threaded-comments preview area

The threaded comments preview is still displayed at the bottom of the comment list. This should be displayed within the <ul><li> structure.

(needs fixing before releasing 1.0 / 0.10)

AJAX comments not working, getting redirect to /blog/comments/posted/?c=

Hi there,

I am having some trouble getting AJAX comments to work in my application. I want to have threaded comments with AJAX so that it gives feedback on the same page to the user, but instead I am being redirected to /blog/comments/posted/?c=[comment number]. This is the link designated by the default django comments app actually, and I am not sure why this is happening. If I look on my page, I can see the ajax template is partially loaded - The "Post" button alongside of "cancel reply" exists beneath the form, which is in the ajax template, but when I actually use it, I get the redirect.

Here is my setup. I'm only displaying the code I have relevant to implementing this app.

In my settings.py, I have:

INSTALLED_APPS += (
    # Adding Threaded Comments app
    'fluent_comments',
    'crispy_forms',
    'threadedcomments',
    'django_comments',
    'django.contrib.sites'
)
COMMENTS_APP = 'fluent_comments'

In my urls.py, I have added:

urlpatterns = patterns('',
    # Adding Threaded Comments app
    url(r'^articles/comments/', include('django_comments.urls')),
    url(r'^blog/comments/', include('fluent_comments.urls'))
)

Next, I have overwritten some of the templates for my custom use case, but the changes are often minor.
In /templates/comments/base.html I have:

{% load i18n %}

{% block headtitle %}{% block title %}{% trans "Responses for page" %}{% endblock %}{% endblock %}

{% block main %}
    <div id="comments-wrapper">
        {% block content %}{% endblock %}
    </div>
{% endblock %}

In /templates/comments/form.html I have:

{% load comments i18n crispy_forms_tags fluent_comments_tags %}{% load url from future %}

{% if not form.target_object|comments_are_open %}
    <p>{% trans "Comments are closed." %}</p>
{% else %}
    <form id="comment-form-{{ form.target_object.pk }}" data-object-id="{{ form.target_object.pk }}" action="{% comment_form_target %}" method="post" class="{{ form.helper.form_class|default:'js-comments-form comments-form form-horizontal' }}"
          data-ajax-action="{% url 'comments-post-comment-ajax' %}">
      {% if next %}<div><input type="hidden" name="next" value="{{ next }}" /></div>{% endif %}

      {% crispy form %}

      <div class="form-group">
        <div class="col-sm-10">
          <input type="submit" name="post" class="btn btn-primary" value="{% trans 'Post' %}" />
          {% ajax_comment_tags for form.target_object %}
        </div>
      </div>
    </form>
{% endif %}

In /templates/comments/comment.html I have:

{% load i18n %}
{% load comments %}
{% load fluent_comments_tags %}
{% load friendly_loader %}
{% friendly_load avatar_tags %}
<article class="col-md-12 comment" style="{% if forloop.counter %}{% if forloop.counter|divisibleby:2 %}background-color: #EEE;{% endif %}{% endif %}">
  <div class="avatar pull-left"><a href="{{ comment.user.get_absolute_url }}">{% avatar comment.user 40 %}</a></div>
  <p class="comment-description">
    {{ comment.comment|linebreaks }}
      <div class="comment-author">
        <p style="margin-top: -10px;">{% trans 'By' %} <a href="{{ comment.user.get_absolute_url }}" rel="author">{{ comment.user }}</a> on <time>{{ comment.submit_date|date:"M j, Y" }}</time></p>
      </div>
      {% if user.is_authenticated %}
      <a href="#form_post_comment_div{{ comment.id }}" class="btn btn-primary btn-xs" id="c{{ comment.id }}" role="button" data-toggle="collapse">Reply</a>
      {% endif %}
  </p>
</article>

In /templates/fluent_comments/templatetags/threaded_list.html I have:

{% comment %}

  The template for threadedcomments, spiced up.
  This is included via comments/list.html

  The id="comments-..." is required for JavaScript,
  the 'comments/comment.html template is also used by the Ajax view.

{% endcomment %}
{% load threadedcomments_tags %}
<div id="comments-{{ target_object_id }}" data-object-id="{{ target_object_id }}" class="comments {% if not comment_list %} empty{% endif %}">
    {% for comment in comment_list|fill_tree|annotate_tree %}
      {% ifchanged comment.parent_id %}{% else %}</li>{% endifchanged %}
      {% if not comment.open and not comment.close %}</li>{% endif %}
      {% if comment.open %}<ul class="comment-list-wrapper">{% endif %}
          <li class="comment-wrapper">
              {% include "comments/comment.html" %}
              {% if user.is_authenticated %}
              <div class="collapse" id="form_post_comment_div{{ comment.id }}">{% render_comment_form for resource with comment.id %}</div>
              {% endif %}
          {% for close in comment.close %}</li></ul>{% endfor %}
    {% endfor %}
</div>

So basically everything works as I expect it to. The only thing that isn't working is that I get a redirect when hitting the "Post" button rather than updating within the page as I expect. I don't have a custom template code for the ajax comments, so it should be the default template:

{% load i18n %}
<a href="#c0" class="comment-cancel-reply-link">{% trans "cancel reply" %}</a>
<span class="comment-waiting" id="comment-waiting-{{ target_object.pk }}" style="display: none;">
  <img src="{{ STATIC_URL }}fluent_comments/img/ajax-wait.gif" alt="" class="ajax-loader" />{% trans "Please wait . . ." %}
</span>
<span class="comment-added-message" id="comment-added-message-{{ target_object.pk }}" style="display: none;">{% trans "Your comment has been posted!" %}</span>
<div class="comment-moderated-message" id="comment-moderated-message-{{ target_object.pk }}" style="display: none;">{% trans "Your comment has been posted, it will be visible for other users after approval." %}</div>

Basically, Line 3 and after of the ajax template don't work - but I know the template is in fact being loaded because the "cancel reply" appears, and only if I have the ajax template in my code. Have I missed something, or is there a bug with the ajax template?

Error when send email

I'm getting following error when
FLUENT_COMMENTS_USE_EMAIL_NOTIFICATION = True is set.

Traceback (most recent call last):

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 115, in get_response
    response = callback(request, *callback_args, **callback_kwargs)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
    response = view_func(request, *args, **kwargs)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/views/decorators/http.py", line 41, in inner
    return func(request, *args, **kwargs)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/fluent_comments/views.py", line 98, in post_comment_ajax
    request = request

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 170, in send
    response = receiver(signal=self, sender=sender, **named)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/fluent_comments/models.py", line 38, in on_comment_posted
    send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/__init__.py", line 62, in send_mail
    connection=connection).send()

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/message.py", line 255, in send
    return self.get_connection(fail_silently).send_messages([self])

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 95, in send_messages
    sent = self._send(message)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/backends/smtp.py", line 109, in _send
    message = email_message.message()

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/message.py", line 221, in message
    msg = SafeMIMEText(self.body, self.content_subtype, encoding)

  File "/home/web/webapps/kronika/local/lib/python2.7/site-packages/django/core/mail/message.py", line 126, in __init__
    MIMEText.__init__(self, text, subtype, charset)

  File "/usr/lib/python2.7/email/mime/text.py", line 30, in __init__
    self.set_payload(_text, _charset)

  File "/usr/lib/python2.7/email/message.py", line 226, in set_payload
    self.set_charset(charset)

  File "/usr/lib/python2.7/email/message.py", line 268, in set_charset
    cte(self)

  File "/usr/lib/python2.7/email/encoders.py", line 73, in encode_7or8bit
    orig.encode('ascii')

AttributeError: 'HttpResponse' object has no attribute 'encode'

Django 1.5.5
threadedcomments pypi version

Any idea ?

example does not work, or insufficient documentation to get it working

Maybe I'm misunderstanding what the example app is supposed to do. I created an article using the admin, and it has "enable comments" checked. When I view it on the site, no comment form is displayed.

The documentation does not say how to use the example though, so I'm probably doing something wrong.

Fail to install using Python 3

akismet is breaking the install on Python 3

$ pip install django-fluent-comments                                                                                                                                    node:system
Collecting django-fluent-comments
  Using cached django_fluent_comments-1.0.5-py2.py3-none-any.whl
Collecting akismet>=0.2 (from django-fluent-comments)
  Using cached akismet-0.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 20, in <module>
      File "/private/var/folders/tp/d0cgdkdd1c32w57b4c_kl9d40000gn/T/pip-build-4au2m7mf/akismet/setup.py", line 5, in <module>
        import akismet
      File "/private/var/folders/tp/d0cgdkdd1c32w57b4c_kl9d40000gn/T/pip-build-4au2m7mf/akismet/akismet.py", line 136
        except Exception, e:
                        ^
    SyntaxError: invalid syntax

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/tp/d0cgdkdd1c32w57b4c_kl9d40000gn/T/pip-build-4au2m7mf/akismet

'crispy_forms_tags' is not a valid tag library

Hello there, thanks for sharing your code.

I get the following error when i try to use {% render_comment_form %}.

Any help?


TemplateSyntaxError at /project/uwjeazhyqt/udxsvbatow/
'crispy_forms_tags' is not a valid tag library: Template library crispy_forms_tags not found, tried django.templatetags.crispy_forms_tags,django.contrib.staticfiles.templatetags.crispy_forms_tags,django.contrib.admin.templatetags.crispy_forms_tags,fluent_comments.templatetags.crispy_forms_tags,django.contrib.comments.templatetags.crispy_forms_tags,django.contrib.humanize.templatetags.crispy_forms_tags,board.templatetags.crispy_forms_tags
Request Method: GET
Request URL: http://127.0.0.1:8000/project/uwjeazhyqt/udxsvbatow/
Django Version: 1.4
Exception Type: TemplateSyntaxError
Exception Value:
'crispy_forms_tags' is not a valid tag library: Template library crispy_forms_tags not found, tried django.templatetags.crispy_forms_tags,django.contrib.staticfiles.templatetags.crispy_forms_tags,django.contrib.admin.templatetags.crispy_forms_tags,fluent_comments.templatetags.crispy_forms_tags,django.contrib.comments.templatetags.crispy_forms_tags,django.contrib.humanize.templatetags.crispy_forms_tags,board.templatetags.crispy_forms_tags
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in load, line 1043
Python Executable: /usr/bin/python
Python Version: 2.7.3
Python Path:

Server time: Wed, 13 Jun 2012 09:42:39 -0500
Error during template rendering

In template /home/smanastirliu/workspace/lemuse/fluent_comments/templates/comments/form.html, error at line 1
'crispy_forms_tags' is not a valid tag library: Template library crispy_forms_tags not found, tried django.templatetags.crispy_forms_tags,django.contrib.staticfiles.templatetags.crispy_forms_tags,django.contrib.admin.templatetags.crispy_forms_tags,fluent_comments.templatetags.crispy_forms_tags,django.contrib.comments.templatetags.crispy_forms_tags,django.contrib.humanize.templatetags.crispy_forms_tags,board.templatetags.crispy_forms_tags
1 {% load comments i18n crispy_forms_tags fluent_comments_tags %}{% load url from future %}
2
3

{% csrf_token %}
4 {% if next %}
{% endif %}
5
6 {{ form|crispy }}
7
8

9 <input type="submit" name="post" class="btn btn-submit" value="{% trans "Post" %}" />
10 <input type="submit" name="preview" class="btn btn-submit" value="{% trans "Preview" %}" />
11 {% ajax_comment_tags %}
Traceback Switch to copy-and-paste view

Ajax for comment replies not working

There is a problem with the cancel reply link when using threadedcomments and jQuery 1.9.1:
Uncaught ReferenceError: data is not defined at line 173 of ajaxcomments.js
(The form stays where it is)

function cancelThreadedReplyForm(event) {
    if(event)
        event.preventDefault();
    var object_id = data['object_id'];   //  <= Exception here
    var $form = $('#comment-form-' + object_id);
    resetForm($form);
}

comment moderation not working

Please forgive me if here is not the right place to ask this question, but i didn't find any answer on stackoverflow or similar sites. also maybe this is something related to code so ..
As far as i understand commenting framework use signals for moderation purposes. In django_comments.moderation.py module in connect method of Moderator class there are to signal listeners that act on signals sended by "django_comments.get_model()" which in this case is "fluent_comments.models.FluentComment". but when posting a comment using the post_comment view of django_comments.views.comments.py module, in the section of sending the signal, the sender is comment.class which resolves to "django_comments.models.Comment" and therefore the signal get ignored(I guess!)
Any suggestion or clue where might be the source of problem?
I attach code snippets for convenience.
django_comments.moderations.py:
moderation

django_comments.views.comments.py:
post

Incompatibility with Django 1.7b

I'm getting this error:

Operations to perform:
  Synchronize unmigrated apps: facebook_comments, allauth, flatpages, chap, django_extensions, impersonate, sponsor, dbtemplates, fluent_comments, sites, contenttypes, crispy_forms, django_comments, django_proofread, sessions, reversion, auth, disqus, inspiration, league, account, admin, challenge, debug_toolbar, django_wysiwyg, team, organization, constance
  Apply all migrations: easy_thumbnails
Synchronizing apps without migrations:
  Creating tables...
  Installing custom SQL...
  Installing indexes...
Running migrations:
  No migrations needed.
Traceback (most recent call last):
  File "/home/humitos/Source/chap/chap/manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 427, in execute_from_command_line
    utility.execute()
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 419, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
    output = self.handle(*args, **options)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 141, in handle
    changes = autodetector.changes(graph=executor.loader.graph)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 36, in changes
    changes = self._detect_changes()
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/db/migrations/autodetector.py", line 53, in _detect_changes
    old_apps = self.from_state.render(ignore_swappable=True)
  File "/home/humitos/.virtualenvs/chap/local/lib/python2.7/site-packages/django/db/migrations/state.py", line 68, in render
    raise InvalidBasesError("Cannot resolve bases for %r" % new_unrendered_models)
django.db.migrations.state.InvalidBasesError: Cannot resolve bases for [<django.db.migrations.state.ModelState object at 0x7f0ac398f350>]

...

ipdb> new_unrendered_models[0]
<django.db.migrations.state.ModelState object at 0x7f702e039350>
ipdb> new_unrendered_models[0].name
u'FluentComment'
ipdb>

If I remove django-fluent-comments from my INSTALLED_APPS the error dissappears.

Too much spam, even with Akismet

I'm not sure what I have done wrong, but I get at least 5 spam comments per day, if not more. I followed the example project when setting it up. This is my settings.py:

INSTALLED_APPS = (
    'fluent_comments',
    'threadedcomments',
    'crispy_forms',
    'django.contrib.comments',
)

FLUENT_COMMENTS_EXCLUDE_FIELDS = ('url', 'title')
FLUENT_CONTENTS_USE_AKISMET = True          
COMMENTS_APP = 'fluent_comments'
FLUENT_COMMENTS_USE_EMAIL_MODERATION = True
FLUENT_COMMENTS_MODERATE_AFTER_DAYS = 7
FLUENT_COMMENTS_AKISMET_ACTION = 'moderate'
AKISMET_API_KEY = 'my-key' 
AKISMET_IS_TEST = False

The template is pretty standard:

{% load comments %}

{% get_comment_count for object as count  %}
   {% if count %}
      <div class='comments-title'>Comments on "{{ object.name }}":</div>
      <hr />
   {% else %}
      <div class='comments-none'>
         There are no comments yet.
      </div>
   {% endif %}

{% render_comment_list for object %}
{% render_comment_form for object %}

models.py:

from fluent_comments.moderation import moderate_model, comments_are_open, comments_are_moderated
from fluent_comments.models import get_comments_for_model, CommentsRelation

class Blog(models.Model):
    name = models.CharField(max_length=50)
    date = models.DateTimeField()
    slug = models.SlugField()
    ... etc...

moderate_model(
    Blog,
    publication_date_field='date',
    enable_comments_field='enable_comments'
)

Is this standard, or am I missing something? I have registered with Akismet, I have the correct Akismet api key in the settings, and I have Akismet 0.2.0 installed on the server (pypi). I'm on Django 1.4.2 with Fluent-comments 0.8.0 and Threaded-comments 0.9.0.

This is about 5 days worth of spam in my comments section:

screen shot 2014-06-03 at 9 28 24 pm

What to do? Also, the spam comments aren't deleted or moderated after the 7 day period set in the settings.py.. Thanks for any assistance!

Pip has an older vrsion

Pip has the version 0.9.2 which has a few issues with newer Django releases. I used some time researching fixes for these out of my own stupidity. Regardless I humbly request that you'd add some info of this near the pip install instructions.

I only noticed that the fixes were present in GitHub after coming to report them.

AJAX and threaded comments not working

I am trying to use django-fluent-comments along with Django 1.6. I tried following their github README tutorial for setting it up but some features like threaded comments and AJAX are not working.

my settings.py has this

INSTALLED_APPS += (
        'fluent_comments',
        'crispy_forms',
        'django.contrib.comments',
        'threadedcomments',
)
COMMENTS_APP = 'fluent_comments'

urls.py has this

urlpatterns += patterns('',
    url(r'^blog/comments/', include('fluent_comments.urls')),
)

my template post_details.html

<html>
{% load comments %}
<head>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}fluent_comments/css/ajaxcomments.css" />
</head>
<body>
<h1>{{post.title}}</h1>
<p>{{post.body}}</p>


<script type="text/javascript" src="{{ STATIC_URL }}fluent_comments/js/jquery-1.10.1.js"></script>
<script type="text/javascript" src="{{ STATIC_URL }}fluent_comments/js/ajaxcomments.js"></script>


{% render_comment_list for object %}
{% render_comment_form for object %}
</body>
</html>

I can see the comments that I post. But the features that are not working are

  • [] 1) AJAX support, when I post a reply i get redirected to another page
  • [] 2) Threaded comments, I simply do not see them.

How do I enable these features ?

Add rating comments!

It would be nice to add a rating for comments and notifications about new comments

Custom model

Is it possible to extend the FluentComment model, or the underlying Comment model at all? I have a system where I would like comments to be votable and I would like to use a mixin on the Comment model - but keep everything else about this app. Is this possible without a fork/custom install?

Add to documentation that for generic views you need the "request" obj

Hi,
trying to use the app with django>=1.4 and within a generic view, i stumbled upon a key error in your template tag, because it expected the request to be available within the context.
So i needed to add

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.core.context_processors.request",
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.core.context_processors.static",
    "django.core.context_processors.tz",
    "django.contrib.messages.context_processors.messages",
)

to my settings.py, for everything to work out as expected.
Regards,

Olivier.

Admin screen doesn't work if the model doesn't define get_absolute_url

I'm using django-fluent-comments in combination with django-threadedcomments to allow adminstrators to comment on a particular model within the standard Django admin change form for that model. The model in question isn't visible on the public site, and so get_absolute_url is not defined on the model.

The admin.py for django-fluent-comments includes the object_link field which is a callable which in turn calls object.get_absolute_url(). If the model in question doesn't have that method defined, then the whole admin screen crashes.

It might be better if there was a setting to enable the developer to control whether the object_link points to get_absolute_url or to the admin change form. For example:

    def object_link(self, comment):
        object = comment.content_object
        title = unicode(object)
        if appsettings.USE_ADMIN_URL:
            info = (object._meta.app_label, object._meta.module_name)
            url = reverse('admin:%s_%s_change' % info, args=(self.pk,))
        else:
            url = object.get_absolute_url()
        return u'<a href="{0}">{1}</a>'.format(escape(url), escape(title))

Another alternative would be to allow the developer to define a callable in settings.py and use that instead.

I'm happy to prepare a pull request if it helps.

with akismet moderation open, cannot publish a post with Chinese characters in the name field.

when i submit a comment with Chinese characters in the user_name field, it goes with the "please wait ..." signal, but then nothing happens.
i tried with English in the user_name field, it functioned as it supposed to.
when i closed the akismet (delete the akismet_api_key in the settings.py), it also worked.
i cannot figure out where my app is wrong because i take actions exactly as your guide in the configuration page.
if you have time, please help me check about this. thanks.

Solve: reply parent posts using threadedcomments.

I found an error trying to create replies for parent posts.

Using reply link generated: reply doesn't add into reply form input: id_parent their parent id.

So I had override ajaxcomments.js and change into function showThreadedReplyForm, this variable assignment: var comment_id = $a.data('comment-id'); for var comment_id = $a[0].attributes['data-comment-id'].nodeValue;

Now it works properly.

Threaded Comments - reply gets stored as new comment instead of going under parent

I am running the example code, and after enabling the threadedcomments, its showing reply link next to the comment. Though while saving the reply comment, it stores as new independent comment and also doesn't show under hierarchy.
image

I'll investigate further and check the issue, meanwhile if anyone aware of this issue, or configuration issue on my side, please let me know.

Deploy on PyPi

Hi there,
Is there a reason this wonderful app isn't deployed on pypi ? :)
Regards,

Olivier.

Multiple comment forms on a single page

Hello! I'm trying to render multiple comment forms on a single page and it all works fine in terms of posting a comment and rendering them, but the real problem lies in the was the comment is posted via AJAX. When posting a comment, it is appended to the very first comment container on the page rather than the one it is meant to be appended to, on page refresh, however, it appears in the right spot. I'm not very good with javascript and I had a bit of a poke around to try and get it appending it to the correct container but I'm not so sure how to go about this. Could anyone help me out on this? Thanks :)

Conficting error

I can't get the app to work. That's what is poping out when I try to runserver

*RuntimeError: Conflicting 'fluentcomment' models in application 'fluent_comments' class fluent_comments.models.FluentComment and <class app.flucom.fluent_comments.models.FluentComment *

.

builtin django-threadedcomments outofdate

Hi guys,

I was having an issue using threadedcomments, it seems that the one you guys used is 0.5 and it seems to be not working at least with django 1.8, the error was:

from django.utils.encoding import force_unicode
ImportError: cannot import name 'force_unicode'

When manually installing django-threadedcomments everythings went smooth. Is there a way to manualy remove the built in package of this apps ? I don,t want to have 2 of this package in my site-package

It will be nice to have at least a note about this issue

Can't save the parent info with threadedcomment

Hi, I tried the example with threaded comment, and found that it can't show the hierarchy in the right way. And i confirmed the comment data with admin, found that the parent info hasn't been saved.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.