Re: Alphabetic filtering of Django Admin drop down menu

2010-12-08 Thread vjimw
Should your relationship be Many-to-Many I found this to be very helpful: Autocomplete manytomany widget for admin panel http://djangosnippets.org/snippets/1365/ On Dec 7, 1:29 pm, Heigler wrote: > If you can't use raw_id_fields i guess you should write that view and > use javascript to search i

Admin Inlines only show up after a browser refresh

2010-11-09 Thread vjimw
We have an odd situation where, for one of our model forms, the inlines do not regularly show up on the form page, but if you refresh the browser window, they will appear with the correct data. Has anyone else run into this before? I am not really sure how to debug it since it is not consistent. H

Re: Save_model versus model.save() and the order they are called.

2010-08-17 Thread vjimw
I remedied this problem by actually doing all of my work in the save_model() method. It has all the initial data set on the model which allowed me to check which values changed (date and/or user) and set audits as needed. On Aug 12, 4:06 pm, vjimw wrote: > We have a model object (Offer) wh

Re: Overriding ModelForm field's value in the admin changeview

2010-08-16 Thread vjimw
The form and object are combined when you call: response = super([YOURMODELFORMHERE], self).change_view(request, object_id, extra_context=my_context) You can see what the admin code for def change_view does in Django1.*/ django/contrib/admin/options.py I was looking at the same thing and found a

Save_model versus model.save() and the order they are called.

2010-08-12 Thread vjimw
We have a model object (Offer) which has a number of business rules. 1) On create, auto populate the created_by field with the request.user data 2) On modify, auto populate the last_edited_by field with the request.user data 3) If a date value change on modify, audit with the object, date and last_

Re: stream (large) files from the back-end via Django to the user?

2010-08-12 Thread vjimw
When we upload files to the CDN, we store that path with the object. Then we override the widget for the file so we can server the file directly from the CDN using that field. Would that work for you? On Aug 12, 7:54 am, shi shaozhong wrote: > Dear Markus, > > This is a very interesting topic. >

Re: How can I program multiple drop-down menus at one time by Django?

2010-07-19 Thread vjimw
I think you would want to make a custom widget for the birthday field in your model. http://docs.djangoproject.com/en/dev/ref/forms/widgets/#customizing-widget-instances You can then set up your form instance to use this widget, which would include the three drop downs to make a birthdate selector

Re: Valid objects are returning an http 404 response

2010-07-14 Thread vjimw
; > Since you say this is an internal tool, you might try DEBUG=True in > settings.py and getting users to come look at their404screens, since > they will then carry extra info. > > > > On Thu, Jul 1, 2010 at 10:41 AM, vjimw wrote: > > It only happens in our production env

Re: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
m Evans wrote: > On Thu, Jul 1, 2010 at 3:41 PM, vjimw wrote: > > It only happens in our production environment. We have a stage > > environment, which is a mirror of production, that does not have this > > behavior and it does not happen on our development or local > >

Re: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
bly in an if that > makes it only trigger in the interesting circumstance) so that you can > poke around. > > > > On Thu, Jul 1, 2010 at 10:06 AM, vjimw wrote: > > Actually, we are getting our Django 404 page. Sorry to be unclear on > > that. The URLs appears as 404

Re: Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
ectly and you have to restart > apache to get it work correctly. I think in that case it was because > I'd compiled apache slightly incorrectly. I never got to the bottom of > the problem. > > On Jul 1, 2:54 pm, vjimw wrote: > > > > > We are having an issue wher

Valid objects are returning an http 404 response

2010-07-01 Thread vjimw
We are having an issue where valid model objects are returning an apache 404 error. Often times, if you hit refresh in the browser a few times, the object is returned with the same URL. We are using Django 1.2.1 -- You received this message because you are subscribed to the Google Groups "Djang

Re: Unicode Error when Saving Django Model

2010-05-25 Thread vjimw
, 8:30 am, Karen Tracey wrote: > On Sun, May 23, 2010 at 10:10 PM, vjimw wrote: > > I have been reading up on Unicode with Python and Django and I think I > > have my code set to use UTF8 data when saving or updating an object > > but I get an error on model.save() > > &

Unicode Error when Saving Django Model

2010-05-23 Thread vjimw
I have been reading up on Unicode with Python and Django and I think I have my code set to use UTF8 data when saving or updating an object but I get an error on model.save() My database and all of its tables are UTF8 encoded with UTF8 collation (DEFAULT CHARSET=utf8;) The data I am inputting is un

Re: URL dispatch with name argument throws syntax error

2010-04-22 Thread vjimw
Thanks! That was it! I had completely overlooked that and the url() function was even in another URLs file in our project. On Apr 22, 10:45 am, kmtracey wrote: > On Thu, Apr 22, 2010 at 11:34 AM, vjimw wrote: > > Adding the name argument seems pretty straight forward, but I must be

URL dispatch with name argument throws syntax error

2010-04-22 Thread vjimw
Adding the name argument seems pretty straight forward, but I must be doing something wrong. I am writing tests and have the URLs named seems like the easiest way to look them up. My URL dispatch file was working before I added any of the name='this- name' arguments. Here is my file: from django