Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Like list tag defaults to all registerd models #7

Merged
merged 2 commits into from
Nov 29, 2011

Conversation

mx-moth
Copy link
Contributor

@mx-moth mx-moth commented Nov 29, 2011

{% likes user as like_list %} defaults to using all likable models specified in PHILEO_LIKABLE_MODELS when no models are specified, to allow easy listing of all likes in an application - which is probably the main use case for this.

{% likes user as like_list %} defaults to using all registered models
when no models are specified, to allow easy listing of all likes in an
application - which is probably the main use case for this.
@@ -5,6 +5,7 @@ from django.core.urlresolvers import reverse
from django.contrib.contenttypes.models import ContentType

from phileo.models import Like
from phileo.utils import _allowed, LIKABLE_MODELS
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see _allowed used, should I remove this import or were you intending on using it and forgot to?

`phileo.utils_allowed` handles string arguments, and Model arguments now,
and treats them appropriately. This way, you can pass in either a Model
instance OR a string already in the 'app_name.model' format and both are
handled correctly.

When using the {% likes %} tag, the PHILEO_LIKABLE_MODELS list is
checked before the likes for that model are queried. If the model is not
in PHILEO_LIKABLE_MODELS, that model is skipped.
@mx-moth
Copy link
Contributor Author

mx-moth commented Nov 29, 2011

_allowed should have been used, but I forgot to include it. This commit fixes this, as well as improving the _allowed helper.

paltman added a commit that referenced this pull request Nov 29, 2011
Like list tag defaults to all registerd models
@paltman paltman merged commit f5f9376 into pinax:master Nov 29, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants