Git Product home page Git Product logo

django-review's Introduction

Django Review

A reusable Django app that lets users write reviews for any model

Installation

To get the latest stable release from PyPi

$ pip install django-review

To get the latest commit from GitHub

$ pip install -e git+git://github.com/bitmazk/django-review.git#egg=review

TODO: Describe further installation steps (edit / remove the examples below):

Add review to your INSTALLED_APPS

INSTALLED_APPS = (
    ...,
    'hvad',
    'review',
    'user_media',
    'generic_positions',
)

Add the review URLs to your urls.py

urlpatterns = patterns('',
    ...
    url(r'^review/', include('review.urls')),
)

Don't forget to migrate your database

./manage.py migrate

Usage

The only step you'll have to take is to link to the review views. For example, you created a Book model, which should be reviewed by users.

Create a button and add some markup like:

<a href="{% url "review_create" content_type='book' object_id=book.pk %}">{% trans "Review this book" %}</a>

Ratings & Categories

To make use of ratings you'll have to create RatingCategory objects. For example, you want to allow reviews of a hotel booking. You now might add categories like "room", "service", "food" or whatever. After you have created those categories in the standard Django admin interface they will appear in your review form. The average rating of an object is generated by all of its category ratings.

Template tags

total_review_average

For rendering the total review average for any object, you can use the assignment tag total_review_average. It automatically calculates the averages of all reviews for the given object and you can specify what range it should have. The following examples would resemble a percentage or a stars rating:

{% load review_tags %}
{% total_review_average object 100 as percentage %}
<p>{{ percentage }}% of our users recommended this!</p>

{% total_review_average object 5 as stars %}
<p>This object got {{ stars }} out of 5 stars.</p>

render_category_averages

Renders the template review/partials/category_averages.html to display a table of categories with their average rating. Again, you can specify what maximum rating value the averages normalize to.

{% load review_tags %}
{% render_category_averages object 100 %}

If you had 2 categories, this would per default render to something like the following example, but you can of course customize the template to your needs.

<table>
    <tr><th>Category 1:</th><td>10.0</td></tr>
    <tr><th>Category 2:</th><td>20.0</td></tr>
    <tr><th>Amount of reviews:</th><td>2</td></tr>
</table>

get_reviews

An assignment tag, that simply returns the reviews made for the given object. An example usage would look like this:

{% load review_tags %}

{% get_reviews object as reviews %}
{% for review in reviews %}
    <p>
        {{ review.get_average_rating }}
    </p>
    <p>
        {% if review.content %}
            {{ review.content|truncatewords:'70' }}
        {% else %}
            Reviewed without description.
        {% endif %}
    </div>
    <a href="{% url "review_detail" pk=object.pk %}">Review details</a>
{% endfor %}

get_review_average

An assignment tag, that returns the review average for the given object. An example usage would look like this:

{% load review_tags %}

{% get_review_average object as review_average %}
<p>This object is rated by {{ review_average }}</p>

get_review_count

An assignment tag, that simply returns the amount of reviews made for the given object. An example usage would look like this:

{% load review_tags %}

{% get_review_count object as review_count %}
<p>{{ review_count }} users have reviewed this so far.</p>

user_has_reviewed

To quickly check if a user has already reviewed the given object, you can use this template tag. An example usage could be something like this:

{% load review_tags %}
{% user_has_reviewed myobject request.user as has_reviewed %}
{% if has_reviewed %}
    <p>Thanks for your opinion!</p>
{% else %}
    <a href="{% url "review_create" content_type='book' object_id=book.pk %}">{% trans "Review this book" %}</a>
{% endif %}

Settings

Default behaviour:

  • Users can rate form 0 to 5
  • Only authenticated users can post a review
  • Users can post multiple reviews on one object
  • Users can always update their posted reviews

If you want to change this behaviour, or if you like to add some more permission checks, read on.

REVIEW_RATING_CHOICES

If you want other rating choices than 0-5, you can define a new tuple, like:

REVIEW_RATING_CHOICES = (
    ('1', 'bad'),
    ('2', 'average'),
    ('3', 'excellent'),
)

REVIEW_ALLOW_ANONYMOUS

Allows anonymous review postings, if set to True.

REVIEW_DELETION_SUCCESS_URL

Name of the URL to redirect to after deleting a review instance. This could be your review listing, for example.

REVIEW_UPDATE_SUCCESS_URL (optional)

