Re: Using the Django Admin to change a password.

2011-05-06 Thread Aaron Fay
I was getting this error also, the tickets suggested I had a custom User proxy model or something, when in fact I didn't. What I _had_ done was commented out the admin.autodiscover() in my urls and manually registered the django.contrib.auth.models.User model manually. Using

Re: newbie: Filter an inclusion tag

2008-06-16 Thread Aaron Fay
Hello, Filter it in your inclusion template, for instance if your tag returns a result from your auction object: def il8n_attr(context, arg, arg2, lang_code): # do you processing return {'result': my_result} register.inclusion_tag('il8n-inclusion.html', takes_context=True)(il8n_attr)

Re: Newbie FileField/ImageField Problems

2008-06-11 Thread Aaron Fay
Hi Brian, Something like this should work for you: if form.is_valid(): photo = Photo() photo.save_source_file(form.cleaned_data['source'].filename, form.cleaned_data['source'].content) # redirect/etc Hth, Aaron brianmac wrote: > For the life of me I can't get django to upload a

Re: {{ media_url }}

2008-06-05 Thread Aaron Fay
Hi Bobby, If you are referring to the media url that should be available via the context processor, then the variable in your template should be: {{ MEDIA_URL }} Unless you specifically are defining 'media_url' in your view. Hth, Aaron Bobby Roberts wrote: > i've got two templates in the

Re: why so slow?

2008-06-03 Thread Aaron Fay
If it makes any difference to you at this point: I run django-nfa on a intel 825 dual core with 2GB of ram, eclipse, and a multitude of other apps running, and django dev server reloads my applications about as fast as I can change from the ide to the browser. My other developer, on the

Re: Building filter strings dynamically

2008-05-09 Thread Aaron Fay
Similarly, this will work also: field = 'sections' qry = qry.filter(**{field+'__name__exact': 'shooting'}) Cheers, Aaron John Lenton wrote: On Fri, May 9, 2008 at 6:19 PM, Greg Fuller <[EMAIL PROTECTED]> wrote: Hello, I'm trying to build filter strings dynamically. The

Re: mod_python error

2008-04-18 Thread Aaron Fay
You could have also used: urlpatterns = patterns('', (r'^$', 'qsm.recs.views.matrix'), (r'^users/', include('qsm.recs.urls')), because (as you know now) the python path was looking up to your project directory, but not as far as your application directory... Aaron bcurtu wrote:

Re: wordpress hooks and actions system in django?

2008-02-23 Thread Aaron Fay
I thought I would chime in here as well, having a good deal of code written for WordPress, and now some experience with Django. I had originally contemplated the same idea, create a plugin system like that of WP until I started to understand the power of applications. In my mind it would be a

Re: Displaying the id in admin

2008-02-11 Thread Aaron Fay
Hi Tom, In some places I *believe* object_id gave me results in my own templates. The next option is to try to access the context, but I believe you may have to write a template tag to use it (not totally sure). Here's an example I used: ### //test/templatetags/my_tags.py from

Re: newforms-admin inlines question

2008-02-11 Thread Aaron Fay
Hey guys, Thanks for the replies.  Part of the issue I was having is I had the extras keyword in the wrong subclass (I had it in the options class for my model, instead of the inline class).  It appears the functionality is working as it should be for now... Cheers, Aaron Brian Rosner

newforms-admin inlines question

2008-02-10 Thread Aaron Fay
Hi List, I am using newforms admin and have a custom UserProfile model set in my inlines for my User, is there a way to limit the UserProfile to 1 for the User? Right now it's trying to offer 4 profiles for the user, and 'extras=1' doesn't seem to affect how many are displayed (I don't want

Re: using mod_python to host several django apps on the same vhost?

2008-02-08 Thread Aaron Fay
Hey Charles, I believe you will find that answer specifically here: http://www.djangobook.com/en/1.0/chapter20/ "If you need to put two Django installations within the same VirtualHost, you’ll need to take a special precaution to ensure mod_python’s code cache doesn’t mess things up. Use

Re: Strange issue with too many Foriegn Keys

2008-02-06 Thread Aaron Fay
Hey Michael, I ran across this article a couple days ago that seems to have a workaround to your problem: http://scottbarnham.com/blog/2007/08/22/edit-inline-with-imagefield-or-filefield-in-django-admin/ Hope that helps, Aaron Michael Newman wrote: > I am trying this new way of inheriting a

Re: Setting up Apache & mod_python on my development computer

2008-02-06 Thread Aaron Fay
Brandon, I just realized also, from your original error: EnvironmentError: Could not import settings 'testproject.settings' (Is it on sys.path? Does it have syntax errors?): No module named testproject.settings. Does it have syntax errors? Aaron Aaron Fay wrote: Hey Brandon, Here's

Re: Setting up Apache & mod_python on my development computer

2008-02-06 Thread Aaron Fay
Hey Brandon, Here's my exact setup:               SetHandler python-program         PythonPath "['C:\django'] + sys.path"         PythonHandler django.core.handlers.modpython         SetEnv DJANGO_SETTINGS_MODULE testproject.settings         PythonDebug On                  

Re: Setting up Apache & mod_python on my development computer

2008-02-06 Thread Aaron Fay
Hey Brandon, I have mine working on the same rig as you (looks like). Here's a shot in the dark: # << add forward slash SetHandler python-program PythonPath "['C:/django_projects/'] + sys.path" # << remove 'testproject' PythonHandler django.core.handlers.modpython SetEnv

Insert relational record

2008-02-05 Thread Aaron Fay
Hi List, First off, Django is wonderful :) Okay, I'm overriding a save method on a model, and need to jack into another model to add an entry into the db. Now if it was as simple as User, I could just create a new user, right? But the problem is I need to create an entry in a table that is

Override admin filters

2008-02-04 Thread Aaron Fay
Hi list, I'm wondering if there is a way to override the filters and and list_display on the built-in users view/model in the django admin. I would like to be able to filter/sort by group if possible. Thanks in advance, Aaron --~--~-~--~~~---~--~~ You

Re: Template tag arguments

2008-02-04 Thread Aaron Fay
Thanks for the replies fellas... I got around it for the time being by using context['object_id'] in my node class and it worked, but I'll rewrite it to use the resolver method... Thanks for the tip, Aaron Steven Armstrong wrote: Aaron Fay wrote on 02/04/08 21:21: Hi list, I

Template tag arguments

2008-02-04 Thread Aaron Fay
Hi list, I have a custom template tag that is supposed to take an argument from the template kinda like this: {% profile_user_id object_id %}, problem is 'object_id' is literally showing up as 'object_id' and not 5 or whatever it's supposed to be. I think the issue is I'm working within the

Accessing user variable in edit user form

2008-02-04 Thread Aaron Fay
Hi list, Stuck again :P  I have a couple questions: I'm trying to create a link in the {% block form_top %} of an admin template to link to the profile of the current user I'm editing but {{ user.id }} always gives me the id of the user logged in (me).  Does this form use a request object

Re: Extend single admin template

2008-02-03 Thread Aaron Fay
Fixed my own problem :P turns out it was user error (go figure...) /templates/admin/auth/user/change_form.html did the trick... Thanks anyway :) Aaron   Aaron Fay wrote: Hi list, I have successfully extended a custom model's template following the instructions in the djangobook, but I

