Comments (9)
What version of django-relationships are you using? @paltman posted #21 which I merged but did not push to pypi. If you're using django-relationships 0.3.0 please try pulling from pypi again as I've just pushed 0.3.1
from django-relationships.
i check and keep you inform
from django-relationships.
Now, this is working great but only if I dont modify the object_list.
If I try to reduce the object list in my view with
Histo.objects.all().order_by('-date_created')[:5]
then I have an error
AssertionError at /
Cannot filter a query once a slice has been taken.
Request Method: GET
Request URL: http://localhost:8000/
Django Version: 1.4.1
Exception Type: AssertionError
Exception Value:
Cannot filter a query once a slice has been taken.
Exception Location: /home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg/django/db/models/query.py in _filter_or_exclude, line 633
Python Executable: /home/foxmask/Django-VirtualEnv/tglr/tglr/../bin/python
Python Version: 2.6.6
Python Path:
['/home/foxmask/Django-VirtualEnv/tglr/tglr',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/pip-1.1-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/Django-1.4.1-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/ipython-0.13-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/PyMySQL-0.5-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/django_registration-0.8-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/django_profiles-0.2-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages/django_debug_toolbar-0.9.4-py2.6.egg',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/plat-linux2',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/lib-tk',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/lib-old',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/lib-dynload',
'/usr/lib/python2.6',
'/usr/lib/python2.6/plat-linux2',
'/usr/lib/python2.6/lib-tk',
'/usr/lib64/python2.6/lib-tk',
'/home/foxmask/Django-VirtualEnv/tglr/lib/python2.6/site-packages']
Server time: mar, 4 Sep 2012 18:21:27 +0200
Do I have to open another ticket ? Or it's the "normal" usage of the application ?
from django-relationships.
Ahh...interesting. Do you mind pasting a bit more code? What is Histo
?
from django-relationships.
histo is a model
class Histo(models.Model):
text = models.TextField()
date_created = models.DateTimeField(auto_now_add=True)
user = models.ForeignKey(User)
from django-relationships.
I'm not clear how this pertains to django-relationships, could you clarify?
from django-relationships.
Hmm, If i dont use django-relationships I have no problem with my view where I do
Histo.objects.all().order_by('-date_created')[:5]
Once I put this in my template
{% for histo in latest_histo_list|unblocked_content:user %}
...
I meet the error above
I hope I'm clearer.;)
from django-relationships.
Ahh thanks, this is what i was interested in. The problem is you're applying a limit to your query before you pass it into the templatetag, which will apply additional filters.
To solve this:
view:
Histo.objects.all().order_by('-date_created')
template:
{% for histo in latest_histo_list|unblocked_content:user|slice:":5" %}
...
from django-relationships.
perfect ! thank you
from django-relationships.
Related Issues (20)
- Not Getting How It Relate HOT 2
- Data Fixture HOT 2
- Still not working. HOT 1
- Relationship Status Not Found HOT 3
- "manage.py dumdata auth.user" returns Error HOT 7
- Creating notifications HOT 1
- Ordering relationships by time created HOT 2
- Adding/Removing via Ajax HOT 2
- You can add a symmetrical relationship without approval HOT 4
- Cannot resolve keyword 'site' into field. Choices are: from_user, id, latest_message, to_user HOT 1
- Code explaination HOT 1
- Django 1.5 CustomUser.first_name and Admin HOT 3
- Friend Requests HOT 1
- Django 1.7 Errors in application HOT 3
- Some erros in Django 1.7 HOT 6
- Django-relationships: RelationshipStatus matching query doesnt exist HOT 2
- Django 1.7 support
- Django 1.8 support & Python 3 support HOT 1
- This project needs a maintainer. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-relationships.