Default: DetailView of the instance.

Name of the URL to redirect to after creating/updating a review instance. This could be your review listing, for example.

REVIEW_UPDATE_SUCCESS_URL = 'my_view_name'

Or you can also specify a function, that returns the full path. The function then takes the review as parameter, so you can also access the reviewed item like follows

REVIEW_UPDATE_SUCCESS_URL = lambda review: review.reviewed_item.get_absolute_url()

REVIEW_AVOID_MULTIPLE_REVIEWS

Avoids multiple reviews by one user, if set to True. Doesn't work with anonymous users.

REVIEW_PERMISSION_FUNCTION

Custom function to check the user's permission. Use a function and note that the user and the reviewed item are only parameters.

REVIEW_PERMISSION_FUNCTION = lambda u, item: u.get_profile().has_permission(item)

REVIEW_UPDATE_PERIOD

You can limit the period, in which a user is able to update old reviews. Make sure to use minutes, e.g. 2880 for 48 hours.

REVIEW_CUSTOM_FORM

You can create your own review form (e.g. if you want to make use of the review extra info). Just name it.

REVIEW_CUSTOM_FORM = 'myapp.forms.MyCustomReviewForm'

Take a look at the included test app to get an example.

You can also use a custom form to add another content object to the review instance.

REVIEW_FORM_CHOICE_WIDGET

If you only want to override Django's default widget for the used ChoiceField, that is used in the form, you can specify this optional setting.

# this would use a RadioSelect instead of the default Select
REVIEW_FORM_CHOICE_WIDGET = 'django.forms.widgets.RadioSelect'

Contribute

If you want to contribute to this project, please perform the following steps

# Fork this repository
# Clone your fork
$ mkvirtualenv -p python2.7 django-review
$ python setup.py install
$ pip install -r dev_requirements.txt

$ git co -b feature_branch master
# Implement your feature and tests
$ git add . && git commit
$ git push -u origin feature_branch
# Send us a pull request for your feature branch

django-review's People

Contributors

jamim avatar jkellz-dev avatar last-partizan avatar mbrochh avatar tyrdall 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

django-review's Issues

RadioSelect not working & incorrect documentation

HI again. A couple of issues with the documentation:

It says that to use radio buttons instead of the select field, you add
REVIEW_FORM_CHOICES_WIDGET to the settings. This didn't work for me, and I couldn't even find it in the code until I found out it was defined as REVIEW_FORM_CHOICE_WIDGET.

Problem with this was that it didn't work either, the field completely disappeared. The ReviewForm has this and even when I supplied self.widget directly (as forms.RadioSelect) it didn't work.

 for category in RatingCategory.objects.all():
            field_name = 'category_{0}'.format(category.pk)
            choices = category.get_choices()
            self.fields[field_name] = forms.ChoiceField(
                choices=choices, label=category.name,
                help_text=category.question,
            )
            self.fields[field_name].required = category.required
            if self.widget is not None:
                self.fields[field_name].widget = self.widget() 

I had to override the form and add the widget like so:

for category in RatingCategory.objects.all():
            field_name = 'category_{0}'.format(category.pk)
            choices = category.get_choices()
            self.fields[field_name] = forms.ChoiceField(
                choices=choices, label=category.name,
                help_text=category.question, 
                widget=forms.RadioSelect(attrs={'class': 'star'})
            )

Not sure if I went wrong somewhere or if this is a bug.

Content-type header is wrong?

I've an installation of this where the review_create route responds with:

content-type: {model-name}

It seems that this property you set here https://github.com/bitlabstudio/django-review/blob/master/review/views.py#L83, self.content_type, which ends-up being used here: https://github.com/django/django/blob/master/django/views/generic/base.py#L120 to set the content-type to the repr of something (?).

I'm a beginner with Django, just would like to understand how to make content-type be html.

NoReverseMatch error

Reverse for 'review_create' with arguments '()' and keyword arguments '{'content_type': 'blabla', 'object_id': ''}' not found. 1 pattern(s) tried: ['review/(?P<content_type>[-\w]+)/(?P<object_id>\d+)/create/$']

What should I do ?

Thank you !

Subject Field addition

I am considering adding a subject field to the data object of the review. It is fairly common on most sites to have a single line subject to represent the overall sentiment of the review. Amazon is the king in this department.

Also it would correlate to the schema that is the standard for representing reviews:
The field is "name" which is inherited from Thing object.
http://schema.org/Review

