Error in django.contrib.comments with {% comment_form_target %}

2008-10-21 Thread Brandon Taylor
Hi everyone, I'm using Django 1.0 and I'm attempting to add comments to a blog, following along in the "Practical Django Projects" book. The error is: Reverse for '' with arguments '()' and keyword arguments '{}' not found. when {% comment_form_target %} is present in the template. 'django.con

Reverse error in contrib.comments

2008-10-21 Thread Brandon Taylor
Hi everyone, I'm using Django 1.0 and I'm attempting to add comments to a blog, following along in the "Practical Django Projects" book. The error is: Reverse for '' with arguments '()' and keyword arguments '{}' not found. when {% comment_form_target %} is present in the template. 'django.con

Re: Reverse error in contrib.comments

2008-10-22 Thread Brandon Taylor
svn because of .pyc files. After deleting the folder, comments are working correctly again. Hope this helps someone out! Kind regards, Brandon On Oct 22, 6:10 am, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 22, 2008 at 12:30 PM, Brandon Taylor > > <[

Re: Error in django.contrib.comments with {% comment_form_target %}

2008-10-22 Thread Brandon Taylor
Hi Dmitry, After some digging, I found that folder as well. Now everything's working correctly again. Cпасибо, Brandon On Oct 22, 7:08 am, Dmitry Dzhus <[EMAIL PROTECTED]> wrote: > Brandon Taylor wrote: > > I see there is an closed ticket:http://code.djangoproject.com/tic

django.contrib.comments and returning to the original object

2008-10-23 Thread Brandon Taylor
Hi everyone, I'm using 1.0 and have added contrib.comments to my project which has a blog. I can preview a comment just fine, but I would like to provide a way for the user to get back to the original blog entry once they've posted their comment. Out of the box, comments get redirected after bei

Re: django.contrib.comments and returning to the original object

2008-10-23 Thread Brandon Taylor
Found the solution. I can pass in: request.GET, which contains a QueryDict object containing the 'c' variable for the comment. Hope this helps someone! Brandon On Oct 23, 8:50 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm using 1.0 and hav

Problem with contrib.comments and signals: instance is not defined

2008-10-23 Thread Brandon Taylor
Hi everyone, I'm using Django 1.0, and attempting to do some comment moderation with Akismet. When I try to wire up a pre_save signal, I'm getting an error saying 'instance' is not defined. Here is my code: def moderate_comment(sender, **kwargs): if not instance.id: # <-- instance is not de

Where can I download xgettext?

2008-11-05 Thread Brandon Taylor
Hi everyone, I'm needing to do some internationalization, but can't run makemessages because I don't have xgettext. I'm running Mac OS X 10.5, and can't seem to find an installer anywhere for this. I have found gettext, but not xgettext. Any help appreciated! Brandon --~--~-~--~~

Re: Where can I download xgettext?

2008-11-05 Thread Brandon Taylor
I was not able to successfully compile the latest version of the GNU gettext tools (0.17) on OS X 10.5, but I was able to grab version 0.14.5-3 using Fink and now I can successfully run django-admin.py makemessages. Hope this helps someone! On Nov 5, 11:43 pm, Brandon Taylor <[EMAIL PROTEC

i18n strategy

2008-11-06 Thread Brandon Taylor
Hi everyone, I'm tasked with translating a mostly database-driven site into Spanish. I'm familiar with how to use Django's internationalization on static strings in templates, but not with text coming from a database, so I'm looking for some best practices advice... Should I: 1. Make a separate

Having trouble with django-multilingual

2008-11-06 Thread Brandon Taylor
Hi Everyone, I'm having a hard time getting django-multilingual to work the way I expect. #settings.py LANGUAGES = ( ('en', 'English'), ('es', 'Spanish'), ) TEMPLATE_CONTEXT_PROCESSORS = ( ... 'multilingual.context_processors.multilingual', ) MIDDLEWARE_CLASSES = ( ..

Re: Interesting result when displaying errors for contrib.auth.forms AuthenticationForm

2008-11-09 Thread Brandon Taylor
%} On Nov 9, 12:01 pm, "Alex Koshelev" <[EMAIL PROTECTED]> wrote: > Please show complete template code > > On Sun, Nov 9, 2008 at 20:55, Brandon

Interesting result when displaying errors for contrib.auth.forms AuthenticationForm

2008-11-09 Thread Brandon Taylor
Hi everyone, I'm leveraging auth and have a login form that uses contrib.auth.forms AuthenticationForm. When displaying non-field-specific errors, I get interesting results: #template.html # if form.errors __all__ Please enter a correct username and password. Note that both fields are case

Re: Interesting result when displaying errors for contrib.auth.forms AuthenticationForm

2008-11-09 Thread Brandon Taylor
s` just holds all form errors as a dict. > > On Mon, Nov 10, 2008 at 00:52, Brandon Taylor <[EMAIL PROTECTED]>wrote: > > > > > Here you go: > > > > method="post">

Problem with named URL and parameters

2008-11-12 Thread Brandon Taylor
Hi everyone, So I have a question/problem with a named URL pattern... #urls.py url(r'^resources/conversions/(?P[-\w]+)/$', 'my_site.views.conversions', name='conversions'), This is a mostly static site, but I would like to be able to pass the "conversion_template" parameter to do a dynamic incl

Re: Problem with named URL and parameters

2008-11-12 Thread Brandon Taylor
<[EMAIL PROTECTED]> wrote: > On Wed, 2008-11-12 at 22:39 -0500, Karen Tracey wrote: > > On Wed, Nov 12, 2008 at 10:27 PM, Brandon Taylor > > <[EMAIL PROTECTED]> wrote: > > >         Hi everyone, > > >         So I have a question/problem with a na

Re: Problem with named URL and parameters

2008-11-13 Thread Brandon Taylor
gt; On Thu, Nov 13, 2008 at 02:56:26PM +1100, Malcolm Tredinnick wrote: > > On Wed, 2008-11-12 at 22:39 -0500, Karen Tracey wrote: > > > On Wed, Nov 12, 2008 at 10:27 PM, Brandon Taylor > > > <[EMAIL PROTECTED]> wrote: > > > > Hi everyone, > > >

Re: Problem with named URL and parameters

2008-11-13 Thread Brandon Taylor
Hi everyone, Gerard's suggestion worked. Moving the pattern into a separate definition fixed it. But, I couldn't explain why :) Many thanks! Brandon On Nov 13, 6:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-11-14 at 01:20 +0300, Alex Koshelev wrote: > > Hmm... Why in temp

Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
Hi everyone, I'm doing an internationalization project and have a form with fields that need to be localized. I would like to have one form, pass in the language code and exclude the appropriate fields. How would I go about passing in the variable to the form? I know I have to pick it up in the

Re: Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
ECTED]> wrote: > On Thu, 2008-11-13 at 18:06 -0800, Brandon Taylor wrote: > > Hi everyone, > > > I'm doing an internationalization project and have a form with fields > > that need to be localized. I would like to have one form, pass in the > > language code a

Re: Exclude fields in form by language

2008-11-13 Thread Brandon Taylor
Thanks Malcom, I'll give that a shot. Cheers, Brandon On Nov 13, 10:47 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-11-13 at 20:36 -0800, Brandon Taylor wrote: > > Hi Malcom, > > > This is what I have so far, but is not working

Re: Exclude fields in form by language

2008-11-14 Thread Brandon Taylor
problem I have now is accessing that parameter in the Meta subclass: class Meta: self.language_code#returns: self is not defined. Do you know how I can access that self.language_code parameter in the Meta subclass? TIA, Brandon On Nov 13, 11:11 pm, Brandon Taylor <[EMAIL PROTEC

Re: Exclude fields in form by language

2008-11-14 Thread Brandon Taylor
__. Thanks for your help, I really appreciate it. b On Nov 14, 7:34 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Fri, 2008-11-14 at 10:44 -0800, Brandon Taylor wrote: > > Hi Malcom, > > > So, I manged to pass in the language_code parameter successfully: >

Populating form from instance not working

2008-12-04 Thread Brandon Taylor
Hi everyone, I'm using 1.0.2 final. I have a form for a model and am passing in an instance of my model object to the form, but the form is not being populated. #views.py example def my_view(request, id): if request.method == 'POST': pass else: model_instance = my_model.

Re: Populating form from instance not working

2008-12-05 Thread Brandon Taylor
Hi David, Stupid error on my part. Problem has been resolved. On Dec 5, 1:34 am, "David Zhou" <[EMAIL PROTECTED]> wrote: > On Fri, Dec 5, 2008 at 1:44 AM, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > But, the form fields aren't being populated. What am

UserChangeForm not working

2008-12-05 Thread Brandon Taylor
Hi everyone, I want to allow users to change their username in a non-admin form. I have a login form already working, and I can successfully show user information. I have granted the change user permission to the user that is logged in. When I pull in the UserChangeForm from contrib.auth.forms a

Re: UserChangeForm not working

2008-12-05 Thread Brandon Taylor
Hi Karen, I did finally get this figured out, but decided not to implement the functionality after all :) Thanks, Brandon On Dec 5, 7:47 am, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Fri, Dec 5, 2008 at 3:18 AM, Brandon Taylor <[EMAIL PROTECTED]>wrote: > >

Help with batch processing

2008-12-19 Thread Brandon Taylor
Hi everyone, My client needs some batch processing capabilities that I haven't coded in Python/Django yet, and I need advice on the best way to read images contained in a .zip file. I'm pretty comfortable extending Django admin, just not working with files this way. I will need to: 1. Read and

Re: Help with batch processing

2008-12-19 Thread Brandon Taylor
I've been looking at the methods from those libs. Glad to know I'm on the right track. Thanks, b On Dec 19, 7:27 pm, Masklinn wrote: > On 19 déc. 08, at 23:50, Brandon Taylor   > wrote: > > > Hi everyone, > > > My client needs some batch processing capabi

Re: image uploading, validation by using form

2008-12-20 Thread Brandon Taylor
Hi, You can do validation on images by using a custom form for your admin Model. This example validates that a thumbnail image is a specific dimension, file type and file size, from django.core.files.images import get_image_dimensions class MyModelAdminForm(forms.ModelForm): model = MyModel

Need help writing file to specific directory

2008-12-20 Thread Brandon Taylor
Hi everyone, I'm unpacking files in a .zip and need to save each file into a particular directory, but I can't seem to find a way to set the directory to save into. Here is part of my code where I'm opening the .zip and iterating over the files: thumb_zip_file = zipfile.ZipFile(obj.thumbnail_ima

Re: Need help writing file to specific directory

2008-12-20 Thread Brandon Taylor
solved: os.chdir(path) Hope that helps someone! On Dec 20, 10:13 pm, Brandon Taylor wrote: > Hi everyone, > > I'm unpacking files in a .zip and need to save each file into a > particular directory, but I can't seem to find a way to set the > directory to save into

Login form on every page and session weirdness

2009-01-13 Thread Brandon Taylor
Hi everyone, I have a login form on every page and want to leverage the AuthenticationForm from contrib.auth. So, I thought I would have a middleware tier to process the request and check for a GET or POST and create the appropriate form, either bound or un-bound. Here is my middleware: from dja

Re: Login form on every page and session weirdness

2009-01-13 Thread Brandon Taylor
into pickling errors. On Jan 13, 11:43 am, Brandon Taylor wrote: > Hi everyone, > > I have a login form on every page and want to leverage the > AuthenticationForm from contrib.auth. So, I thought I would have a > middleware tier to process the request and check for a GET or POST and >

Dynamic upload_to for ImageField in newforms admin?

2008-07-16 Thread Brandon Taylor
Hi everyone, I'm following this tutorial for specifying a dynamic "upload_to" attribute: http://scottbarnham.com/blog/2007/07/31/uploading-images-to-a-dynamic-path-with-django/ But, it doesn't seem to want to work with Django admin. Does anyone have any experience tweeking this custom class to

Custom permission problem in newforms-admin

2008-07-21 Thread Brandon Taylor
Hi everyone, I'm trying to enforce a customer permission on Add/Update. In my model, I have defined the permission: permissions = ( ('can_approve_stories','Can Approve Stories'), ) in my model.ModelAdmin I have: def change_view(self, request, obj_id): i

Re: Custom permission problem in newforms-admin

2008-07-23 Thread Brandon Taylor
g where I should try to disable the field? In the model, or in the change_form? I'm not very experienced in customizing the admin, but am very eager to learn. Kind regards, Brandon On Jul 21, 5:50 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-07-21 at 15:46 -0700,

Pre-populating an integer field with a count of model objects

2008-08-21 Thread Brandon Taylor
Hi everyone, I have a column, 'position', which is a PositiveIntegerField, to allow my end-user to order records with. I would like to pre-populate the field when creating a new record, with the count of the model objects + 1. The models documentation says 'default' can be a value or a callable,

Re: Pre-populating an integer field with a count of model objects

2008-08-21 Thread Brandon Taylor
Hi Daniel, Thanks for the reply. I'll just go with overriding the save. Cheers, Brandon On Aug 21, 11:29 am, Daniel Roseman <[EMAIL PROTECTED]> wrote: > On Aug 21, 4:42 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > I

USStateField has gone missing

2008-09-04 Thread Brandon Taylor
Hello everyone, Is anyone else missing USStateField? None of my models that use this field are validating. I've tried trunk and the 1.0 official release I get the same error on both versions. If you look in django > db > models > fields > __init__.py You will not find USStateField, although it'

Re: USStateField has gone missing

2008-09-04 Thread Brandon Taylor
My bad. I see it's not in the latest version of the documentation : http://docs.djangoproject.com/en/dev/ref/models/fields/#model-field-types I guess we can just make a list of static choices using the states list in localflavor.us On Sep 4, 8:23 pm, Brandon Taylor <[EMAIL PROTECTED

Re: USStateField has gone missing

2008-09-04 Thread Brandon Taylor
Thanks everyone. I guess I just overlooked the localflavor documentation. Kind regards, Brandon On Sep 4, 8:30 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-09-04 at 18:23 -0700, Brandon Taylor wrote: > > Hello everyone, > > > Is anyone else missing

Re: USStateField has gone missing

2008-09-04 Thread Brandon Taylor
ep 4, 8:34 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Thanks everyone. I guess I just overlooked the localflavor > documentation. > > Kind regards, > Brandon > > On Sep 4, 8:30 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> > wrote: > > > On Thu, 2008-

Re: USStateField has gone missing

2008-09-04 Thread Brandon Taylor
Thanks Malcom, I apperciate it! On Sep 4, 8:49 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Thu, 2008-09-04 at 18:46 -0700, Brandon Taylor wrote: > > So, next stupid question :) > > > These fields all derive from forms, not models. > &g

Integrity Error (1062, "Duplicate entry '0' for key 1") ???

2008-09-14 Thread Brandon Taylor
Hi everyone, I'm using 1.0 Final, MySQL 5, and I'm getting this lovely error for the first time. Here is my model: from django.db import models from django.contrib import admin from crider_law.sidebar_modules.models import SidebarModule class Page(models.Model): name = models.CharField(max_

Re: Integrity Error (1062, "Duplicate entry '0' for key 1") ???

2008-09-14 Thread Brandon Taylor
Well, after validating, syncing, re-validating and re-syncing, I ended up just dropping the entire database and now it works fine. On Sep 14, 10:10 am, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm using 1.0 Final, MySQL 5, and I'm getting this lov

Problem with named paths

2008-09-17 Thread Brandon Taylor
Hello everyone, I'm using named paths as such: url(r'^[-\w]+/(?P[-\w]+)/$', 'render_page', name='nested_page_link'), url(r'^(?P[-\w]+)/$', 'render_page', name='page_link'), The only difference between these two urls is that some pages in this site can be nested under another page. So, I would l

Re: Problem with named paths

2008-09-17 Thread Brandon Taylor
PROTECTED]> wrote: > Brandon Taylor wrote: > > Hello everyone, > > > I'm using named paths as such: > > > url(r'^[-\w]+/(?P[-\w]+)/$', 'render_page', > > name='nested_page_link'), > > url(r'^(?P[-\w]+)/$', 'render_

Filtering a queryset with arrays of IDs

2008-09-28 Thread Brandon Taylor
Hi everyone, I have a search form where I have multi-selects that contain foreign key values. When I post to my results page, I get a QueryDict object and can get the data out of the post into lists. My question is, what's the best way to go about filtering objects where the foreign keys are arr

Best way to preserve a queryset across GETs?

2008-09-28 Thread Brandon Taylor
Hi everyone, I have a search results page and need to be able to go to a detail page for any result. I would like to provide the user a way to return to their search results and not clutter the querystring with search parameters. What's the best approach for this using Django? Should I stuff the

A little refactoring help please

2008-10-01 Thread Brandon Taylor
Hi everyone, I have a view to do some re-ordering of a list via ajax: @staff_member_required def reorder(request): collections = Collection.objects.all() if request.method == 'POST': pk_ids = request.POST['pk_ids'].split(',') length = len(pk_ids) for collection

Re: A little refactoring help please

2008-10-02 Thread Brandon Taylor
Thanks guys, I appreciate it. On Oct 2, 3:29 am, bruno desthuilliers <[EMAIL PROTECTED]> wrote: > On 2 oct, 07:33, Travis Parker <[EMAIL PROTECTED]> wrote: > > > Instead of calling render_to_response on an empty template file you > > could simply return an empty django.http.HttpResponse and avoid

Django Admin, Custom Views and the ChangeList object

2008-10-07 Thread Brandon Taylor
Hi everyone, On a recent project, I was tasked with adding a workflow around a model, which required some customization in the admin. I found that when I did and override of a view, I no longer had access to the "cl", or ChangeList object containing all of the objects for the view. Filters and o

Re: Django Hosting Survey

2008-10-07 Thread Brandon Taylor
WebFaction definitely gets my vote. Setting up a Django app with their control panel couldn't be easier, and their customer service is excellent. Brandon Taylor bTaylor Design www.btaylordesign.com On Oct 6, 12:30 pm, Jeff <[EMAIL PROTECTED]> wrote: > I am about to begin a new

Date-based generic views and 404 errors

2008-10-07 Thread Brandon Taylor
Hi everyone, I'm following along with the Blog example in the Practical Django Projects book. Here are my URLs: entry_info_dict = { 'queryset' : Entry.live.all(), 'date_field' : 'pub_date' } urlpatterns = patterns('django.views.generic.date_based', url(r'^blog/$', 'archive_index', e

Re: Django Admin, Custom Views and the ChangeList object

2008-10-07 Thread Brandon Taylor
Thanks Karen! On Oct 7, 4:43 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Tue, Oct 7, 2008 at 2:43 PM, Brandon Taylor <[EMAIL PROTECTED]>wrote: > > > > > > > Hi everyone, > > > On a recent project, I was tasked with adding a workflow a

generic.date_based.archive_year throws "invalid literal for int() with base 10: ''

2008-10-07 Thread Brandon Taylor
Hi everyone, Here is my code: entry_info_dict = { 'queryset' : Entry.live.all(), 'date_field' : 'pub_date', 'allow_future' : True } urlpatterns = patterns('django.views.generic.date_based', url(r'^blog/(?P)\d{4}/$', 'archive_year', entry_info_dict, name='archive_year'), ) So, w

Re: generic.date_based.archive_year throws "invalid literal for int() with base 10: ''

2008-10-07 Thread Brandon Taylor
nce it hits this function, year = u'' I'm using 1.0 Final, MySQL 5. Help! On Oct 7, 6:01 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > Here is my code: > > entry_info_dict = { >     'queryset' : Entry.live.all(), >    

Re: generic.date_based.archive_year throws "invalid literal for int() with base 10: ''

2008-10-07 Thread Brandon Taylor
Oh for $hit's sake - how can I be so blind?! Thanks Malcom, Brandon On Oct 7, 7:48 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-10-07 at 16:01 -0700, Brandon Taylor wrote: > > Hi everyone, > > > Here is my code: > > > entry_info_dict =

Problem generating permalink for date-based view

2008-10-07 Thread Brandon Taylor
Hi everyone, I'm using the generic date-based views. Here's a snippet of my "Entry" model for a blog: #models.py pub_date = models.DateTimeField(auto_now_add=True) @models.permalink def get_month_entries(self): return ('archive_month', (), { 'year' : self.pub_date.s

Re: Problem generating permalink for date-based view

2008-10-08 Thread Brandon Taylor
Using the following template tag resolved the issue: {% url archive_month obj.year obj|date:"b" %} On Oct 7, 9:04 pm, Brandon Taylor <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I'm using the generic date-based views. > > Here's a snippet of my

Re: Practical Django Projects source code

2008-10-08 Thread Brandon Taylor
Hi, Unfortunately the source code isn't available from the Apress site yet, and there's no mention of when it might be available either. I've been through all of the samples in that book, and they work, with a few tweeks for 1.0. You can download Coltrane from DjangoPlugables.com, but there are

ManyToManyField with extra content and Django admin

2008-10-15 Thread Brandon Taylor
Hi everyone, I'm using 1.0 final. I have the following models: Page SidebarModule PageSidebarModule (the intermediary table) When I have SidebarModule defined as a simple ManyToMany in Page, the admin is quite happy to display the list of choices. When I define: class Page(models.Model):

Re: ManyToManyField with extra content and Django admin

2008-10-15 Thread Brandon Taylor
It truly is the best web framework I've used in 12 years of development. Kind regards, Brandon On Oct 15, 11:25 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Wed, Oct 15, 2008 at 11:21 PM, Brandon Taylor > > <[EMAIL PROTECTED]> wrote: > > The admin n

Re: ManyToManyField with extra content and Django admin

2008-10-16 Thread Brandon Taylor
t;[EMAIL PROTECTED]> wrote: > On Wed, 2008-10-15 at 21:21 -0700, Brandon Taylor wrote: > > Hi everyone, > > Hi Brandon > > > I'm using 1.0 final. I have the following models: > > > Page > > SidebarModule > > PageSidebarModule (the intermediary table)

Need help changing the ordering of a queryset stored in session

2009-01-21 Thread Brandon Taylor
Hi everyone, I need to do some table sorting and paging. To reduce trips to the DB, I'm storing my initial queryset in a session using the file system backend for local development. I was thinking I might be able to use the dictsort filter and just pass in the column as a variable to do the colu

Re: Need help changing the ordering of a queryset stored in session

2009-01-22 Thread Brandon Taylor
...and do vehicles.reverse() to toggle ascending or descending. Thanks for getting me on the right track, I appreciate it! Brandon On Jan 22, 2:19 am, Malcolm Tredinnick wrote: > On Wed, 2009-01-21 at 21:40 -0800, Brandon Taylor wrote: > > Hi everyone, > > > I need to do some

Re: order by count

2009-01-29 Thread Brandon Taylor
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

Difficulty with filtering a queryset using the "in" method

2009-02-02 Thread Brandon Taylor
Hi everyone, I need to return a queryset using the "in" statement. My IDs are in an array of int values. vehicle_ids = [1, 2, 3] If I do: vehicles = VehiclePhoto.objects.filter(vehicle__id__in= [vehicle_ids]) I get a type error: sequence item 0, expected string, int found. I've tried just abou

Re: WYSIWYG Image upload challenge

2009-02-18 Thread Brandon Taylor
FWIW, I have been able to successfully integrate Django Admin Uploads http://code.google.com/p/django-admin-uploads/ with jQuery. I'm not certain as to how difficult this would be to port to YUI. There are a couple of JS issues that I've had to fix with this, but otherwise, it works very well. Re

Add value to request header?

2009-02-18 Thread Brandon Taylor
Hi everyone, I know how to modify a response header value, but not a request header value. I need to integrate with an external system that is injecting a value in the request header that I need to check for. Is it possible to mock this behavior in Django? I'm not very familiar with how these va

Connecting to Oracle

2009-02-20 Thread Brandon Taylor
Hi everyone, I'm having a hell of a time getting connected to Oracle... We're running Intel MacBooks, OS X 10.5.6, Python 2.6.1, Django Trunk, Oracle InstantClient 10_2. We have tried using cx_Oracle-5.0 and 4.4.1. cx_Oracle seems to compile and install successfully, but, when we attempt to run

Re: Add value to request header?

2009-02-20 Thread Brandon Taylor
Hi Malcom, Thanks for the response. I thought the same about the request headers being read only, and hadn't heard of something modifying the request header, only the response. b On Feb 18, 5:02 pm, Malcolm Tredinnick wrote: > On Wed, 2009-02-18 at 07:16 -0800, Brandon Taylor wrote

Oracle connection issue

2009-02-20 Thread Brandon Taylor
Hi everyone, I'm using Oracle instantclient_10_2 (Intel), cx_Oracle-5.0.1, OS X 10.5.6 (Intel), Python 2.6.1 and Django trunk. My built-in server will start up correct, but, when I attempt to get objects for a model, I receive the following error: InterfaceError: Unable to acquire Oracle enviro

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
ng "manage.py shell" and > looking at what's in os.environ--if you don't see ORACLE_HOME set to > the correct location there, try fixing that first. > > Matt > > On Fri, Feb 20, 2009 at 9:41 AM, Brandon Taylor > wrote: > > > Hi everyone, > > &

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
_NAME setting. If I set my DATABASE_NAME to my SID, and try to retrieve objects, I get: DatabaseError: ORA-00942: table or view does not exist ? ? ? b On Feb 20, 1:21 pm, Brandon Taylor wrote: > Hi Matt, > > Ok, I modified manage.py to add two environ variables: > > import os >

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
se credentials.  If the tables live in a > different schema, you may need to create private synonyms to them in > the Django user's schema--we nearly always end up with that structure > in our Django/Oracle apps. > > Hope this helps, > > Matt > > On Fri, Feb 20, 200

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
;test.html', {'categories' ; categories}) I get: DatabaseError: ORA-00942: table or view does not exist ? ? ? On Feb 20, 2:53 pm, Brandon Taylor wrote: > Hi Matt, > > Thanks for the reply. Well, I can get connected via sqlplus and I can: > desc activities... not sure what'

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
Ok, now I am absolutely confounded... I ran: manage.py inspectdb > models.py Then I tried to get objects from the models THAT IT CREATED FOR ME - same friggin' error! What in the world is up with this thing? I'm at a loss. b On Feb 20, 3:08 pm, Brandon Taylor wrote: > Hi

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
ROM "CATEGORIES") "_SUB" WHERE ROWNUM <= 21) WHERE "_RN" > 0'}, {'time': '0.004', 'sql': u'SELECT "CATEGORIES"."ID", "CATEGORIES"."NAME", "CATEGORIES"."CREATED_AT",

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
activity_code.categories; > And repeat for the relevant tables, views, or sequences. > > This is particularly problematic for Oracle, which nearly always uses > multiple schemas and specific permission grants in Real World (tm) > schemas.  We tried a couple quick, Oracle-specific fixes

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
: categories}) On Feb 20, 3:34 pm, Ian Kelly wrote: > On Feb 20, 2:25 pm, Brandon Taylor wrote: > > > however attempting to retrieve the Category objects from a view > > results in: > > DatabaseError: ORA-00942: table or view does not exist > > > Thoughts? &

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
value in the connection: USER=root When I start up my dev server, I usually override port 80 on my Mac, so I can just run at : localhost/ Shouldn't the USER parameter be the DATABASE_USER from settings.py? or am I smoking crack? b On Feb 20, 4:01 pm, Brandon Taylor wrote: > Actually I

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
ld be nice if I could just use the built-in server though. On Feb 20, 4:20 pm, Ian Kelly wrote: > On Feb 20, 3:01 pm, Brandon Taylor wrote: > > > Actually I was referring to my action in views.py to get the Category > > objects: > > > from activity_codes.models import *

Re: Oracle connection issue

2009-02-20 Thread Brandon Taylor
come up with a solution. Many thanks to everyone for their help! b On Feb 20, 4:37 pm, Ian Kelly wrote: > On Feb 20, 3:26 pm, Brandon Taylor wrote: > > > Yes, I'm just using the built-in server for local development. I've > > restarted it dozens of times, cleared m

Table or view does not exist - Oracle

2009-02-23 Thread Brandon Taylor
Hi everyone, Still fighting with Oracle :( Quick recap...my setup is: OS X 10.5.6 (Intel), cx_Oracle-5.0.1 (Intel), instantclient_10_2, Django Trunk, Python 2.6.1 If I run Django in shell, I am able to connect to Oracle, retrieve objects via the ORM, etc. However, when I executing a view acti

Re: Oracle connection issue

2009-02-23 Thread Brandon Taylor
20 Feb 14:43, Brandon Taylor wrote: > > > > > No proxy server configured in FireFox 3. I'm stumped as well. Guess I > > need to have the Oracle people in my office get in touch with their > > support people. There is one other Django person here at the > &

ModelChoiceField and initial value

2009-02-23 Thread Brandon Taylor
Hi everyone, What's the trick to getting a ModelChoiceField to use the first object in a QuerySet as the initial value to get rid of -? If I do: qs = Model.objects.all() my_field = forms.ModelChoiceField(queryset=qs, initial=qs[0]) I still get -- as the first choice. TIA, Bran

Re: ModelChoiceField and initial value

2009-02-23 Thread Brandon Taylor
Solved: ModelChoiceField(empty_label=None) On Feb 23, 9:14 pm, Brandon Taylor wrote: > Hi everyone, > > What's the trick to getting a ModelChoiceField to use the first object > in a QuerySet as the initial value to get rid of -? > > If I do: > qs = Mode

Re: Table or view does not exist - Oracle

2009-02-24 Thread Brandon Taylor
Hi Karen, Yes, that is exactly what I'm seeing. On Feb 23, 6:02 pm, Karen Tracey wrote: > On Mon, Feb 23, 2009 at 10:15 AM, Brandon Taylor > wrote: > > > > > > > Hi everyone, > > > Still fighting with Oracle :( > > > Quick recap...my setup is:

Environment variable not set

2009-02-24 Thread Brandon Taylor
Hi everyone, Still battling with Oracle, but found something interesting... When connecting to Oracle with Django through a shell, everything works as expected. However, when I use Aptana/PyDev to debug and I set a breakpoint on my view action, I get an error: InterfaceError: Unable to acquire

Re: Environment variable not set

2009-02-24 Thread Brandon Taylor
Matt Boersma wrote: > On Tue, Feb 24, 2009 at 12:44 PM, Brandon Taylor > > wrote: > > When connecting to Oracle with Django through a shell, everything > > works as expected. However, when I use Aptana/PyDev to debug... > > It sounds likely that debugging environmen

Re: Connecting to Oracle

2009-02-26 Thread Brandon Taylor
Hi Karen, 5.0.1 just came out a few days ago. Upgrading solved the issue and now I can get connected to Oracle. Woohoo. b On Feb 20, 11:44 am, Karen Tracey wrote: > On Fri, Feb 20, 2009 at 10:52 AM, Brandon Taylor > wrote: > > > > > > > Hi everyone, > > >

Anyone using FCKEditor?

2009-02-26 Thread Brandon Taylor
Hi everyone, I've had pretty good success with TinyMCE/django-admin-uploads so far, but FCKEditor is boasting Python integration. Sure would be nice to get built-in file handling support for Images, Flash, etc without having to integrate any other 3rd party apps. Has anyone been able to integrat

Trouble overriding UserAdmin

2009-03-03 Thread Brandon Taylor
Hi everyone, Not sure what's up here, the same code works on another site. Basically what I'm doing is adding an inline model form to the User change form... from django.db import models from django.contrib import admin from django.contrib.auth.models import User from django.contrib.auth.admin i

Re: Trouble overriding UserAdmin

2009-03-03 Thread Brandon Taylor
Hi Alex, Actually, the 'user_profile' app is the last one in my list. I can't explain why it works on a previously developed site using Django trunk and not this one. Brandon On Mar 3, 11:54 am, Alex Gaynor wrote: > On Tue, Mar 3, 2009 at 12:41 PM, Brandon Taylor > wr

Programmtically accessing properties on a model field?

2009-03-06 Thread Brandon Taylor
Hi everyone, I'm working on some code to scrub an images directory of anything not currently stored in the database, and would like to de-couple some things. I'm using signals, passing in an instance of a model that I would like to be able to grab some data from, namely, the 'upload_to' parameter

Re: Programmtically accessing properties on a model field?

2009-03-07 Thread Brandon Taylor
Wonderful! Thank you so much for the help. Brandon On Mar 6, 3:24 pm, Rajesh D wrote: > > I'm working on some code to scrub an images directory of anything not > > currently stored in the database, and would like to de-couple some > > things. I'm using signals, passing in an instance of a model

Trouble passing keyword arg to post_save signal

2009-03-07 Thread Brandon Taylor
Hi everyone, Syntax trouble. My post_save signal is defined as: def scrub_directory(sender, instance, **kwargs): pass When I attempt to pass a keyword arg to it: models.signals.post_save.connect(scrub_directory, sender=TheModel, {'my_kwarg' : 'some_value'}) I get a syntax error: keyword

Re: Trouble passing keyword arg to post_save signal

2009-03-07 Thread Brandon Taylor
7, 10:26 pm, Jacob Kaplan-Moss wrote: > On Sat, Mar 7, 2009 at 11:14 PM, Brandon Taylor > wrote: > > When I attempt to pass a keyword arg to it: > > > models.signals.post_save.connect(scrub_directory, sender=TheModel, > > {'my_kwarg' : 'some_value'

  1   2   3   >