Thanks,
I will check
On 18 Apr, 04:34, HarpB wrote:
> Like
> thishttp://readthedocs.org/docs/django/en/latest/py-modindex.html?highlig...
> or perhaps thishttp://djangoapi.quamquam.org/trunk/?
>
> There is also a great book:http://www.djangobook.com/en/2.0/
--
You received this message because
Like this
http://readthedocs.org/docs/django/en/latest/py-modindex.html?highlight=django
or perhaps this http://djangoapi.quamquam.org/trunk/ ?
There is also a great book: http://www.djangobook.com/en/2.0/
--
You received this message because you are subscribed to the Google Groups
"Django us
OK, thanks
Always learning.
What I miss from my other programming is MSDN like style of help
pages. I tend more and more to use the django pdf documentation
because I can't get used to the web interface for this.
On 17 Apr, 07:42, HarpB wrote:
> Both patterns will produce same query. You can al
Both patterns will produce same query. You can also use
django-debug-toolbar, which gives ur debugsqlshell tool. So you can execute
code from the commandline and can see what the query will be.
Django also has a code pattern for your case - for getting the first
element, you can just use latest
OK, thanks for sharing this
On 16 Apr, 07:54, Pavan Verma wrote:
> I am a Django newbie and also interested in this question.
>
> From reading the Django bookhttp://www.djangobook.com/en/2.0/chapter05/,
> I see that the query 'Publisher.objects.order_by('name')[0:2]' maps
> to:
>
> SELECT id, nam
I am a Django newbie and also interested in this question.
>From reading the Django book http://www.djangobook.com/en/2.0/chapter05/,
I see that the query 'Publisher.objects.order_by('name')[0:2]' maps
to:
SELECT id, name, address, city, state_province, country, website
FROM books_publisher
ORDER
Hello!
I want to get just the top element of one queryset. SO I have
something as
qs=MyModel.objects.filter(...).order_by(..)
and then use qs[0] and check some value
I wonder now if i did the right thing or it is better to use .extra on
queryset.
Is the queryset object allocated for all objects,
thank you so much.
On Feb 7, 8:58 pm, Daniel Roseman wrote:
> On Tuesday, 7 February 2012 11:36:04 UTC, newme wrote:
>
> > thank you.
> > then a basic python question.
> > how does queryset implement it?
> > does python also allow operator (e.g. []) overloading?
>
> It's not usually called overlo
On Tuesday, 7 February 2012 11:36:04 UTC, newme wrote:
>
> thank you.
> then a basic python question.
> how does queryset implement it?
> does python also allow operator (e.g. []) overloading?
>
>
It's not usually called overloading in Python, but yes. Classes can define
a `__getitem__` method
thank you.
then a basic python question.
how does queryset implement it?
does python also allow operator (e.g. []) overloading?
On Feb 3, 5:29 pm, akaariai wrote:
> On Feb 3, 5:52 am, newme wrote:
>
> > so it means when i call user[1] after user[0], it is possible that i
> > will get same record
On Feb 3, 5:52 am, newme wrote:
> so it means when i call user[1] after user[0], it is possible that i
> will get same record if someone else insert a new record into database
> between 2 calls.
Actually, there doesn't need to be an insert between the calls if you
don't use .order_by(). Technic
so it means when i call user[1] after user[0], it is possible that i
will get same record if someone else insert a new record into database
between 2 calls.
On Feb 1, 5:34 pm, akaariai wrote:
> On Feb 1, 9:36 am, newme wrote:
>
> > do you mean that queryset will query database every time i call
On Wednesday, 1 February 2012 08:34:14 UTC, akaariai wrote:
>
> On Feb 1, 9:36 am, newme wrote:
> > do you mean that queryset will query database every time i call
> > user[0]?
>
> Yes. That is exactly what happens:
> In [7]: qs[0]
> Out[7]:
> In [9]: print connection.queries
> [{'time': '
On Feb 1, 9:36 am, newme wrote:
> do you mean that queryset will query database every time i call
> user[0]?
Yes. That is exactly what happens:
In [7]: qs[0]
Out[7]:
In [9]: print connection.queries
[{'time': '0.011', 'sql': 'SELECT ... FROM "organisaatio_osa" LIMIT
1'}]
In [10]: qs[0]
Out[10]:
do you mean that queryset will query database every time i call
user[0]?
On 1月30日, 午前9:29, akaariai wrote:
> On Jan 20, 10:12 am, newme wrote:
>
> > user = User.objects.filter(pk="")
> > user is a QuerySet
>
> > every time i call user[0], i returns a different reference.
>
> > maybe it shoul
On Jan 20, 10:12 am, newme wrote:
> user = User.objects.filter(pk="")
> user is a QuerySet
>
> every time i call user[0], i returns a different reference.
>
> maybe it should be a python question.
> i want to know i QuerySet does that.
The reason is that Django does not do "instance caching".
user = User.objects.filter(pk="")
user is a QuerySet
every time i call user[0], i returns a different reference.
maybe it should be a python question.
i want to know i QuerySet does that.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
Thank you very much for your help
On Sep 29, 4:25 pm, Tom Evans wrote:
> On Thu, Sep 29, 2011 at 3:16 PM, Felix Wagner
> wrote:
> > Ok, so now i have:
> > ..
> > > ...
> > Now if i click next page I get an empty page because:
> >http://127.0.0.1:8000/search/?page=2,
>
> > I probably
On Thu, Sep 29, 2011 at 3:16 PM, Felix Wagner wrote:
> Ok, so now i have:
> ..
> ...
> Now if i click next page I get an empty page because:
> http://127.0.0.1:8000/search/?page=2,
>
> I probably need a url entry and do i have to give the poaginator the
> query or do I have to save the
Ok, so now i have:
template:
{% block coltype %}colMS{% endblock %}
{% block content %}
Suche
Search:
{% if query %}
Resultate für "{{ query|escape }}":
{% if results %}
The
On Thu, Sep 29, 2011 at 8:36 AM, Felix Wagner wrote:
> Hello,
>
> I'm currently trying to paginate my results from a search query.
>
> views.py:
>
> def search(request):
> query = request.GET.get('q', '')
>
> if query:
> qset = (
> Q(NAME__icontains=query)
> )
>
Hello,
I'm currently trying to paginate my results from a search query.
views.py:
def search(request):
query = request.GET.get('q', '')
if query:
qset = (
Q(NAME__icontains=query)
)
results = Thin_Client.objects.filter(qset).distinct()
else:
thanks
ive been reading the documentation constantly, i just couldnt seem to
find that particular tidbit ;]
loving django
On Nov 15, 5:50 pm, Malcolm Tredinnick <[EMAIL PROTECTED]>
wrote:
> On Fri, 2008-11-14 at 20:26 -0800, kaos wrote:
>
> [...]
>
> > Will that return the count of all of the a
On Fri, 2008-11-14 at 20:26 -0800, kaos wrote:
[...]
> Will that return the count of all of the articles in the given
> category using a COUNT(*) query, or will it actually pull ALL of the
> articles from the database and get the size of the array?
>
> Basically i'm trying to figure out if im be
Hi, I am new to Django (and python), and I have a question regarding
database query stuff
Basic info - I have a category model and an article model, and each
article is linked to a category through a foreign key
If i have the following code
---
category = Category.objects.all()[0]
return Http
25 matches
Mail list logo