This effects SEO. What I do now is fill that field with N characters snippet from the review body.

Amount of reviews

Hello.
I started using the review averages tag {% render_category_averages book 100 %} but whenever I use it, it just gives Amount of reviews: 1 and nothing else. I'm tackling with it currently and will write here if I find out why. Is anyone else having the same problem ?
Thanks !

Customizing templates

Please what is the best way to customize the review templates? Working on the original templates in the review app or creating new templates in my app. If it's the latter, how should this be done? Thanks

review modles is missing an on_delete positional argument

New generic install from both PyPi and Github result in an error when running

python manage.py runserver:

`
File "/home/bandman/code/findscience/env/lib/python3.6/site-packages/review/models.py", line 22, in

class Review(models.Model):

File "/home/bandman/code/findscience/env/lib/python3.6/site-packages/review/models.py", line 42, in Review

content_type = models.ForeignKey(ContentType)

TypeError: init() missing 1 required positional argument: 'on_delete'
`

Rest APi

Does this app support API services

Review Create Page shows up BLANK

Hello.

I created the review url as specified in the README.

When I click on the URL, the url shows up fine, but there is no form to review the item.

Should I link to my custom form? or is there any form already available?

Please let me know.

Regards.

ImportError: cannot import name CHUNK_SIZE

I tried to install your module, but when I run ./manage.py migrate review I get the error saying "ImportError: cannot import name CHUNK_SIZE"

Please let me know if that is a known issue, and if there is any solution.

Regards.

how to use it with react UI

  • How to use it with frontend javascript library other than Django templates.
  • I'm doing the project by learning, and I want to use this library on my product after user order or buy the products.

Will there be a Django 3.0 support?

I modified most part (on_delete argument) and so on but could not get my head around django.utils.functional.curry. I could not even find anything about it on google. I actually can write the 3.0 patch myself and make PR if someone provides me information about curry.

Dot instead of comma

Hello !
Is it possible to make average score use dot to separate like 5.7 instead of 5,7 ?

Thanks

Ratings saving values even when not rated

Hello,

Am currently facing a problem which didn't exist before. When someone makes a review without ratings, a default value is set as rating values. Depending on how my SELECTION options(HTML) is set, the default value could be a 1 or 5. What might be causing this. In the past, when there is no rating by a user, it saves nothing. Help needed, thanks.

Extra content type template tags

Can we get template tags for the extra content type just like we have for content type so I can use the same review on 2 objects easily without having to add fields to their models. I would do the tags myself, but my dev machine has all kinds of weird environment issues and I can't :(

Any questions just let me know. Thank you for your great app :D

hvad.descriptors.NoTranslationError When creating a new review

I apologize if this isn't the right place but I thought I'm definitely not the only one that faced this issue so this might also help others.
I just installed django-review and I'm still learning how to use it but I get this error:
hvad.descriptors.NoTranslationError
when I try to create a new review for my Post model.

I don't have, and probably won't need, translation support for my app.

'str' object has no attribute '_meta'

Was trying render_category_averages tag as provided in guide. Gave me that error. Can anyone recreate that problem ? Thanks !
It doesn't pass the reviewed_item object.
This is my page

{% load i18n %}
{% load review_tags %}
<!DOCTYPE html>
<html>
<head>
    <title>{% block title %}{% endblock %}</title>
</head>
<body>

{% block main %}
<a href="{% url "review_create" content_type='book' object_id=book.pk %}">{% trans "Review this book" %}

{% render_category_averages object 100 %}
{% endblock %}

</body>
</html>

What am I doing wrong now ? Should I pass an object ? Why so ?

Thanks !

Support for Django>=2.0

File "/usr/local/lib/python3.7/site-packages/review/models.py", line 22, in
class Review(models.Model):
File "/usr/local/lib/python3.7/site-packages/review/models.py", line 42, in Review
content_type = models.ForeignKey(ContentType)
TypeError: init() missing 1 required positional argument: 'on_delete'

Unable to delete a user who has reviewd

Environment:

Request Method: POST
Request URL: http://127.0.0.1:8000/admin/auth/user/

