Custom query for ModelChoiceField using request.user.get_profile() as a part of the criteria

2011-06-10 Thread geraldcor
Hello all, I am wondering how to access a user's profile when creating the queryset for a ModelChoiceField. I would like to be able to use the ModelChoiceField to display contacts from another table based on a parameter saved in the user profile i.e. who =

label_tag in queryset

2011-02-23 Thread geraldcor
Hello all, When rendering a list of data for a particular model instance, I am wondering how to access the label_tag attribute for a field when not using a form. In my view I get a model instance and pass the object in my context inspection = inspection.objects.get(pk=3) Then in my template I

MultipleChoiceField Edit form Error

2011-01-24 Thread geraldcor
Hello All, I am having a problem with my MultipleChoiceField. I have my model field, form field and choices listed below. When I select choices 1-9, the edit form shows that these choices have been checked (i.e. save the form, then view the form for editing again, the previously checked check

Admin not using verbose_name on required fields

2010-09-16 Thread geraldcor
Hello all, I am using the admin and fieldsets to display a change form as usual. Some fields' labels, even with blank=True are being given the class required and are not using the verbose_name argument either given via keyword or positional usage. All fields that really are required (blank=False)

Re: Populate Foreign Key after Form is Submitted

2010-06-14 Thread geraldcor
That was perfect. Thank you. I don't look at the admin docs enough I guess. The following worked: customers = forms.ModelChoiceField(queryset=Customers.objects.all(), widget=forms.TextInput) On Jun 14, 3:03 pm, Lee Hinde <leehi...@gmail.com> wrote: > On Mon, Jun 14, 2010 at 1:59 PM,

Populate Foreign Key after Form is Submitted

2010-06-14 Thread geraldcor
Hello all, I have a model A that has >4000 records in it. I have just created a new model B that has a foreign key to A. I want to be able to create an instance of B and save it which is no problem going the normal routes. However, I like to use Ajax to make the load times faster because a lot of

Re: manager.raw returning Capitalized field names

2010-05-19 Thread geraldcor
uss...@keith-magee.com> wrote: > On Fri, May 14, 2010 at 5:29 AM, geraldcor <gregco...@gmail.com> wrote: > > Hello, > > > Some background first. I am working with a legacy database that is not > > only legacy, it is legacy Microsoft access so there is some hacking

manager.raw returning Capitalized field names

2010-05-13 Thread geraldcor
Hello, Some background first. I am working with a legacy database that is not only legacy, it is legacy Microsoft access so there is some hacking going on. I am accessing a MySQL backend and my models are set up to use the existing tables/field names. When I use regular old ORM queries,

Re: AdminField Rendering Question

2010-05-05 Thread geraldcor
/contrib/adm... > > unfortunately, it´s all hardcoded. if you need to customize the > widget, you may want to write your own and subclass the given one. > > hope that answers your question. > > regards, > patrick > > On 5 Mai, 01:43, geraldcor <gregco...@gmail.com> wrote: >

AdminField Rendering Question

2010-05-04 Thread geraldcor
Hello all, I have been pouring over the django source trying to figure out where the "Currently: "/images/..."" gets added to ImageField upload fields after an image has been uploaded in the admin interface. I wonder this because I would like to do some custom manipulation with the image field

Re: ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
That was a very good guess. I tried it but it didn't work. On Apr 13, 12:46 pm, johan sommerfeld <johan.sommerf...@gmail.com> wrote: >  You could try using initial=0. > > /J > > On Tuesday, April 13, 2010, geraldcor <gregco...@gmail.com> wrote: > > Hello all

ChoiceField invalid literal for int() with base 10: ''

2010-04-13 Thread geraldcor
Hello all, I know the error "invalid literal for int() with base 10: '' " has been discussed a lot in the past, but this seems to be unique to my situation. I have 2 choice fields as defined below for both the model and form: models.py class Checkin(models.Model): ... content =

Use a queryset as values for model insert

2010-03-03 Thread geraldcor
Hello all, I have a form for submitting samples. After the user submits a sample, I would like to give them a button that says "Use last form to fill in this form" or whatever. Basically, the way I have thought to do this is: last_sample = SSF.objects.filter(ssfvalue=request.user.id).order_by('-

Re: Use django auth system with ruby on rails

2010-02-19 Thread geraldcor
CAS sounds very interesting as a SSO. I may give that a try, as well as maybe just perform some unit tests just to make sure I know what is going on under the hood. Thank you all for your much needed input. Greg On Feb 19, 10:32 am, Phlip <phlip2...@gmail.com> wrote: > gerald

Re: Use django auth system with ruby on rails

2010-02-18 Thread geraldcor
jango side (or are > already logged in), then they get redirected with some sort of get > variable user id + hash combo. You could check the validity of the > user id from the hash (using a shared secret). > > Alex > > On Feb 17, 4:09 pm, geraldcor <gregco...@gmail.com&g

Use django auth system with ruby on rails

2010-02-17 Thread geraldcor
Hello all, Internally, we have some RoR apps and Django apps. Our main website runs on Django and is considered to be the main portal for all other apps. Currently, we have a Rails authentication system and a Django authentication system. We want to have one user table to authorize against. The

django-mptt TreeNodeChoiceField

2010-02-11 Thread geraldcor
Sorry to ask such a seemingly silly question, but how do I use TreeNodeChoiceField in a ModelForm. To create a new node, I created a ModelForm, and, like other ModelForms, I thought I could just override the normal form widget. Here are my classes class Folder(models.Model): parent =

Re: Cannot Click Into Internet Explorer Input Text Field

2010-01-06 Thread geraldcor
, geraldcor <gregco...@gmail.com> wrote: > Hello All, > > I have recently run into a very weird internet explorer problem. I > cannot enter any of my text input boxes unless I carefully hover my > mouse near the top or bottom edge of the field. The cursor does not > change unt

Cannot Click Into Internet Explorer Input Text Field

2010-01-05 Thread geraldcor
Hello All, I have recently run into a very weird internet explorer problem. I cannot enter any of my text input boxes unless I carefully hover my mouse near the top or bottom edge of the field. The cursor does not change until I get to the very top of the field. It works fine in all other

Re: Initial values for formwizard form

2009-12-02 Thread geraldcor
on. On Dec 2, 3:53 pm, geraldcor <gregco...@gmail.com> wrote: > So I successfully used this method to add initial values using > parse_params as I was dealing with step 0. However, now the client > wants the form order changed so that what was step 0 is now step 2. I > tried

Re: Initial values for formwizard form

2009-12-02 Thread geraldcor
: init['sendreportsto']='Please use the format:\nName n...@email.com, \nName2 na...@email.com' self.initial[2]=init Thanks for any more help. On Nov 19, 5:56 pm, geraldcor <gregco...@gmail.com> wrote: > This worked perfectly. Tha

Pass URL variable to formwizard like a normal form in views.py

2009-12-01 Thread geraldcor
No normally I can use something lie /foo/edit/35/ and I can edit the record whose pk is 35. Now with this, I have a url pattern like (r'^edit/(?P\d+)/$', 'edit'), which points to def edit (request, ssf_id): in my views.py. For my formwizard, by overriding various methods I have successfully made

Re: Initial values for formwizard form

2009-11-19 Thread geraldcor
This worked perfectly. Thank you. I used parse_params because I needed to add default company profile stuff to the first wizard form. Thank you again for clearing up my ignorance. Greg On Nov 18, 9:10 pm, "Mark L." <mark.l...@gmail.com> wrote: > On Nov 19, 1:28 am, geraldcor &

Re: Initial values for formwizard form

2009-11-18 Thread geraldcor
=RequestContext(request)) pretty simple and basic. How do I do this with a form wizard? Greg On Nov 17, 3:39 pm, geraldcor <gregco...@gmail.com> wrote: > Hello all, > > I began making a form that used request.user.get_profile to get > default values for company name, phone, email etc. I ha

Initial values for formwizard form

2009-11-17 Thread geraldcor
Hello all, I began making a form that used request.user.get_profile to get default values for company name, phone, email etc. I have since decided to move to a formwizard to split things up. I have no idea how to override methods for the formwizard class to be able to include those initial values

Re: Javascript working on development, not apache

2009-09-11 Thread geraldcor
e Firefox console and try to see what's going on. > > > > On Fri, Sep 11, 2009 at 12:44 PM, geraldcor <gregco...@gmail.com> wrote: > > > Hello all, > > > I have a site that has quite a bit of javascript/jquery going on. All > > of this works fine on my develo

Javascript working on development, not apache

2009-09-11 Thread geraldcor
Hello all, I have a site that has quite a bit of javascript/jquery going on. All of this works fine on my development server, but basically no javascript works when I deploy on Apache. This previously worked on this same site before some changes (suspiscious, I know) and other sites work fine on

Re: edit form not working with imagefield

2009-07-08 Thread geraldcor
Thank you all. This plugin really did the trick http://malsup.com/jquery/form/. One line of code makes it work and you can expand from there. Worked really well. I highly recommend it for form uploads with ajax and jquery. On Jul 7, 3:02 pm, Xiong Chiamiov wrote: > On

Re: edit form not working with imagefield

2009-07-07 Thread geraldcor
Oh. That's a problem. Ok. Thanks. Am I going to have to scrap the ajax idea if I want to edit the image? Any other workarounds? Thanks for the reply. On Jul 7, 11:20 am, Alex Gaynor <alex.gay...@gmail.com> wrote: > On Tue, Jul 7, 2009 at 12:16 PM, geraldcor <gregco...@gmail.com>

edit form not working with imagefield

2009-07-07 Thread geraldcor
I have a form that is being added via jquery ajax. I can add a new record, including images just fine. Works like a dream. However, when I go to edit the form, every field will update except for the image field. I choose a new image from the browse button, the filepath loads up and when I submit

Re: Empty [] using objects.all() on legacy database

2009-06-19 Thread geraldcor
stuff). I already tried some unicode stuff but I'm fairly untrained in that area. Any ideas? Thanks Greg On Jun 18, 4:41 pm, geraldcor <gregco...@gmail.com> wrote: > Hello all, > > I am trying to work with a legacy database and I ran inspectdb and > have a model with the 2 tables

Empty [] using objects.all() on legacy database

2009-06-18 Thread geraldcor
Hello all, I am trying to work with a legacy database and I ran inspectdb and have a model with the 2 tables that I want to use. The first table, the main table is not working at all. The second table which is related via a foreign key seems to be working just fine. Here are the symptoms: In

Re: Form Wizard and Saving to Database

2009-05-19 Thread geraldcor
So that's how that works. Brilliant. Thank you. It worked perfectly. On May 19, 1:43 am, George Song <geo...@damacy.net> wrote: > On 5/18/2009 4:01 PM, geraldcor wrote: > > > Hello all, > > > I am working on my second Django app and it involves a very long fo

Form Wizard and Saving to Database

2009-05-18 Thread geraldcor
Hello all, I am working on my second Django app and it involves a very long form. I successfully used modelForms in my last app to successfully save form data to a database. With this long form, I have split it up into smaller forms (forms.Form not ModelForms) and used the FormWizard to tie it