On Tue, 11 Nov 2008 00:27:06 -0800, [EMAIL PROTECTED] wrote:
> Hello Patrick,
>
> On Nov 11, 1:53 am, "Patrick J. Anderson" <[EMAIL PROTECTED]>
> wrote:
>>
>> Some of the main requirements are:
>>
>> * Personalised HTML/text messages
&g
I'm in the process of writing a simple newsletter managers with a web
interface and since I've been a Django user for the past 2 years, I
thought of using Django for this task.
Some of the main requirements are:
* Personalised HTML/text messages
* Manual delivery twice a week
* Message logging
I'm running mod_wsgi, and I'm wondering if anybody else who uses mod_wsgi
has experienced problems with Django directing requests to 500.html
template when the server returns 500 status code.
Is there any configuration that needs to be set? When running mod_python,
this was wroking fine.
How should I limit choices for ForeignKey fields in admin.ModelAdmin
instances based on request.user attributes, since I can't pass a request
object to the forms.ModelForm constructor?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
On Thu, 22 May 2008 09:32:40 -0700, jonknee wrote:
> On May 21, 9:33 pm, "James Bennett" <[EMAIL PROTECTED]> wrote:
>
>> Well, newforms-admin is being written to make the HttpRequest object
>> available as an argument to the various ModelAdmin methods, which means
>> that when you set up your ow
On Wed, 21 May 2008 20:33:35 -0500, James Bennett wrote:
> On Wed, May 21, 2008 at 8:23 PM, Patrick J. Anderson
> <[EMAIL PROTECTED]> wrote:
>> Passing a Request object should work in application views, but what if
>> one wants to capture that information on every save
On Wed, 21 May 2008 19:46:20 -0500, James Bennett wrote:
> On Wed, May 21, 2008 at 7:35 PM, Juanjo Conti <[EMAIL PROTECTED]> wrote:
>> Ugly. Is this the only way?
>
> Sigh.
>
> No, "ugly" is magical global variables and things that appear out of
> thin air.
>
> Code that's clean and understand
On Wed, 30 Jan 2008 10:30:04 +0200, Eren T�rkay wrote:
> On 30 Jan 2008 Wed 05:49:28 Patrick J. Anderson wrote:
>> How can I inject a subset of related photoalbums into this form?
>
> I don't know much about iteration of models, but in traditional ways,
> you can crea
I'm using newforms and ModelForm and I'm getting a TypeError on the
following code:
class PhotographForm(forms.ModelForm):
album = forms.ChoiceField(choices = PhotoAlbum.objects.all())
class Meta:
model = Photograph
The error message states: "'PhotoAlbum' object is not
Hi, I know that this might not belong in the framework, but since this
widget is part of the newforms, I thought I could ask this.
I was wondering if this widget could be modified so that when rendering
an unbound form, the initial values for month, day and year could be
set, as to force the user
I'm trying to come up with the best working solution to allow my
application to save subsequent objects when I save an object. Here's my
model:
class Milestone(models.Model):
"""Catalogue of project milestones"""
...
deadline = models.DateField()
...
def save(self):
On Mon, 12 Feb 2007 17:54:55 +, Patrick J. Anderson wrote:
> On Mon, 12 Feb 2007 13:06:19 +0000, Patrick J. Anderson wrote:
>
>> I want to plot my milestones into a 28-week calendar using Django. What
>> would be the best approach to doing that?
>>
>
On Mon, 12 Feb 2007 13:06:19 +, Patrick J. Anderson wrote:
> I want to plot my milestones into a 28-week calendar using Django. What
> would be the best approach to doing that?
>
> I have the following code:
>
>
> [dashboardcalendar.py (custom template tag)]
>
I want to plot my milestones into a 28-week calendar using Django. What
would be the best approach to doing that?
I have the following code:
[dashboardcalendar.py (custom template tag)]
from datetime import datetime, timedelta
from django.template import Library,Node
register = Library()
de
On Mon, 12 Feb 2007 05:50:32 +, Patrick J. Anderson wrote:
> On Mon, 12 Feb 2007 15:32:07 +1100, Malcolm Tredinnick wrote:
>
>> On Mon, 2007-02-12 at 03:49 +0000, Patrick J. Anderson wrote:
>>> I think I might be missing something, but I have a problem with
>>>
On Mon, 12 Feb 2007 15:32:07 +1100, Malcolm Tredinnick wrote:
> On Mon, 2007-02-12 at 03:49 +0000, Patrick J. Anderson wrote:
>> I think I might be missing something, but I have a problem with
>> date filter. Why doesn't this template code work?
>>
>&g
I think I might be missing something, but I have a problem with
date filter. Why doesn't this template code work?
{% ifequal d|date:"l" "Sunday" %}
{% else %}
{% endifequal %}
{{ d|date:"l" }}
But inside the HTML list item {{ d|date:"l" }} produces full weekday
names. Can and
Hi, I'm building a calendar for my site and in my template I
need to evaluate whether the day is the first of the month. But I cannot
do this, or it doesn't work as I expected:
{% if equal "1" day|date:"j" %}do something{% endifequal %}
or {% if equal "01" day|date:"d" %}do something{% endifequa
Hi, I was wondering if it is possible, and if so then how, to have a
context-sensitive 'upload_to' parameter set for FileField.
Let's say, I have the following model concept:
class MyModel(models.Model):
folder = models.CharField(maxlength = 8)
file_html = models.FileField(uploa
On Thu, 11 Jan 2007 16:58:34 -0600, Jacob Kaplan-Moss wrote:
On 1/11/07 2:35 PM, Nuno Mariz wrote:
Any idea to resolve this , this don't scale. If I what to add another
language, I have to patch all of my templates.
If I were you, I'd write a simple accessor on your model to get the current
On Wed, 17 Jan 2007 17:27:05 +, Nuno Mariz wrote:
Hi,
I'm portuguese and I'm going to translate django to pt-pt in this
month. Stay tune.
Nuno Mariz
That'd be great! Looking forward to it being included in the framework!
--~--~-~--~~~---~--~~
You recei
James Bennett wrote:
On 1/16/07, Patrick J. Anderson <[EMAIL PROTECTED]> wrote:
I'd appreciate some help with figuring out how to go about adding that
locale to my site in simplest and sensible way.
The simplest way is to produce a translation for the 'pt' lo
Hi, everybody!
I wanted to post about a little problem I have while developing
multilingual site I'm working on.
I plan to include content in various languages, focusing on 3 at the
moment: English, Spanish and Portuguese.
I have followed the docs on i18n and this are working great, except
Brian Beck wrote:
> I think your problem is the return values. args is a tuple and request
> should be there instead. In both of your decorators, return fn(request,
> *args, **kwargs) instead of fn(args, kwargs).
>
>
> >
>
Yes, Brian, that was the problem. Thanks for your help.
--~--~--
Hello,
I wanted to ask for some advice on a little issue I have with
implementing decorators in my views.
I have this piece of code, which I include in each view, to redirect
anonymous and staff users to a notice page (I don't want them to access
site members stuff):
def my_view(request):
RajeshD wrote:
>
>> Or do I have to pass this list of
>> albums to the template:
>>
>> my_albums = Album.objects.filter(owner = request.user)
>
> This will work.
>
>> and then construct a select box based on that list. If so, I'd probably
>> "break out" of {{ form.albums }} and loose {{ form.er
Thanks for excellent advice and suggestions posted on this list.
I'm still learning Django and Python, though I decided to give it a try
in one of my larger projects.
I'm trying to add a few forms to my templates and I have a question
about filtering some form elements, particularly in related
Patrick J. Anderson wrote:
> Here's one of the inclusion tags I wrote this morning for my blog date
> navigation:
>
> ---
>
> from django.template import Library,Node
> from project.apps.
Here's one of the inclusion tags I wrote this morning for my blog date
navigation:
---
from django.template import Library,Node
from project.apps.news.models import Article
register = Library()
def articles_months(context):
Hi!
I have a member_id session variable, which I set at login (it is
different than "user").
I need to check that variable in my templates to display member-specific
navigation.
How can I check do this? Or do I need to do the checking in each view
function and pass the value in a template va
Malcolm Tredinnick wrote:
> On Wed, 2006-10-11 at 22:45 -0500, Patrick J. Anderson wrote:
> [...]
>> Thanks for your comments, Malcolm. I realize that a determined person
>> could submit an altered form and edit other profiles.
>>
>> I guess this is not a Djan
Malcolm Tredinnick wrote:
> On Wed, 2006-10-11 at 22:45 -0500, Patrick J. Anderson wrote:
> [...]
>> Thanks for your comments, Malcolm. I realize that a determined person
>> could submit an altered form and edit other profiles.
>>
>> I guess this is not a Djan
Malcolm Tredinnick wrote:
> On Wed, 2006-10-11 at 21:33 -0500, Patrick J. Anderson wrote:
> [...]
>> I guess the concept of approving members needs to be refined. My project
>> has some "special" requirements and this is one of them.
>
> There's no prob
Malcolm Tredinnick wrote:
> On Wed, 2006-10-11 at 21:33 -0500, Patrick J. Anderson wrote:
> [...]
>> I guess the concept of approving members needs to be refined. My project
>> has some "special" requirements and this is one of them.
>
> There's no prob
Malcolm Tredinnick wrote:
> On Wed, 2006-10-11 at 15:07 -0500, Patrick J. Anderson wrote:
>> I have extended Django User model (site members as opposed to users) and
>> I want to approve them before they can use all site features. Below is
>> my model:
>>
&
I have extended Django User model (site members as opposed to users) and
I want to approve them before they can use all site features. Below is
my model:
class Member(models.Model):
user = models.ForeignKey(User)
...
is_approved - models.NullBooleanField(default = False)
RajeshD wrote:
> Firstly, the statement "user = User.objects.get(id=request.user.id)" is
> redundant -- you could directly use request.user instead of that query
> with the same effect.
>
> As far as the actual problem is concerned, your Queryset is returning
> multiple rows because request.user.
RajeshD wrote:
> You could use:
>
> 1. a regular tag or
> 2. an inclusion tag with takes_context=True
> (See:
> http://www.djangoproject.com/documentation/templates_python/#inclusion-tags)
>
> In both cases, your render or tag function will get called with a
> context object from which you can
Waylan Limberg wrote:
> On 10/4/06, Patrick J. Anderson <[EMAIL PROTECTED]> wrote:
>> Hi, everyone!
>>
>> I have a question I've been trying to find answers to in the docs, but
>> perhaps I'm not looking in the right places, because I can'
Hi, everyone!
I have a question I've been trying to find answers to in the docs, but
perhaps I'm not looking in the right places, because I can't find it.
I'm wondering about the use of templatetags in project instead of
application scope. I put my applications in 'apps' subdirectory and
unde
Don Arbow wrote:
> On Oct 3, 2006, at 9:30 PM, Patrick J. Anderson wrote:
>> def main(request):
>> posts = Post.objects.filter(is_approved =
>> True).order_by('-time_added')[:5]
>> t = loader.get_template('homepage.html')
>> c
Forgot to add my specific error:
Exception Type: AttributeError
Exception Value:'dict' object has no attribute 'user'
Exception Location:
/usr/lib/python2.4/site-packages/django/core/context_processors.py in
auth, line 17
Patrick J. Anderson
Patrick J.
In my project, I have a root template called base.html, which all other
templates extend.
I'd like to create a simple navigation with user information, which I
want to write once and put in the base template to be shown on every page.
I'm not sure what the best way of retrieving information fr
Is there a simple way to add the slug field to a custom form template?
I'm using django.views.generic.create_update.create_object and my model
has a slug field. Whenever I try to add a new item to database, I
receive error saying that my "title" is similar to the on existing in
the database, s
I'm not totally clear, perhaps it's a Python and not Django-specific
question, but in my e-commerce app model, I have Currency and
ExchangeRate classes:
class Currency(models.Model):
name = models.CharField(maxlength = 50)
code = models.CharField(maxlength = 3)
class Meta:
gjiro wrote:
> Hi Patrick,
>
> Check if your settings.py conforms to:
> http://www.djangoproject.com/documentation/settings/#languages
>
> The context processor that exposes LANGUAGES to the template's
> "context":
> http://code.djangoproject.com/browser/django/trunk/django/core/context_processo
I'm following the docs on i18n. In there, there's a sample of template
code for a language selection form:
{% for lang in LANGUAGES %}
{{ lang.1 }}
{% endfor %}
But LANGUAGES is empty for me in the template. How can I use LANGUAGES
variable in the templ
Hi!
I'm building a day-based navigation for my blog posts. I'm using generic
view (month_archive) object_list to get all post for a specific month.
How can I get unique days in my template loop on object_list if I have
multiple posts per day? Is there a way to do it "generically", or do I
nee
Malcolm Tredinnick wrote:
> On Mon, 2006-07-17 at 09:41 -0700, Patrick J. Anderson wrote:
>> Sorry, but would you be able to explain this in detail? I was thinking
>> about acomplishing this in model classes, not in views, so I'm not sure
>> if I understand what you m
Sorry, but would you be able to explain this in detail? I was thinking
about acomplishing this in model classes, not in views, so I'm not sure
if I understand what you mean.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google G
In my model I'd like to keep track of who added/updated a particular record.
class Entry(models.Model):
...
time_added = models.DateTimeField(auto_now_add = True, editable =
False)
user_added = models.ForeignKey(User, default = ?, editable = False)
time_updated = models.DateT
[EMAIL PROTECTED] wrote:
> I can't seem to get filter_interface on M2M relationships to work.
> There are no errors but the admin interface looks identical with and
> without the extra directive in there. Here's the relevant field:
>
> attributes = models.ManyToManyField(Attribute,
> filter_
I am wondering if it is possible to populate a list of text input
fields in admin forms from a default store (database or text). Perhaps a
problem I'm trying to solve will illustrate it better.
Code:
class Project(models.Model):
""" Production Projects """
name
On Tue, 27 Jun 2006 23:30:56 -0500, Patrick .J. Anderson wrote:
> Malcolm Tredinnick wrote:
>> [quoted text muted]
>
> Hi, Malcolm
>
> Yes, I noticed that too. Perhaps it would be good if I tested this
> behaviour on another distro, but I don't want to resetup m
Malcolm Tredinnick wrote:
> On Tue, 2006-06-27 at 23:09 -0500, Patrick .J. Anderson wrote:
>> Jacob Kaplan-Moss wrote:
>>> Hi Patrick --
>>>
>>> What happens when you clear out your sessions table?
>>>
>>> FYI, there's nothing about Ub
Jacob Kaplan-Moss wrote:
> Hi Patrick --
>
> What happens when you clear out your sessions table?
>
> FYI, there's nothing about Ubuntu versus mod_python that would/could
> cause this (I use both).
>
> Jacob
>
> >
>
I cleared the session table and tried to login using my
apache/mod_python
Nikolaus Schlemm wrote:
>> I've heard that the problem might be related to md5 hashing (someone
>> just recently posted it here in the groups with the same error
>> message). I looked at the django code and that where that error message
>> is thrown and it seemed to confirm that, but I don't know
Patrick .J. Anderson wrote:
> [EMAIL PROTECTED] wrote:
>> Clear the cookies in your browser and the problem will go away.
>>
>>
> clearing the cookies doesn't help (I guess you answered that one).
>
> hmm, i don't know exactly what to do here, as I haven
[EMAIL PROTECTED] wrote:
> Clear the cookies in your browser and the problem will go away.
>
>
> >
>
clearing the cookies doesn't help (I guess you answered that one).
hmm, i don't know exactly what to do here, as I haven't tampered with
anything. I'll try to recreate the project (extra work,
Hmm, I haven't changed domains. I simply took my previous setup on
Fedora Core 5 with apache+mod_python and put it on Ubuntu Dapper with
apache+mod_python.
I've heard that the problem might be related to md5 hashing (someone
just recently posted it here in the groups with the same error
message).
I installed Ubuntu Dapper today and got django set up.
I restred a Django application I was working on previously and when I
tried to login to the admin section, I received this error:
Traceback (most recent call last):
File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" in
get_
Thanks, that works well.
--~--~-~--~~~---~--~~
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 [EMAIL
I'd like to display a list of tags (ManyToMany relationship to
Articles) in admin list_display.
I'm getting a reference to an object. Is there a way to do this in
Admin class inside my model?
Below is a code chunk from my model:
class Article(models.Model):
#...
tags= mo
That's right! Thanks for spotting this silly mistake.
--~--~-~--~~~---~--~~
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
Yes, that's true, but what would be the easiest way to reuse the
pagination "widget" (if you can call it that) instead of writing my
own? Sorry, if I haven't explained it in more detail
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Following documentation found on
http://code.djangoproject.com/wiki/UsingFreeComment, I run into this
problem. Below is my template:
{% load comments.comments %}
{% for p in latest %}
{% get_free_comment_count for blog.post object.id as comment_count
%}
{{ p.title
}}
What is the best way to reuse admin pagination in a generic object_list
view template?
--~--~-~--~~~---~--~~
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@googlegr
Well, that fixed it. I guess development using mod_python can be a
little cumbersome.
--~--~-~--~~~---~--~~
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
I'm trying to display my records based on date. I've removed
object.list... same result, page returns the same error message.
It's weird, because it was working fine just a few minutes ago.
--~--~-~--~~~---~--~~
You received this message because you are subscribe
Hi, I've been working with date_based generic views in my application,
and while everything was going great, all of a sudden I'm getting this
error on, while trying to access records for a specific month:
ViewDoesNotExist at /projects/2006/jun/
Could not import django.views.generic.date_based.ar
Thanks, guys! That's what I thought, but it helps to have a
conformation, Wilson:). Great job on Django!
There are a few small admin interface issues I'd still need to work
out, mainly I might have a similar number of records related to
articles (the number of article assignments might be slighlt
I'm building a workflow manager for our organisation and decided to
give Django a try. In about 1 hour, I was able to start creating a very
basic model for 'projects' app.
-
from django.db import mode
72 matches
Mail list logo