Extend single admin template

2008-02-03 Thread Aaron Fay
Hi list, I have successfully extended a custom model's template following the instructions in the djangobook, but I tried to do the same with a built-in template (edit user form) by adding {% extends "admin/change_form.html" %} {% block form_top %}   Edit this user's profile {% endblock

Re: Conditional admin template inheritance

2008-02-01 Thread Aaron Fay
Hi again, Found the answer in the documentation (right in front of my face...) Aaron Aaron Fay wrote: > Hi List :) > > I want to be able to include some javascript on a specific automated > admin page, is there a way to just include my custom template block if > I'm editing a

Re: Complex relationship for user profile

2008-02-01 Thread Aaron Fay
Hi Peter, I did a little more digging, and I'm not sure if my answer is in option 1 or 2... I am just using the automatic admin interface for my model at this point, with Django configured to use AUTH_PROFILE_MODULE = 'myapp.myuserprofile'.  Is it safe to assume either model is saved first,

Conditional admin template inheritance

2008-02-01 Thread Aaron Fay
Hi List :) I want to be able to include some javascript on a specific automated admin page, is there a way to just include my custom template block if I'm editing a specific model? I really like the automated admin forms, but it may be that I just have to sit down and write custom

Re: Complex relationship for user profile

2008-02-01 Thread Aaron Fay
I'll try those, Peter, thanks for the response... Aaron Peter Rowell wrote: Failing a response to that one must mean I'm asking for something that is undoable. Uh, this isn't McDonald's. Slow/no response does not immediately equate to undoable. It more likely means that

Re: Complex relationship for user profile

2008-02-01 Thread Aaron Fay
as well? Can you extend the form handler for an admin page? Thanks again, Aaron Aaron Fay wrote: > Hi list! (first post) > > I've created a small application to suit a new project I am working on, > however I have a question regarding using the user profile feature. I > have th

Complex relationship for user profile

2008-01-31 Thread Aaron Fay
Hi list! (first post) I've created a small application to suit a new project I am working on, however I have a question regarding using the user profile feature. I have the setup working properly according to the documentation and it works, what I need to know is if I can create a field in

problem with database

2007-07-01 Thread fay
hi my db is sqlite3 when i use admin , i shows me the tables but i can't do anything with them : Database error Something's wrong with your database installation. Make sure the appropriate database tables have been created, and make sure the database is readable by the appropriate user. what's

Re: Inconsistent SQL generated for ForeignKey fields

2007-05-23 Thread Fay
Forgot to mention, I use MySQL 5.1. On May 23, 4:29 pm, Fay <[EMAIL PROTECTED]> wrote: > Hi, > > I encountered a situation that foreign key constraints were generated > differently for the same data model. > > Below is my test model that has 2 identical sets of 1-to-m

Inconsistent SQL generated for ForeignKey fields

2007-05-23 Thread Fay
Hi, I encountered a situation that foreign key constraints were generated differently for the same data model. Below is my test model that has 2 identical sets of 1-to-many tables. When I run django sqlall command, however the foreign key constraints were built differently, one used column

How to define unsigned integer primary keys with auto increment for MySQL

2007-05-22 Thread Fay
I'm using MySQL. The primary key field generated by django uses integer, not unsigned. I'd like to us unsigned integer instead. I can explicitly specify PositiveIntegerField with primary_key option, but that doesn't seem to give me auto increment. Any ideas? Thanks.