On Jun 4, 10:20 pm, "P. Kaminski" wrote:
> Hello,
> I'm studying the Django page on aggregation
> In the section 'Joins and aggregates' there's an example of how to
> create an annotation for each Store with book price ranges. But what
> if I want to do the opposite, i.e. for each available Book,
On Jun 6, 10:12 pm, Tomas Kouba wrote:
> Hello all,
>
> I am writing an application that often lists objects and some of their
> attributes in tables.
> I get the list in my view and then access attributes in template.
> It means that the table rendering results in many simple sql queries
> (first
ix your application.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googl
ity_Compare_test/apache/django.wsgi
>
> /Users/bradleyhintze/djcode/production/MolProbity_Compare_test/apache>
> Order deny,allow
> Allow from all
>
>
> Any help would be appreciated.
>
> Thanks
>
> --
> Bradley J. Hintze
> Graduate Student
> Duke Uni
ld use "self.file".
Unlike in some other OO languages, object attributes in methods are
not implicit.
[1]:
http://docs.djangoproject.com/en/dev/ref/files/file/#django.core.files.File.size
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
st" object
available in all your templates
[1]:
http://docs.djangoproject.com/en/dev/ref/templates/api/#subclassing-context-requestcontext
[2]:
http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-request
--
Łukasz Rekucki
--
You received this me
Is it only me or is http://docs.djangoproject.com/ down?
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, sen
ps.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegro
s it's type in your custom 500 handler[2].
[1]:
http://docs.djangoproject.com/en/dev/topics/http/middleware/#process-exception
[2]:
http://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view
--
Łukasz Rekucki
--
You received this message because you are subscribed to th
return login_required(bound_dispatch)(*args, **kwargs)
[1]: http://www.toddreed.name/content/django-view-class/
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...
):
pass
It should work as expected.
>
> --
> Best Regards,
> Valentin Golev
> Lead Developer
> r00, http://r00.ru
>
> http://valyagolev.net
> +7 921 789 0895, avaiable 12:00-18:00 MSK
>
>
>
> 2010/10/19 Łukasz Rekucki :
>> On 19 October 2010 19:06, Va
point me in the right direction?
AFAIK, the same rules apply as with code. You create a ticket on
http://code.djangoproject.com/simpleticket describing errors you found
in a way that it will be easy to find for others. Patches are welcome,
but not required.
--
Łukasz Rekucki
--
You received this m
On 23 October 2010 08:08, Joachim Pileborg wrote:
>
> On 19 Okt, 21:18, Łukasz Rekucki wrote:
>> On 19 October 2010 19:06, Valentin Golev wrote:> Hello,
>> > I was going to write something like LoginRequiredMixin, but I have no
>> > idea how to do this. I nee
ave signal ...
This sounds like what django-reversion[1] does :)
[1]: http://github.com/etianen/django-reversion#readme
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
ub.com/dnerdy/factory_boy
Also, there is a more general python solution:
http://farmdev.com/projects/fixture/ that supports django. You should
probably check it out for inspiration before writing a one from
scratch.
--
Łukasz Rekucki
--
You received this message because you are subscribed to t
.
>
You should see this ticket on South's trac:
http://south.aeracode.org/ticket/567; Your options are: downgrade to
0.7.1, use a version from their repository or you can just safely
delete the extra args.
--
Łukasz Rekucki
--
You received this message because you are subscribed to
speed up things significantly.
> - or the way my application is designed??
In the long term, when the DB really starts to be your bottleneck, you
want to do some research about all things "spatial" (like spatial
indexes).
--
Łukasz Rekucki
--
You received this message because you ar
e
super call, but then BaseA.save will never call BaseB.save if you ever
decide to put any code there.
Sorry, if it's not very clear.
[1]: http://www.python.org/download/releases/2.3/mro/
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"
group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
Łukasz Rekucki
--
You received this
m tag or with something horrible like this:
{% with totem.layout.communitySpace|stringformat:"d" as page_number %}
{% with "bacheche/clip_"|add:page_number|add:".html" as template_name %}
{% include template_name %}
{% endwith %}
{% endwith %}
--
Łukasz Rek
ib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'polls'
)
If you forget the comma Python will join the two literal strings.
('django.contrib.admin'
'django.contrib.auth',)
Is the same for Python as:
('
lement was not found - do something with it
pass
except YourModel.MultipleObjectsReturned as e:
# there was more then one object that matches given params - if
params include a (primary) key this shouldn't happen
pass
--
Łukasz Rekucki
--
You received this message because you are subscribed t
On 10 November 2010 22:10, Shawn Milochik wrote:
> 2010/11/10 Łukasz Rekucki :
>> On 10 November 2010 21:55, Shawn Milochik wrote:
>>> The queryset returns zero or more instances of your model. So if
>>> there's only one result, you can just get the first item
p, while still
having the speed of serving static files directly by HTTP server. A
similar solution is also availble for nginx[2] and probably other
webservers.
[1]: https://tn123.org/mod_xsendfile/
[2]: http://wiki.nginx.org/NginxXSendfile
--
Łukasz Rekucki
--
You received this message because
Starting from version 1.1 Django supports aggregation[1], so you can just write:
>>> from django.db.models import Max
>>> Client.objects.aggregate(maxid=Max('id'))
{'maxid': 2L}
And you'll get a dictionary with the value you want as a result.
[1]: ht
com/en/dev/releases/1.3-alpha-1/
>>
>> * Download instructions:http://www.djangoproject.com/download/
>>
>> --
>> "Bureaucrat Conrad, you are technically correct -- the best kind of correct."
>
--
Łukasz Rekucki
--
You received this message because
On 12 November 2010 01:45, Ian Lewis wrote:
> 2010/11/12 Łukasz Rekucki
>>
>> On 12 November 2010 01:16, hcarvalhoalves
>> wrote:
>> > What about having an official 1.3 feedback thread at django-developers
>> > list? ;)
>> >
>> > I'
On 12 November 2010 03:12, Russell Keith-Magee wrote:
> 2010/11/12 Łukasz Rekucki :
>> On 12 November 2010 01:45, Ian Lewis wrote:
>>> 2010/11/12 Łukasz Rekucki
>>>>
>>>> On 12 November 2010 01:16, hcarvalhoalves
>>>> wrote:
>>>
ce a new tag to solve this problem:
>>
>> I say, it should be called {%secretfor%} and the usage would be
>>
>> {%secretfor k,v in mydict %}
>> ... do stuff
>> {%endsecretfor%}
>>
>> would work like sorted(mydict.keys)
>>
>> I won
ontenttypes import generic
class LinkGroup(models.Model):
site = models.ForeignKey(Site)
name = models.CharField() # such as "Navigation Links"
class Link(models.Model):
link_group = ForeignKey(LinkGroup)
content_type = models.ForeignKey(ContentType)
object_id = models.Po
On 20 November 2010 23:31, Robert S wrote:
> Hi
> I'm trying generate documentation for a django project.
>
> The obvious tool is pydoc, which does work. The trouble is, pydoc
> publishes everything ... including passwords.
Why would you put any passwords in docstrings ?
the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.googl
field %}
> treats 0.0 and None the same. Right now, I'm checking is None in the
> application and setting a separate value in the context, but is there a way
> of doing this directly on the field itself?
In Django 1.2, {% if value == None %} seems to work fine.
--
Łukasz Rekuc
onfig, item)
>
>
> Does anyone have some wise suggestions? I would really appreciate it!
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us.
have
changed something in your code/settings (like migrating from Django
1.1 syndication views or adding XView).
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegrou
)
[1]: http://docs.djangoproject.com/en/dev/ref/django-admin/#inspectdb
[2]: http://docs.djangoproject.com/en/dev/ref/models/options/#managed
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, sen
s/i18n/internationalization/#specifying-translation-strings-in-template-code
"To give your template access to these tags, put {% load i18n %}
toward the top of your template."
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Dja
iew = MyView.as_view()
# urls.py
urlpatterns('myapp.views',
url(r'some_pattern/', 'my_view', name="myapp-my_view")
)
There is not way to use a string like 'myapp.views.MyView' - you need
the alias. Also, you most likely want to name all your UR
tle %}
> {% block extra_head %}
>
> {% endblock extra_head %}
> {% block content %}
> {% for food in foods %}
> {{food}}
> {% endfor %}
> {% endblock %}
>
>
>
> --
> You received this message because you ar
%}
>
It's best to just try before asking if something works :) There is a
filter variant too:
http://docs.djangoproject.com/en/dev/ref/templates/builtins/#default-if-none
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users&q
r(domain_required(login=True))
class FileCollectionView(JSONMixin, PersonMixin, SingleObjectMixin, View):
# lots of secret code :)
pass
This uses view_decorator() function I wrote[1], which is a shortcut
for overriding ``as_view`` method (I prefer to override that instead
of ``dispatch``). Mayb
2010/12/8 Nuño Iglesias :
>
> What i'm trying to do is this:
> {{ mystring | upper }}
> to convert "mystring" into upper-case.
AFAIR, there should be no spaces before or after "|": {{ variable|upper }}
--
Łukasz Rekucki
--
You received this message bec
> a problem with that at all. The main issue is how the docs
> approach generic views..
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
ly can't solve your task out-of-the-box - this is
where the need for customization comes from. Old generic views let you
only customize small parts of variables. Class-based views take a
different approach - every time there is a (substantial) decision to
make, call a method on self. This way s
On Feb 19, 2:15 am, geraldcor wrote:
> All of your comments prompted me to start reverse engineering what
> django does and I came across the check_password method which just
> separates the algorithm, salt and hash and then sends it to the
> following method to compare the raw password to the h
f the older API that io module replaces.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-user
ot;. If
you're trying to use a non-existant module, there's not much Django
can do about it.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegro
On 16 September 2011 22:05, Torsten Bronger
wrote:
> this means that we don't have to do anything.
Not really. To 1.4 not be affected, someone needs to write a patch for
that ticket. This can be you ;)
--
Łukasz Rekucki
--
You received this message because you are subscribed to th
says otherwise[1]. You probably mean that there is no
binary packages for newer Python versions. If you trust random blogs,
here are some packages [2][3].
[1]: http://pypi.python.org/pypi/MySQL-python/1.2.3
[2]: http://www.codegood.com/archives/4
[3]: http://www.codegood.com/archives/129
--
Ł
rguments in Python. Thankfully, this
isn't the only way to pass query conditions to filter[1]:
>>> print Table.objects.filter(Q(tags__icontains="candy") &
>>> Q(tags__icontains="milk")).query
SELECT "simple_table"."id", "simple_t
ame" = foo AND "simple_tag"."name" = bar )
Looks related. It's exactly what you specified, but conditions you
gave are just impossible to satisfy.
Your task is a bit more complicated to do in SQL:
Blog.objects.filter(post_tags__name__in=["foo",
"
On 18 December 2010 03:43, suckerfish wrote:
> Hi guys
>
> I've added a decorator to *each* def in views.py to require
> authentication. Is there a simpler way that allows me to apply
> authentication automatically to every def in the file?
Depends on your code editor ?
re options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegr
On 18 December 2010 12:24, Jonas H. wrote:
> On 12/18/2010 10:30 AM, Łukasz Rekucki wrote:
>>
>> On 18 December 2010 03:43, suckerfish wrote:
>>>
>>> Hi guys
>>>
>>> I've added a decorator to *each* def in views.py to require
>>&g
s defined in the
> file and applies the auth decorator to each one.
>
Now that's some "automagic" :). IMHO, putting a single line in front
of a view isn't THAT bad and gives important information to the person
reading the code.
--
Łukasz Rekucki
--
You received this
.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.co
arent=A)
b.save() # this will fail
The patch on #7623 is describing exactly this situation, so you should
check it out.
>
> 2010/12/20 Łukasz Rekucki :
>> This looks a lot like this bug: http://code.djangoproject.com/ticket/7623.
>>
>> On 20 December 2010 23:14, morgan
c.?
Everything except save(), 'cause there is nothing to save.
> I would
> appreciate any help, explanations, or links to good examples or
> tutorials of using forms, other than the introductory django tutorial.
> Thanks in advance for the help.
You can take a look at djangobook: h
age". Now you can google for "django models package":
http://www.acooke.org/cute/UsingaDire0.html
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@go
doesn't. Even the thank you page
> shows the user as being logged in.
>
> Anyone have any ideas?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@goo
> get_initial(), but this doesn't work because the `created_by` field
> has editable=False so the form doesn't include it in the fields list.
>
> Am I missing something simple? Probably :). Any help would be greatly
> appreciated!
>
> Thanks,
> -Justin
>
--
Łu
ation.
> It's not fully ajax but as close as it can get without using flash.
I call this HTML4 fallback. I have a whole jQuery plugin that
transparently uses an IFrame if the user's browser doesn't have any of
required HTML5 capabilities. It lets you upload multiply files with
addit
.pun_collection = []
for pun in Puns.objects.all(): # or if threads are limited:
filter(thread__in=threads)
t[pun.thread_id].pun_collection.append(pun)
# now ``threads`` contains a list of threads with assigned puns.
--
Łukasz Rekucki
--
You received this message because you are subs
m-template-filters
>
>>> {% for x in a %}
>>> loop number = {{forloop.counter|increase}}
>>> {% endfor %}
>
> cheers,
> Konrad
>
Actually, that case is already covered by builtin filter "add":
{% for x in a %} {{ forloop_counter|add:&qu
eportHeader failed, due
to buggy constructor). After all, you're rendering the template even
if you failed to fetch the data you most likely need to render it.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
In receive() you're using a class, while in send()
you're passing an instance of that class, so they have no chance of
matching.
Try:
post_copy.send(sender=type(self), copied_to=new_version)
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google G
pp tolls
To avoid the need of explaining about bash, permission, etc.
>
> I've checked the directory I am using and the manage.py file is there.
> I also set the _init_.py to where the operating system - os is
> imported and that the django_setting_module is set to settings. Any
&g
s
> ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";> eiveShortMessageRequest
> xmlns:ns1="http://flypp.infy.com/sms/v2010r1_0";> D>12345343661t1 ctionID>p1p2 ge>TEXT
> HERE Envelope>']}>
>
Ok, so what problem are you en
c
features planned ? (like the Vote Plugin).
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to
django-use
advantage
of being available even if your internet fails) until the problem is
fixed.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe
t if used in a character class:
>>> re.match("[.]", ".")
<_sre.SRE_Match object at 0xb72fe330>
>>> re.match("[.]", "1")
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django
gex)] )
>
It still is? http://docs.djangoproject.com/en/dev/ref/models/fields/#validators
+ http://docs.djangoproject.com/en/1.2/ref/validators/#regexvalidator
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
like Bitbucket or
Github is a great way, to make sure you don't lose or your work.
3) Deployment - Instead of uploading stuff via FTP, you can just push
your changes to the site. This wil proably require some more knowledge
about VCS, but it will save lots of time.
--
Łukasz Rekucki
--
Y
lte=datetime.datetime.now()) # or at least the datetime.now()
part mustbe dynamic
http://docs.djangoproject.com/en/dev/topics/class-based-views/#dynamic-filtering
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
T
(*args, **kwargs)
You can report it to the bug tracker here:
http://code.djangoproject.com/newticket
Thanks.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googl
tgreSQL's docs:
One should, however, be aware that there's no need to manually create
indexes on unique columns; doing so would just duplicate the
automatically-created index.
So there is just no need, to create the index - it's already there.
--
Łukasz Rekucki
--
You received this me
ning it's most
likely something deprecated in previous version.
(Unless you're using Python 2.7 or later, which also silences
DeprecationWarning, so you should run your code with "-Wd" to see
them).
--
Łukasz Rekucki
--
You received this message because you are subscribed t
the form and template
used[2].
[1]:
http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backend
[2]:
http://docs.djangoproject.com/en/dev/ref/contrib/admin/#django.contrib.admin.AdminSite.login_form
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Goog
decorator() function[2].
[1]:
http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-the-class
[2]:
https://github.com/lqc/django/blob/0eb2de3c156d8e6d1c31f46e0734af0ff06f93c4/django/utils/decorators.py#L46
--
Łukasz Rekucki
--
You received this message because you are subscr
On 24 March 2011 20:15, Lic. José M. Rodriguez Bacallao
wrote:
> so, no one?
>
> On Thu, Mar 24, 2011 at 11:42 AM, Lic. José M. Rodriguez Bacallao
> wrote:
>> hey, I am using ubuntu 10.10, do I really need to update Sphinx to
>> build documentation?
>>
Yes, you do
to the correct URL (or enable
> normalisation in your webserver, that would be easier)
Good news, Django already provides a way to do this. See
APPEND_SLASH[1] setting and CommonMiddleware[2].
[1]: http://docs.djangoproject.com/en/1.3/ref/settings/#append-slash
[2]:
http://docs.djangoproject.com/en/1
On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
wrote:
> use the tag:
> url
What do you mean by that ? Do you mean the {% url %} template tag, or
the `url` function commonly used in urls.py module. Give us some
examples of what you want to achieve and what problems you have.
--
no way to tell to which URL it was bound (look at how as_view()
works for more details).
Naming all your URLs is a good practice anyway.
--
Łukasz Rekucki
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send ema
83 matches
Mail list logo