code sample: http://dpaste.com/114571/
that code runs on every request to a certain page, which is being hit
frequently. there are only 10 unique keys, and each of them gets
requested several times within the 5-minute window of cache
expiration.
however, what seems to happen is that things are
I'm guessing that you might have tried to do a ForeignKey(User) for
the other_invited. If that is the case, then I think you need to add
a related_name e.g. ForeignKey(User,
related_name="group_invited_to"). You may have to do a related name
for the creator as well.
I hope that helps.
On Jan
Tim Daniel schrieb:
> Thanks for the answer, I was already getting worried about my
> 'session' way. No caching for know although it doesn't seem difficult
> to implement. And yes the way you do it would have that advantage, but
> mine has beautiful urls!! ^^
> thanks again,
>
>
URLs are
Hello all!
I have some logic problem I really don't understand how make model
for this task:
I have registered users (i want to use User class).
Each registered user can create project (or group or blog) where he
can invite another users
So, how it's better to do model ?
I've employed flot (http://code.google.com/p/flot/) with some success. It's
pure javascript and requires jquery.
On Thu, Jan 29, 2009 at 7:39 PM, Nick Lo wrote:
>
> > I need to generate some line charts and bar graphs from django. I
> > recall seeing a very
Hi djangonauts,
For my site, I planned to include a snippets app and was thinking about
cab [1] which powers djangosnippets or some other snippets app.
For Cab, it looks it's not updated since April 2007 so I think it's not
compatible with Django 1.0.x or do not take benefit from 1.0.x
I've created a dynamic form to allow users to upload images, and I'm
trying to validate the form. - it displays fine, but when I validate
and return a response, I get either a Key Error at the line (data =
self.cleaned_data[dataName] ) in _clean_photo or I get a render error
in my template at {{
On Thu, 2009-01-29 at 21:31 -0800, vierda wrote:
> Dear all,
> Thanks for your reply I have modified my code as per below :
>
> views.py :
[...]
> def delete (request):
>user = request.user
>if user.is_superuser:
> if request.method == 'POST':
> form =
On Thu, 2009-01-29 at 21:11 -0800, min wrote:
> Hi.
>
> First, the code in the forms.py:
>
> class TestForm(forms.Form):
> name = forms.CharField( max_length=30 )
>
> Then, the variable is defined in the views.py:
>
> def Test_page(request):
> form = TestForm()
> show_results =
Dear all,
Thanks for your reply I have modified my code as per below :
views.py :
def display_delete_profile(request):
user = request.user
if user.is_superuser:
user_list = User.objects.all()
return render_to_response ('delete.html',
{'user_list':user_list})
def delete
Hi Muslu
how can i can it yuor website to english. I dont uderstad that
language.
On Jan 19, 11:20 pm, "Muslu Yüksektepe"
wrote:
> i am preparing a blog site.
> check outwww.yuksektepe.com
> i will add how can make blog as soon as
> thank you
> from Turkiye
>
>
Hi.
First, the code in the forms.py:
class TestForm(forms.Form):
name = forms.CharField( max_length=30 )
Then, the variable is defined in the views.py:
def Test_page(request):
form = TestForm()
show_results = False
variable = ''
if request.GET.has_key('name'):
Thanks SO much. That did the trick.
Dave
On Jan 29, 1:28 pm, "alex.gay...@gmail.com"
wrote:
> On Jan 29, 3:48 pm, "dave.mer...@gmail.com"
> wrote:
>
> > This si a somewhat nooby question.
>
> > I have a comment. I want to display the post title
On Thu, 2009-01-29 at 19:54 -0800, CALdan wrote:
> hi!
>
> I'm putting together a simple model in Django as an example for a
> large project. I'm attempting to set up the models in an efficient
> manner with as little redundancy as possible (none).
>
> What I'm attempting to do is use
On Thu, Jan 29, 2009 at 9:28 PM, Malcolm Tredinnick
wrote:
>
> On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote:
>> I'm trying to validate an uploaded csv file, so I want to read the
>> first line of text and if it's not the right format, send an error
>> message.
hi!
I'm putting together a simple model in Django as an example for a
large project. I'm attempting to set up the models in an efficient
manner with as little redundancy as possible (none).
What I'm attempting to do is use unique_together across 2 classes
which are linked through their primary
> I need to generate some line charts and bar graphs from django. I
> recall seeing a very promissing package a couple months ago and can't
> find it now.
>
> There's pychart, but it hasn't been maintained for a couple years and
> I question its staying power, and it just generates images. open-
On Thu, 2009-01-29 at 15:18 +0100, Gertjan Klein wrote:
> Malcolm Tredinnick wrote:
>
> >On Wed, 2009-01-28 at 14:33 +0100, Gertjan Klein wrote:
> >> Malcolm Tredinnick wrote:
> >>
> >> I disagree. When I develop web pages (using Django or otherwise) I use
> >> the Firefox HTML validator
Hope out loud is really all i was trying to do also - I'm not
demanding a solution of you. And please believe me when i say i am
very appreciative of your work on django personally. I actually love
the framework and have been able to, rather quickly, throw together
vast portions of my
On Thu, 2009-01-29 at 18:47 +, Adam Stein wrote:
> According to the docs, when using 'contains' in filter() a percent sign
> or underscore is automatically escaped. However, in my case I want the
> resulting SQL to use the percent sign.
>
> I know 'contains' will fill in the outside percent
Thanks for your help Daniel,
That was exactly my problem. I changed the ModelForm in admin.py to
this and it resolved the issue.
class EntryAdminForm(forms.ModelForm):
body_html = forms.CharField(widget=TinyMCE(attrs={'cols': 80, 'rows':
30}))
excerpt_html =
Chris Haynes wrote:
> I need to generate some line charts and bar graphs from django. I
> recall seeing a very promissing package a couple months ago and can't
> find it now.
[snip]
> Any other ideas or comments on the above?
Linux Journal's most recent print-edition had a good article
On Thu, 2009-01-29 at 15:47 -0800, ajlozier wrote:
> Hi Malcolm,
>
> I figured it out. This article is what pointed me in the right
> direction:
>
> http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
>
> While you are right that there are a lot of examples in the code of
> something
Pygooglechart is a good interface to the Google charting API:
http://pygooglechart.slowchop.com/
--Ned.
http://nedbatchelder.com
Chris Haynes wrote:
> I need to generate some line charts and bar graphs from django. I
> recall seeing a very promissing package a couple months ago and can't
>
On Fri, 2009-01-30 at 00:57 +0200, Erik Allik wrote:
> I'm having a situation in which two of my reusable apps both use
> FCKeditor in their admin interface. Since both of them require
> FCKeditor library files, I'm confused which one should provide them?
> Both? How? What is the
On Thu, 2009-01-29 at 15:40 -0500, Todd O'Bryan wrote:
> I'm trying to validate an uploaded csv file, so I want to read the
> first line of text and if it's not the right format, send an error
> message. Unfortunately, neither InMemoryUploadedFile nor
> TemporaryUploadedFile have the readline()
On Thu, 2009-01-29 at 11:34 -0800, Chris wrote:
> I have a python / django script that I have written which will be
> used as a cron. Basically this script goes out to my database and gets
> rows from a given table and performs a specific task then deletes the
> row once finished. What I would
On Thu, 2009-01-29 at 06:44 -0800, phoebebright wrote:
> I want a distinct list of all the 'cat__names' that exist in
> Subcategory and have at least one entry in Business (Business is a
> subclass of model Directory which might be the problem)
>
> dir_query =
I need to generate some line charts and bar graphs from django. I
recall seeing a very promissing package a couple months ago and can't
find it now.
There's pychart, but it hasn't been maintained for a couple years and
I question its staying power, and it just generates images. open-flash-
chart
On Thu, 2009-01-29 at 06:36 -0800, Andrew Ingram wrote:
> On Jan 29, 2:18 pm, Gertjan Klein wrote:
> > This payment thing comes up regularly here, and pollutes the discussion.
> > I have been using Django for a while, and found it to have good things
> > and downsides (both
On Thu, 2009-01-29 at 03:56 -0800, Markus Bertheau wrote:
> Hi,
>
> I need a registration form that allows the user to input several
> models. Now just creating two ModelForms and letting a third class
> inherit from them doesn't work, the fields of one model don't show. Is
> there another way
On Thu, 2009-01-29 at 09:48 +0100, Stefan Tunsch wrote:
> Well, first of all I can't believe I've overlooked the __in field
> lookup... I wasn't aware of it's existance. Sorry.
>
> Regarding the __year, __month and __day lookups I'm using in my code:
> I do it because I want to filter all
On Wed, 2009-01-28 at 23:47 -0800, Daniel Roseman wrote:
[...]
> No, you have provided four keyword arguments. The signature for the
> delete_object function is as follows:
> def delete_object(request, model, post_delete_redirect,
> object_id=None,
> slug=None, slug_field='slug',
On Wed, 2009-01-28 at 23:21 -0800, Vinay Sajip wrote:
[...]
> I was hoping there was another way. Of course subclassing's not hard
> to do, but it means doing it for every field class. I was looking at
> moving an application over from SQLAlchemy, which offers this feature
> both for models and
Yes, almost. It got me to understand the correct syntax.
I noticed that my results were coming according to Industry's primary key,
rather than the Industry integer field, so I appended another __industry
Here is the solution:
Project.objects.filter(campaign__industry__industry=x)
Thank you
Hi Malcolm,
I figured it out. This article is what pointed me in the right
direction:
http://www.b-list.org/weblog/2008/nov/09/dynamic-forms/
While you are right that there are a lot of examples in the code of
something similar, and that, in theory, I should be able to find the
answer to any
On Fri, Jan 30, 2009 at 2:47 AM, koenb wrote:
>
> This is really great! Thanks all for the good work.
>
> Just curious, has there been any work done to make this also work for
> dates ?
>
> like in
>
> longevents =
The problem with the sorting method is that I think it will take to much
time. I would like if it could happen as part of the query.
"operator module to get attributes of the object(s) in your QuerySet", I'm
not sure I know how to do this.
I have tried writing it as SQL with cursor:
this has bitten me too recently.
in general I'm moving away from fixtures. they are breakable, they suffer
when the codebase is refactored.
particularily for tests I no longer use fixtures.
I would suggest trying the dump-to–python-code method
ideally there should be a away to dump a group
I'm having a situation in which two of my reusable apps both use
FCKeditor in their admin interface. Since both of them require
FCKeditor library files, I'm confused which one should provide them?
Both? How? What is the idiomatic/standard way of doing this? Should I
instead have them both
On Thu, Jan 29, 2009 at 5:49 PM, Tipan wrote:
> I'll go ahead as planned on the Django update and see if this delivers
> any improvements. With regards to your suggestion of using the raw id
> field, is this a Django option, or did you mean changing the FK to
> using a simple
>
> Without specifics, it's a little difficult to say for certain, but one
> of the reasons for the switch to newforms and newforms-admin was to
> eliminate some very expensive querying behavior in the manipulators
> behind forms. This wasn't a matter of one big query that was expensive
> - but
Hi all,
say i have a FormWizard of 5 steps and at the last step i want to
display a summary of the submitted data how do i access the value of a
field that was in the form at step 1?
example:
class Step1(Form):
foo = CharField()
bar = CharField()
So at step 5 i'd like to display the value
Hello all. Say I have some models like these:
class Image(models.Model):
file = models.ImageField(upload_to=get_image_path)
class Line(models.Model):
image = models.ForeignKey(Image)
color = models.CharField(max_length=20)
width = models.IntegerField()
class
On Thu Jan 29 13:49 , "maltebeckm...@mac.com" sent:
>
>I am an Expression Engine (CMS) fan who recently got convinced that
>Python is way cooler than PHP. Problem is that Expression Engine is
>written in PHP.
>
>Is there an Expression Engine for Django, i.e. an installation package
>that can
On Jan 29, 3:48 pm, "dave.mer...@gmail.com"
wrote:
> This si a somewhat nooby question.
>
> I have a comment. I want to display the post title for the
> comment.object_id.
>
> In the template I have been trying things like comment.post.title, but
> that is not working.
>
>
Hello,
You can use the sorted() function in Python to order any iterable. It
asks for a key to order by, which can be a lambda, or you could use
the operator module to get attributes of the object(s) in your
QuerySet object to provide the key.
My $0.02,
Brandon
On Jan 29, 12:38 pm, lollerikken
This si a somewhat nooby question.
I have a comment. I want to display the post title for the
comment.object_id.
In the template I have been trying things like comment.post.title, but
that is not working.
I think it is due to the fact that Comments use a generic foreign key.
So... how do I do
I'm trying to validate an uploaded csv file, so I want to read the
first line of text and if it's not the right format, send an error
message. Unfortunately, neither InMemoryUploadedFile nor
TemporaryUploadedFile have the readline() method.
Was that an oversight (in which case I'll create a
I'm not sure I understand what you're asking, but
projs = Project.objects.filter(campaign__industry=x)
where x is one of 1-6 should do what you want, I think.
Is that what you were asking?
On Thu, Jan 29, 2009 at 9:54 AM, Kyle wrote:
>
> Hello!
>
> I am trying to get a
Chris wrote:
> I have a python / django script that I have written which will be
> used as a cron. Basically this script goes out to my database and gets
> rows from a given table and performs a specific task then deletes the
> row once finished. What I would like to do is have multiple instances
Thanks Malcolm.
For anyone interested in this topic, I have created a snippet with my
solution:
http://www.djangosnippets.org/snippets/1301/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
I have a python / django script that I have written which will be
used as a cron. Basically this script goes out to my database and gets
rows from a given table and performs a specific task then deletes the
row once finished. What I would like to do is have multiple instances
of this script
According to the docs, when using 'contains' in filter() a percent sign
or underscore is automatically escaped. However, in my case I want the
resulting SQL to use the percent sign.
I know 'contains' will fill in the outside percent signs, but it escapes
the percent sign in my string. So that
Hello, sorry about my English, but I hope that it is understandable
I am having some trouble using order_by with Django.
I think it would be easier to explain what I want with an example:
fx if I have this table:
key ref
1 a
2 g
3 a
4 c
5 g
6 g
I would like to sort it like this:
This is the final code which works in case it helps anyone else.
Thanks again.
In the template:
{% page_links category %}
In templatetags file
@register.tag(name="page_links")
def get_page_links(parser,token):
tag_name, category = token.contents.split()
return
This is really great! Thanks all for the good work.
Just curious, has there been any work done to make this also work for
dates ?
like in
longevents = Event.objects.filter(enddate__gte=F('startdate')+10)
or something like that ?
Koen
--~--~-~--~~~---~--~~
You
That's an interesting post but I havn't managed to get it to solve my
problem because I'm looking for a list of all categories and that
method using FOO_set only seems to work on a single object (get).
Also tried the raw sql method but I get an SQL error
(1064, "You have an error in your SQL
Hi all,
I was just wondering if anyone has tried sending mail through
Microsoft exchange. What information do I need, and will it work with
django's smtp functions?
Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Ok, I think I finally got it! In order to use my css template as a
django inherited base.html(which is under folder-template) I have to
place my html(ex. index.html) pages under the same folder "template",
which is specified as a directory path in the settings.py file under
TEMPLATE_DIRS:
Am 29.01.2009 um 01:59 schrieb Malcolm Tredinnick:
>
> On Wed, 2009-01-28 at 19:24 +0100, Florian Lindner wrote:
>>
>> Am 28.01.2009 um 05:19 schrieb Malcolm Tredinnick:
>>
>>>
>>> On Tue, 2009-01-27 at 20:11 +0100, Florian Lindner wrote:
Hello,
I'm playing around with the
ok... i'm trying to use exclude in the query set to get this to work.
I'm not entirely sure how my logic should go though...
especially since i would be comparing to lists that would result in <>
not being usable... since a user and a group won't contain the same
set of groups.
is it possible
well thank you, what do you think about this one? is that possible?
class Product(models.Model):
name = models.CharField(max_length=50)
slug = models.SlugField()
preview_animation = models.ImageField(upload_to = "animations")
class Game(Product)
another_properties =
Thanks all! I needed to put the curly brackets around the website
variable. Dumb mistake on my part. It works now!
Thanks!
{{ researchproject.institution|
> > safe }}
On Jan 28, 2:15 pm, Karen Tracey wrote:
> On Wed, Jan 28, 2009 at 4:28 PM, May
On Jan 29, 8:44 am, phoebebright wrote:
> I want a distinct list of all the 'cat__names' that exist in
> Subcategory and have at least one entry in Business (Business is a
> subclass of model Directory which might be the problem)
>
> dir_query =
We recently uncovered a bug in our code, which was pretty confusing,
and is explainable only via the fine-print of
http://docs.djangoproject.com/en/dev/topics/http/middleware/ -- and
reading through the Django source. So I thought I'd share, and maybe
a Django developer might comment on whether
You understood perfectly. It was just another case of my not
understanding the documentation. Your explanation makes perfect
sense.
Many thanks.
On Jan 27, 6:45 pm, Eric Abrahamsen wrote:
> On Jan 28, 2009, at 1:52 AM, phoebebright wrote:
>
>
>
>
>
> > I have duplicated as
Hello!
I am trying to get a list of "Projects" based on certain "Industry".
(My naming convention, not django's)
My models look like this:
http://dpaste.com/114308/
"Project" has a foreign key to "Campaign".
"Industry" also has a foreign key to "Campaign".
Does it matter if both
Hi, I'm in Singapore.
I'm building a django/satchmo site right now. I have worked on about
ten Django sites in the past, and for a Singapore client in particular
we just completed http://www.asiansecurity.org/
Good to know there are other Django users here!
Cheers,
Arthur
On Jan 29, 2:00 pm,
I want a distinct list of all the 'cat__names' that exist in
Subcategory and have at least one entry in Business (Business is a
subclass of model Directory which might be the problem)
dir_query = Business.objects.all().select_related().distinct()
...
subcats =
On Jan 29, 2:18 pm, Gertjan Klein wrote:
> This payment thing comes up regularly here, and pollutes the discussion.
> I have been using Django for a while, and found it to have good things
> and downsides (both IMHO). I have not even critisized Django here (yet
> ;)), just
Malcolm thanks for the feedback and your right, I agree with you that the
client should not know about the user.
Vitaly Babiy
2009/1/26 Malcolm Tredinnick
>
> On Sat, 2009-01-24 at 12:14 -0500, Vitaly Babiy wrote:
> > Yes either way would work I was just wondering if
Malcolm Tredinnick wrote:
>On Wed, 2009-01-28 at 14:33 +0100, Gertjan Klein wrote:
>> Malcolm Tredinnick wrote:
>>
>> I disagree. When I develop web pages (using Django or otherwise) I use
>> the Firefox HTML validator extension. This helps me write
>> standards-compliant HTML -- a big red
On Wed, Jan 28, 2009 at 11:49 PM, Malcolm Tredinnick
wrote:
>
> On Wed, 2009-01-28 at 22:50 -0500, Karen Tracey wrote:
>>
>> No, I don't think that's an accurate representation of the status.
>> The triage state is Accepted and furthermore Malcolm even assigned it
>> to
On Jan 29, 1:19 pm, Christian Joergensen wrote:
> What if one of the machines was unresponsive at the time of the upload?
One option would be to have all the files uploaded locally, but the
handler would additionally copy to the other locations. The other
would just to be to have
Andrew Ingram wrote:
[...]
> Ideally you'd be able to provide it with a tuple of machines to
> connect to which would allow you to upload to all the machines at once
> (but even if there's one that only allows you to upload to one machine
> that would still be useful).
What if one of the
Thanks Daniel, I'll take your advice.
I'm surprised (i.e. don't understand why) this approach is problematic
though.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send
Hi All,
At the moment our Django apps run on the same server that the static
images are served from, we are looking to change this to improve
redundancy.
Has anyone created (or attempted to create) a new file backend that
uses SSH?
Ideally you'd be able to provide it with a tuple of machines
On Jan 29, 12:00 pm, JonUK wrote:
> I'm creating a new admin UI for User, separate to the standard admin
> User interface - I have the following setup:
>
> class WebsiteUser( User ):
> class Meta:
> db_table = 'auth_user'
>
> class WebsiteUserAdmin(
I'm creating a new admin UI for User, separate to the standard admin
User interface - I have the following setup:
class WebsiteUser( User ):
class Meta:
db_table = 'auth_user'
class WebsiteUserAdmin( admin.ModelAdmin ):
list_display = ( 'username', )
admin.site.register(
Hi all,
With [9792], I've committed F() query expressions to trunk. For
details, see the docs:
http://docs.djangoproject.com/en/dev/topics/db/queries/#filters-can-reference-fields-on-the-model
There are two caveats worth knowing about:
1) This patch reveals a bug in the SQLite package that
In that version (0.96) of Django was bug in combination of these
decorators and CacheMiddleware. If you can use upstream version then
everything will be working. Otherwise look for these (closed) tickets on
http://code.djangoproject.com and patch your version.
Tomas Kopecek
Well,
i figured it out. As i said before, i upgraded from django 0.97 (svn)
to 1.0.2 stable, BUT i didn't rebooted my server. So, when i looked at
META INFORMATION in my browser, i saw that 0.97 version still being
used, instead of the new version. I rebooted it and everything is
normal again.
On Wed, Jan 28, 2009 at 7:36 PM, Ian wrote:
> Yes, that's the problem. The admin automatically adds .distinct() to the
> queryset whenever one of the search fields is in a related model, which
> would trigger the error.
Ok, got it.
> This is a limitation of Oracle,
Well, I thought it didn't escape the input string. I was wrong. I
tried `escape_js` again and now it works just fine. It probably did
before, but I don't remember why I thought it didn't.
Regards,
Sander
On 28 jan, 04:28, Malcolm Tredinnick wrote:
> On Tue, 2009-01-27
Hello,
in my templates pages, i do: {% load FtrToolTags %}
in my FtrToolTags, i do: from webTool.ftrTool.models import Product
i also use Product model on admin.py, forms.py, views.py and models.py
Thanks,
Thiago
On Jan 28, 11:21 pm, Malcolm Tredinnick
wrote:
> On
Oh wait, you told me that too:
MIDDLEWARE
Okay, I'm all set, thanks so much.
--~--~-~--~~~---~--~~
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
Yes, thank you, but I already figured that out and made a stupid
function add_to_log(request). What I am really wondering is, how do I
avoid having to call add_to_log(request) in every single view function
in views.py?
Thanks.
On Jan 28, 8:04 pm, Malcolm Tredinnick
On Jan 29, 9:07 am, arbi wrote:
> Hi,
>
> I am a newb in Django and I find it very nice... But the current
> problem is that, when I try to synchronize my models (using python
> manage.py syncdb), an attribute that I changed did not change in my
> database. For instance :
>
Hi,
I am a newb in Django and I find it very nice... But the current
problem is that, when I try to synchronize my models (using python
manage.py syncdb), an attribute that I changed did not change in my
database. For instance :
class Route (models.Model) :
name=.
attribute 2
On 28 jan, 23:09, Mirat Can Bayrak wrote:
> Can you look at these, can they work?
>
> i tried that one but not worked, is there way to make it working? (nope,
> there was no error messages, only strings are not shown at admin panel)
>
> LANGUAGE_OPTIONS = (('en_GB',
>
> Generally, you'll want to wait more than 6 hours before asking again. A
> couple of days, at least, would be a reasonable period.
>
Sorry...Will note
On Thu, Jan 29, 2009 at 2:54 AM, Malcolm Tredinnick <
malc...@pointy-stick.com> wrote:
>
> On Wed, 2009-01-28 at 17:19 +0200, Oleg Oltar
92 matches
Mail list logo