Django Version: 1.6.5
Python Version: 2.7.5
Installed Applications:
('django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.sites',
'django.contrib.sitemaps',

'users',
'venues',
'widget_tweaks',
'debug_toolbar',
'imagekit',
'taggit',
'south',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'allauth.socialaccount.providers.google',
'mptt',
'tagging',
'zinnia',
'django.contrib.comments',
'sortedm2m',
'easy_maps',
'hvad',
'review',
'autocomplete_light')
Installed Middleware:
(u'debug_toolbar.middleware.DebugToolbarMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware')

Traceback:
File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response

  1.                 response = wrapped_callback(request, _callback_args, *_callback_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/options.py" in wrapper
  2.             return self.admin_site.admin_view(view)(_args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  3.                 response = view_func(request, _args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  4.     response = view_func(request, _args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  5.         return view(request, _args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapper
  6.         return bound_func(_args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  7.                 response = view_func(request, _args, *_kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/utils/decorators.py" in bound_func
  8.             return func(self, _args2, *_kwargs2)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/options.py" in changelist_view
  9.             response = self.response_action(request, queryset=cl.get_queryset(request))
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/options.py" in response_action
  10.         response = func(self, request, queryset)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/actions.py" in delete_selected
  11.     queryset, opts, request.user, modeladmin.admin_site, using)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/util.py" in get_deleted_objects
  12. collector.collect(objs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/util.py" in collect
  13.         return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/db/models/deletion.py" in collect
  14.                 field.rel.on_delete(self, field, sub_objs, self.using)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/db/models/deletion.py" in CASCADE
  15.                   source_attr=field.name, nullable=field.null)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/admin/util.py" in collect
  16.         return super(NestedObjects, self).collect(objs, source_attr=source_attr, **kwargs)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/db/models/deletion.py" in collect
  17.                 sub_objs = field.bulk_related_objects(new_objs, self.using)
    
    File "/Users/siddharth/Documents/workspace/mac_env/lib/python2.7/site-packages/django/contrib/contenttypes/generic.py" in bulk_related_objects
  18.     return self.rel.to._base_manager.db_manager(using).filter(**{
    

Exception Type: AttributeError at /admin/auth/user/
Exception Value: 'str' object has no attribute '_base_manager'

review form templatetag

I am trying to build a templatetag to generate the review form on any page (instead of having to go to /review/ to fill the form) : any pointer about how to get this done ?

error when adding django-review to installed apps settings.py

Hello

I'm getting the following error when running migrate, after adding 'review' to installed apps sections in settings.py

"Migration %s dependencies reference nonexistent parent node %r" % (migration, parent)
KeyError: u"Migration review.0001_initial dependencies reference nonexistent parent node (u'contenttypes', u'0002_remove_content_type_name')"

Here is a full stack trace for the error

http://pastebin.com/raw/x000GZne

Thank you

How to view the rating for a review

Hi, it seems we can get averages, but not the individual ratings? I have a category called rating, and with it the user adds the review, and I can view the review and averages in the template but not the rating the user chose. How do I go about displaying this?

ObjectID vs ID ?

Hi !
I was experimenting with <a href='{% url "review_create" content_type=book object_id=id %}'>{% trans "Review this book" %}</a>
I realized when I register my book object with object id 1 and when it gets a PK from python id, instead of using object_id, I need to use that pk. Is that a bug or feature ? Because when I look at object_id tag, I think about ContentType relations and want to fill that tag with object_id.

Summary :
Book object created with object_id, positive integer field = 2
Python assigned PK 1 to Book object
Tag asks me to put object_id, I pass 2, doesn't work
Tag asks me to put object_id, I pass 1(PK), works

Did I misunderstood the concept or is this a feature ➿
I could set object_id class as PK but I'm not really fan of it.
Thanks !

no form displayed

Hi there,

I am trying to use your app in my web app. I followed your instruction. When I go to /id/create, the form doesnt display, all is blank. Any ideas?

Is this app compatible with django 1.7

I included django-review in my project, I did all steps from docs, and I got this

(review)olexandr@vbox:~/projects/review_reboot$ python manage.py migrate review
Traceback (most recent call last):
File "manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/management/init.py", line 385, in execute_from_command_line
utility.execute()
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/management/init.py", line 377, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(_args, *_options.dict)
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/management/base.py", line 337, in execute
self.check()
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/management/base.py", line 371, in check
all_issues = checks.run_checks(app_configs=app_configs, tags=tags)
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/checks/registry.py", line 59, in run_checks
new_errors = check(app_configs=app_configs)
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/core/checks/model_checks.py", line 28, in check_all_models
errors.extend(model.check(**kwargs))
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/db/models/base.py", line 1056, in check
errors.extend(cls._check_ordering())
File "/home/olexandr/.virtualenvs/review/local/lib/python2.7/site-packages/django/db/models/base.py", line 1398, in _check_ordering
cls._meta.get_field(field_name, many_to_many=False)
TypeError: call() got an unexpected keyword argument 'many_to_many'

Users able to leave multiple reviews for individual instances.

Currently, when I link users to create a review for an item, there is no backend enforcement to prevent users from creating multiple reviews for individual instances.

In this example, the user reviews a seller:

<a href="{% url 'review_create' content_type='seller' object_id=seller.pk %}">
    Review seller
</a>

Customer is taken to the create page. Customer creates review.

In my code, the link to the create page is hidden after a review is created. However, if the user visits the page again, they are allowed to create another review, in addition to the previous one. This could be disabled by adding a permission function disabling this. But on the database level, there is no requirement for uniqueness in the Database Table (someone can add another review in the shell, admin, etc).

This sounds like undesirable behavior. I'm working on a solution to this and will open a PR soon.

Building REST APIs for Django-review

Hello, I have successfully being using django-review for months now. I want to move on to build APIs using the Django-review models. What's the best way I should go about it? Would appreciate some help. Thanks

relation “review_review” does not exist"

I am using django-review package with one of my application where i am using the custom user model for Authentication. I have installed the django-review in my virtual environment and added the review app in my Installed_APPS as it is described in the documents of package.

but when i am running ./manage.py migrate review i am getting an error that django.db.utils.ProgrammingError: relation "review_review" does not exist
i did everythin same as it is defined in django-review package documents.

AttributeError at /admin/review/review/ 'str' object has no attribute '_base_manager'

There are some issues while deleting the reviews for an object in django-admin. I added some reviews to an object but got errors while deleting the reviews from admin-site.
This is the traceback.

Traceback (most recent call last):
File "/home/user/task/env/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 112, in get_response
response = wrapped_callback(request, _callback_args, *_callback_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 432, in wrapper
return self.admin_site.admin_view(view)(_args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
response = view_func(request, _args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/views/decorators/cache.py", line 52, in _wrapped_view_func
response = view_func(request, _args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/sites.py", line 198, in inner
return view(request, _args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 29, in _wrapper
return bound_func(_args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 99, in _wrapped_view
response = view_func(request, _args, *_kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/utils/decorators.py", line 25, in bound_func
return func(self, _args2, *_kwargs2)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1331, in changelist_view
response = self.response_action(request, queryset=cl.get_queryset(request))
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/options.py", line 1084, in response_action
response = func(self, request, queryset)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/actions.py", line 36, in delete_selected
queryset, opts, request.user, modeladmin.admin_site, using)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/util.py", line 109, in get_deleted_objects
collector.collect(objs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/admin/util.py", line 160, in collect
return super(NestedObjects, self).collect(objs, source_attr=source_attr, kwargs)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/db/models/deletion.py", line 201, in collect
sub_objs = field.bulk_related_objects(new_objs, self.using)
File "/home/user/task/env/local/lib/python2.7/site-packages/django/contrib/contenttypes/generic.py", line 239, in bulk_related_objects
return self.rel.to._base_manager.db_manager(using).filter(
{
AttributeError: 'str' object has no attribute '_base_manager'
[07/Oct/2014 07:57:20] "POST /admin/review/review/ HTTP/1.1" 500 217586
AttributeError at /admin/review/review/
'str' object has no attribute '_base_manager'

What are categories? How do you set them up and use them?

The docs describe a tag that renders categories, and I can see them being handled in the code, but I haven't got my head around what they are or how you are intended to set them up.

Would be good to include this info in the doc.

Django-Review is not compatible with Python3

I've been looking round for a really good review app for django! Huzzah I found one.

But it's not compatible with python3.

Are there any plans to upgrade django-review to python3?

Migration error

Hello,
Please excuse me if this is the wrong place to post the issue .
I have installed django-review app. Using DRF for my project and so have written serializers to fetch Rating/Review/RatingCategory objects. I have written a custom model for which I get migration error on ./manage.py makemigrations:

You are trying to change the nullable field 'master' on ratingcategorytranslation to non-nullable without a default; we can't do that (the database needs something to populate existing rows).

Do you know what is the cause of the error? I'm using the default rating category choices.

Many Thanks,
Deepa

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.