Django 1.2
I'm attempting to write my first custom Field Type. Eventually it will
do something more complicated, but for now I am simply sub-classing
the CharField. The first thing I'm doing is trying to change the
default form field to be a MultipleChoiceField.
I followed the directions here:
This must be a fairly common need so I'd love some help figuring out
why I've made it so complicated.
I've got a CharField "days_available" with choices set to a tuple of
weekdays (e.g. Monday, Tuesday, etc.).
In my form I am representing this field as a forms.MultipleChoiceField
so that
is simply blank, the page will work. If, however
the name of the variable is printed it won't work. See this ticket for
more info:
http://code.djangoproject.com/ticket/3579
The solution was to comment out those two settings and like magic it
works.
Kevin
On Jun 8, 6:32 pm, Kevin Audleman
I go into the admin section of my site, click on Users, then on the
'Add User' button. It takes me to a screen that asks me to put in a
username and password and click 'Save'. At this point I get an error:
ValueError at /admin/auth/user/add/form_url
invalid literal for int() with base 10:
Hi gang,
I am serving my django website out of a sub-folder, e.g.
http://www.mydomain.com/directory. My hosting provider is WebFaction
and they've set things up so that the /directory part is stripped from
the URL before it reaches my django app (so my app sees "/"). In order
to get django to
ath"
SetEnv DJANGO_SETTINGS_MODULE CasaCasa.settings
SetHandler python-program
PythonOption SCRIPT_NAME
PythonOption django.root "/directory"
On May 25, 1:02 pm, Kevin Audleman <kevin.audle...@gmail.com> wrote:
> Hi Alex,
>
> I did exactly as you suggested w
valid SCRIPT_NAME
> environment variable.
>
> [1]:http://docs.djangoproject.com/en/dev/ref/settings/#force-script-name
>
> ---
> Alex Koshelev
>
> On Mon, May 25, 2009 at 10:52 PM, Kevin Audleman
>
> <kevin.audle...@gmail.com> wrote:
>
> > My web host
My web host set up a django instance for me that can be accessed at
http://www.mysite.com/directory/. They've set up an Apache rule (or
something) that strips out the /directory/ before passing it on to
django, so as a result that url gets resolved by my url pattern "^$".
This is nice, the only
Can't answer your question directly, but it looks as if you are trying
to extend the field list for a user. In this case you should check out
the proper way of doing it using AUTH_PROFILE_MODULE:
all the pieces together
myself.
Kevin
On May 1, 11:28 am, Malcolm Tredinnick <malc...@pointy-stick.com>
wrote:
> On Fri, 2009-05-01 at 11:13 -0700, Kevin Audleman wrote:
>
> > > I can't explain any of this, but I've been thinking about your
> > > question sin
> I can't explain any of this, but I've been thinking about your
> question since you posted it beause I know this type of error happens
> to me a lot (and indeed has been hard to debug), but I couldn't put my
> finger on remembering what my solution was. It just happened, I fixed
> my syntax
Your needs are a bit vague, but here's a thought:
I would think that you would want one project which would conceptually
encompass everything your company does. Within that project you would
create multiple apps: one for training and one for project XYZ (if I'm
reading your requirements
The other thing is that if there is anything else wrong with your
views.py file it can cause Django to throw up this error. See if the
error is occurring on the first occurence of {% url %} that gets
called for the page you are requesting. That would be a good
indication that your error is
TheCorp,
My memory on the issue is rather fuzzy, but I seem to recall that you
can't pass POST data along with a redirect, and that this has to do
with the way HTTP is designed.
Using session variables seems like an excellent idea in my opinion.
One of the reason session variables were invented
You're in luck, I just programmed this exact thing:
Define the following function right above your model:
def upload_location(instance, filename):
return 'profile_photos/%s/%s' % (instance.user.username,
filename)
My function uses 'profile_photos' as the base directory appended to
As is often the case in django, they have already provided a mechanism
for what you are trying to do the hard way: Formsets.
http://docs.djangoproject.com/en/dev/topics/forms/formsets/
Cheers,
Kevin
On Apr 29, 7:18 am, MarcoS wrote:
> Hi all,
> I post a problem, hoping
You might be able to solve your problem by changing the name attribute
of your URL to include "proyName":
url(r'^about/$', 'view_aboutPage', name='proyName.view_aboutPage'),
---
The error message is telling you exactly what it's looking for, after
all:
the error:
"Reverse for
v
> server and moving up if you find you need to. It only takes a couple of
> well-crafted googles, a little reading and a few keystrokes to get a real
> server running yout site.
>
> On Tue, Apr 21, 2009 at 8:18 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
I'm building a tool for a client that synchs email addresses between
systems and decided to use the excellent django framework because it
gives me a quick and powerful connection to a database back-end and
the ability to provide a web front-end for the users. I'm trying to
decide if it's worth
Ah, gotcha.
Maybe django should include a iin function =)
Kevin
On Feb 25, 10:37 am, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Wed, Feb 25, 2009 at 1:34 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
>
>
>
> > What about the following?
&
What about the following?
qset = Q(author__in=[u"Foo", u"Bar"])
Kevin
On Feb 25, 10:03 am, Peter Bengtsson wrote:
> This works:
>
> >>> from django.db.models import Q
> >>> qset = Q(author__iexact=u"Foo") | Q(author__iexact=u"Bar")
> >>> Books.objects.filter(qset)
>
>
I think you're missing the trailing slash in your URL's. Should be:
(r'^appname/mainpage/(?P.*)/$', 'django.views.static.serve',
{'document_root': '/mesa'}),
(r'^appname/mainpage/(?P\d+)/(?P.*)/$',
'django.views.static.serve', {'document_root': '/mesa'}),
Mind you, I don't know if this will
First of all, are you using the AUTH_PROFILE_MODULE methodology? See
the documentation here:
http://docs.djangoproject.com/en/dev/topics/auth/?from=olddocs#storing-additional-information-about-users
If you've defined a foreign key on your People model, I would guess
you're not. This is
Great idea, I'll do that.
Thanks!
Kevin
On Feb 23, 11:30 am, Daniel Roseman <roseman.dan...@googlemail.com>
wrote:
> On Feb 23, 7:19 pm, Kevin Audleman <kevin.audle...@gmail.com> wrote:
>
>
>
> > Hello,
>
> > I am using the excellent django-profiles m
.
Is there another, simpler way of doing it?
Thanks,
Kevin Audleman
--~--~-~--~~~---~--~~
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 unsubs
Tricky...how do you write a method in Django that can query Plone for
the existence of a user? A couple of thoughs:
1. Design an external method in Plone that takes a username/password
and returns true/false
2. Extend Plone to copy the users to a SQL table that you can then
access natively in
this in your request
show_range = (current_show - 4, current_show + 4)
shows = Show.objects.filter(show_order__range=show_range)
FYI I haven't tested this and my Python is not good enough that I can
guarantee my syntax.
Kevin Audleman
On Feb 18, 4:06 pm, Sean Brant <brant.s...@gmail.com> wrot
document.getElementById("pleasewait").style.display = "block";
}
}
//-->
And your HTML code looks like this:
Please wait while your request is being processed...
Cheers,
Kevin Audleman
On Feb 18, 2:52 pm, Malcolm Tredinnick <m
Passing both the form and the object is the solution I use. It may not
be completely DRY, but I can't see how it's bad. You need access to
the data in an object so you pass the object. Much more sensible than
trying to extract those values from a more complicated data
structure.
Kevin
On Feb
You should probably change the order of operations in the
__init__function to call the super classes __init__ function first.
Kevin
On Feb 16, 8:49 am, peterandall wrote:
> Hi all,
>
> I'm trying to access a list of users in forms.py I'm creating two
> lists and merging them
Hey, that's great! I did indeed discover that the change password page
didn't work but didn't know what to do about it. Thanks for your
excellent and thorough help =)
Kevin
On Feb 16, 6:30 pm, Karen Tracey <kmtra...@gmail.com> wrote:
> On Mon, Feb 16, 2009 at 8:19 PM, Kevin
, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Feb 16, 2009 at 7:13 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
>
>
>
> > Alex,
>
> > I feel like I'm one step closer to getting this to work. From the
> > documentation you sent my w
self.myprofile_set.all()[0].payment_status
However I am working with the core User object which I didn't write.
Am I SOL, or is there some way I can do this.
Thanks,
Kevin
On Feb 16, 4:02 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Feb 16, 2009 at 6:59 PM, Kevin Audleman
> <kevin.aud
to the list_display or list_filter sets for the
User object?
Cheers,
Kevin
On Feb 16, 3:45 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Mon, Feb 16, 2009 at 6:27 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
>
>
>
> > I've created a custom
]
admin.site.register(User, UserAdmin)
Is there a way to do this?
Thanks,
Kevin Audleman
--~--~-~--~~~---~--~~
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@google
I have the same session. Django has been so slick so far I would
imagine it has a way to access session variables from a template. Have
you found the solution?
Kevin
On Jan 17, 1:15 pm, dahpgjgamgan wrote:
> Hi,
>
> A simple scenario:
> - A generic object detail
wrote:
> On Tue, Feb 10, 2009 at 6:39 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
>
>
>
> > Thanks Alex, however this is a solution at the View level, and I'm
> > using a view that I didn't write. Is there also a way to do this at
> >
Thanks Alex, however this is a solution at the View level, and I'm
using a view that I didn't write. Is there also a way to do this at
the template level?
Thanks again,
Kevin
On Feb 10, 1:24 pm, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Tue, Feb 10, 2009 at 4:23 PM, Kevin
Hi everyone,
I've set up a model that has a state field with the input set to a
list of states,
state = models.CharField(max_length=100, blank=True,
choices=US_STATE_LIST)
The drop-down on the edit form works great, displaying 'Alabama' and
storing AL in the database. However when I view it,
Wow, that is very cool. I implemented it and it works! Django is
definitely a very impressive framework.
Thanks for your help!
Kevin
On Feb 6, 10:31 am, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Fri, Feb 6, 2009 at 12:58 PM, Kevin Audleman
> <kevin.audle...@
across the relationship?
Cheers,
Kevin
On Feb 6, 9:46 am, Alex Gaynor <alex.gay...@gmail.com> wrote:
> On Fri, Feb 6, 2009 at 12:43 PM, Kevin Audleman
> <kevin.audle...@gmail.com>wrote:
>
>
>
>
>
> > I'm building a simple time tracker. It has a
where I have the ability to
auto-populate fields on creation through relationships, but django is
a new world unto me.
Thanks for your help,
Kevin Audleman
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django
I found the solution in the archives: I changed DATABASE_HOST to
127.0.0.1 from ''
Kevin
On Feb 4, 9:41 am, Kevin Audleman <kevin.audle...@gmail.com> wrote:
> Hello everyone,
>
> I am running through the tutorial and setting up my first django
> project. Quite exciting!
Hello everyone,
I am running through the tutorial and setting up my first django
project. Quite exciting! However I have run into trouble connecting to
MySQL. My settings.py file looks like this:
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2',
'postgresql', 'mysql', 'sqlite3' or
44 matches
Mail list logo