Can't override the default form field for my custom Field type. Help?

2010-02-12 Thread Kevin Audleman
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:

Need help storing/retrieving values from a form.MultipleChoiceField

2010-02-11 Thread Kevin Audleman
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

Re: Error trying to add a new user in the admin site

2009-06-21 Thread Kevin Audleman
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

Error trying to add a new user in the admin site

2009-06-08 Thread 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:

Bug in admin related to django.root

2009-06-03 Thread Kevin Audleman
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

Re: Need help with URL rewrites

2009-06-01 Thread Kevin Audleman
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

Re: Need help with URL rewrites

2009-05-25 Thread Kevin Audleman
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

Need help with URL rewrites

2009-05-25 Thread Kevin Audleman
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

Re: User Profile in Admin

2009-05-01 Thread Kevin Audleman
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:

Re: url template tag help

2009-05-01 Thread Kevin Audleman
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

Re: url template tag help

2009-05-01 Thread Kevin Audleman
> 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

Re: Configuration help. Multiple projects.

2009-04-30 Thread Kevin Audleman
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

Re: url template tag help

2009-04-30 Thread Kevin Audleman
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

Re: Forms vs Formsets vs Sessions vs FormWizard ??

2009-04-29 Thread Kevin Audleman
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

Re: FileField uploading into an user-specific path

2009-04-29 Thread Kevin Audleman
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

Re: Dynamic form and template rendering

2009-04-29 Thread Kevin Audleman
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

Re: url template tag help

2009-04-29 Thread Kevin Audleman
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

Re: Can I use the django test server for this?

2009-04-21 Thread Kevin Audleman
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: > >

Can I use the django test server for this?

2009-04-21 Thread Kevin Audleman
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

Re: Searching a list of Q

2009-02-25 Thread Kevin Audleman
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? &

Re: Searching a list of Q

2009-02-25 Thread Kevin Audleman
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) > >

Re: optional parameter url

2009-02-25 Thread Kevin Audleman
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

Re: InlineModelAdmin objects question

2009-02-25 Thread Kevin Audleman
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

Re: Simplest way to do this?

2009-02-23 Thread Kevin Audleman
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

Simplest way to do this?

2009-02-23 Thread Kevin Audleman
. 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

Re: login in django via plone

2009-02-19 Thread Kevin Audleman
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

Re: Query that grabs objects before and after object

2009-02-18 Thread Kevin Audleman
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

Re: Any way to show progress during a short process job?

2009-02-18 Thread Kevin Audleman
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

Re: Extract values from form fields in templates

2009-02-18 Thread Kevin Audleman
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

Re: Access extra parameters in forms.py

2009-02-17 Thread Kevin Audleman
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

Re: Can I overwrite the ModelAdmin for User

2009-02-17 Thread Kevin Audleman
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

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
, 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

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
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

Re: Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
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

Can I overwrite the ModelAdmin for User

2009-02-16 Thread Kevin Audleman
] 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

Re: Trying to retrieve dynamically generated session key in template

2009-02-11 Thread Kevin Audleman
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

Re: How do I display the human readable name of a choice?

2009-02-11 Thread Kevin Audleman
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 > >

Re: How do I display the human readable name of a choice?

2009-02-10 Thread Kevin Audleman
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

How do I display the human readable name of a choice?

2009-02-10 Thread Kevin Audleman
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,

Re: Can I do this with django?

2009-02-06 Thread Kevin Audleman
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...@

Re: Can I do this with django?

2009-02-06 Thread Kevin Audleman
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

Can I do this with django?

2009-02-06 Thread Kevin Audleman
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

Re: Newbie question: first project can't connect to MySQL

2009-02-04 Thread Kevin Audleman
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!

Newbie question: first project can't connect to MySQL

2009-02-04 Thread Kevin Audleman
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