Submit Button jammed by Tiny_MCE django widget while using newforms

2008-07-09 Thread Ramdas S
Hi I am using TinyMCE to create pages using newforms. I am following this link http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE The program works perfectly without TinyMCE. But the submit button stops working once I include TinyMCE widget to render the textbox. I am following exactly

Re: Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Darthmahon
Hi Julian, Good thinking - None didn't work but this did: ('','Month',) (1,'January',) Thanks! :) On Feb 13, 8:58 pm, Julien <[EMAIL PROTECTED]> wrote: > I can't test it myself at the moment, but maybe try setting a None > value for 'Month': > > MONTH_CHOICES=( >                

Re: Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Julien
I can't test it myself at the moment, but maybe try setting a None value for 'Month': MONTH_CHOICES=( (None,'Month',), (1,'January'), On Feb 14, 7:24 am, Darthmahon <[EMAIL PROTECTED]> wrote: > Hey, > > I'm using the newforms functionality

Using newforms and a select - how do I stop a user from selecting a value?

2008-02-13 Thread Darthmahon
Hey, I'm using the newforms functionality to create my forms - so the structure is something like this: / FORMS.PY / class RegisterForm(forms.Form): MONTH_CHOICES=( (0,'Month',), (1,'January'),

Re: using newforms

2008-01-12 Thread ocgstyles
Figured it out. Just like Kenneth said above, I need a super line where he said. I was also appending the values incorrectly. It should have been GROUP_CHOICES += ((g.id, g.name),) Thanks for the help everyone. On Jan 12, 11:14 am, ocgstyles <[EMAIL PROTECTED]> wrote: > Great. That works.

Re: using newforms

2008-01-12 Thread ocgstyles
Great. That works. Only problem now, though, is that GROUP_CHOICES is still [] after the object is instantiated. From a shell I can do this: f = ReferralForm(User.objects.get(username='keith')) f.fields['field1'].choices = f.GROUP_CHOICES And that will populate the field with the right data.

Re: using newforms

2008-01-12 Thread Kenneth Gonsalves
On 12-Jan-08, at 2:48 PM, ocgstyles wrote: > def __init__(self, user): you need a super line here > profile = user.get_profile() -- regards kg http://lawgon.livejournal.com http://nrcfosshelpline.in/web/ Foss Conference for the common man: http://registration.fossconf.in/web/

Re: using newforms

2008-01-12 Thread shabda
Instead of this def __init__(self, user): profile = user.get_profile() for g in profile.groups.all(): self.GROUP_CHOICES += (g.id, g.name) super(MyForm, self) Should it not be, def __init__(self, user, *args, **kwargs): profile = user.get_profile()

using newforms

2008-01-12 Thread ocgstyles
Hi, I using the newforms library to create a form. I need to know who the current user is so I know which values to display in a dropdown control. So I have this so far: from django import newforms as forms class MyForm(forms.Form): GROUP_CHOICES = [] field1 =

Re: hide fields using newforms

2007-12-30 Thread Todd O'Bryan
On Dec 30, 2007 11:11 AM, l5x <[EMAIL PROTECTED]> wrote: > > On Dec 30, 5:04 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > > Hello, > > using newforms how can I set fields to be hidden (the hidden="hidden" > > attribute)? > > Did you

Re: hide fields using newforms

2007-12-30 Thread l5x
On Dec 30, 5:04 pm, Florian Lindner <[EMAIL PROTECTED]> wrote: > Hello, > using newforms how can I set fields to be hidden (the hidden="hidden" > attribute)? Did you mean type="hidden" ? http://www.djangoproject.com/documentation/newforms/#widgets You can

hide fields using newforms

2007-12-30 Thread Florian Lindner
Hello, using newforms how can I set fields to be hidden (the hidden="hidden" attribute)? Thanks, Florian --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to th

Re: Set attributes to input using newforms

2007-11-01 Thread Malcolm Tredinnick
On Thu, 2007-11-01 at 19:08 +, Henhiskan wrote: > Hi fellows, > Am using django-0.96 and I need to set an input html attribute from a > newforms > I need to use a time picker from dojo, for that I need to have > something like this: > dojoType="dropdowntimepicker"> > > The only solution I

Re: Set attributes to input using newforms

2007-11-01 Thread Henhiskan
There is no widget docs for v0.96 documentation, but I just read the doc of current dojo version, and find the solution to my problem, just: discovered_time = forms.TimeField(widget=forms.TextInput(attrs={'dojoType':'dropdowntimepicker'})) Cheers.-

Set attributes to input using newforms

2007-11-01 Thread Henhiskan
Hi fellows, Am using django-0.96 and I need to set an input html attribute from a newforms I need to use a time picker from dojo, for that I need to have something like this: The only solution I can think of is to process the form.as_table() string and put the snip of code that I need, just

Re: using newforms, an uncommon case.

2007-10-30 Thread RajeshD
Here's a different approach: You could serialize an incomplete form instance to another table (could just be serialized to the user's session too.) Then, when the user requests to continue filling out an incomplete form, just deserialize the form instance and you have the form exactly as the

Re: using newforms, an uncommon case.

2007-10-30 Thread Milan Andric
On Oct 30, 12:27 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Basically, you'd write pend() to take care of storing an in-progress > form, and save() for processing a completed form. Then you have a > couple options on deciding when to call which one. Also, I'll leave > pulling up a

Re: using newforms, an uncommon case.

2007-10-30 Thread Scott SA
On 10/30/07, Milan Andric ([EMAIL PROTECTED]) wrote: >I'm writing an application form (allow people to apply for a workshop) >and we allow the applicant to submit unfinished applications because >they can return to complete them at a later date. So most of the >model fields are blank=True.

Re: using newforms, an uncommon case.

2007-10-30 Thread Marty Alchin
On 10/30/07, Milan Andric <[EMAIL PROTECTED]> wrote: > I'm writing an application form (allow people to apply for a workshop) > and we allow the applicant to submit unfinished applications because > they can return to complete them at a later date. So most of the > model fields are blank=True.

Re: Linking dropdowns using newforms

2007-10-11 Thread Emmchen
Thanks guys! I'll look into JS then and hopefully I'll be able to solve my problem. Thanks for the hints. /emma --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send

Re: Linking dropdowns using newforms

2007-10-03 Thread Richard Dahl
I have used both mochikit and yahoo YUI for this, both of them work well. JQuery show a great deal of promise as well although I have never used it. -richard On 10/3/07, Emmchen <[EMAIL PROTECTED]> wrote: > > > @ Hraban - Thank you for your reply. > > Yes, I want to display up to four columns.

Re: Linking dropdowns using newforms

2007-10-03 Thread Henning Hraban Ramm
Am 2007-10-03 um 20:52 schrieb Emmchen: > Is it possible to use two or more forms at the same time? And is it > possible to desplay the selected values from one form while the next > form doesn't have a selected value yet. How does this work with > request/response? > > My experience with

Re: Linking dropdowns using newforms

2007-10-03 Thread Emmchen
@ Hraban - Thank you for your reply. Yes, I want to display up to four columns. The content of one column depend on the selection in the previous column (exept for the first one). Column 1: Display a list of choices - (eg Systematic, Collection, Growthplace, Heritage). Column 2: Display a

Re: Linking dropdowns using newforms

2007-10-03 Thread Emmchen
@ Hraban - Thank you for your reply. Yes, I want to display up to four columns. The content of one column depend on the selection in the previous column (exept for the first one). Column 1: Display a list of choices - (eg Systematic, Collection, Growthplace, Heritage). Column 2: Display a

Re: Linking dropdowns using newforms

2007-10-03 Thread Henning Hraban Ramm
Am 2007-10-03 um 18:30 schrieb Emmchen: > I am wondering if it's possible to link dropdowns using newforms. I > want to use the selected value in the first dropdown as the > filtervalue for the next dropdown etc. > You want the options of the second select to change aft

Linking dropdowns using newforms

2007-10-03 Thread Emmchen
Hi, I am wondering if it's possible to link dropdowns using newforms. I want to use the selected value in the first dropdown as the filtervalue for the next dropdown etc. My model looks something like this: /// models.py class Property(models.Model): """

Re: Problem using newforms cleaned_data with Oracle and DateField

2007-09-18 Thread Catriona
Hi Ian In my model, I have specified db_table = "Survey" so I don't think that is the problem I'll have another play with it and see if I can get further. Thanks Catriona On Sep 19, 9:50 am, Ian <[EMAIL PROTECTED]> wrote: > I'm unable to reproduce the error you're getting. The default table

Re: Problem using newforms cleaned_data with Oracle and DateField

2007-09-18 Thread Ian
I'm unable to reproduce the error you're getting. The default table name would be app_survey rather than just survey, where app is the name of the application, so you might check that the table you listed is the same table that Django is using. Hope that helps, Ian On Sep 18, 5:03 pm, Catriona

Re: Problem using newforms cleaned_data with Oracle and DateField

2007-09-18 Thread Catriona
Hi Ian Sorry I should have given you this info. I am using Python 2.5.1 and Django 6051. I get the following when I run a describe on the table - sorry it is a bit messy Object Type TABLE Object SURVEY Table Column Data Type Length Precision Scale Primary Key Nullable Default Comment

Re: Problem using newforms cleaned_data with Oracle and DateField

2007-09-18 Thread Ian
Catriona, What versions of Python and Django are you using? What output do you get from running a describe on the Survey model's table? Ian On Sep 17, 5:07 pm, Catriona <[EMAIL PROTECTED]> wrote: > Hello > > I'm a newbie to Django and Python so sorry if this is a dumb mistake > on my behalf. >

Problem using newforms cleaned_data with Oracle and DateField

2007-09-17 Thread Catriona
Hello I'm a newbie to Django and Python so sorry if this is a dumb mistake on my behalf. I have a model (using an Oracle XE backend): class Survey(models.Model): company = models.ForeignKey(Company, null = False, blank = False) survey_name = models.CharField(max_length = 50,

Re: retaining the data on validation error using newforms

2007-07-31 Thread Doug B
Everything can be changed. Look under auto_id in the newforms docs on djangoproject.com. The default does it exactly the way you seem to be, prepending 'id_' to the field name. If you want to set a class, you need to change the attrs dict on the field's widget. All a newforms field really

retaining the data on validation error using newforms

2007-07-30 Thread james_027
Hi, this is how I am using the newforms. My Form class NewEmployeeForm(forms.Form): contract_from = forms.DateField() contract_to = forms.DateField() position = forms.CharField(max_length=20) My View def create_employee(request): f = None if request.method == 'POST':

Re: Using newforms to create multiple related objects?

2007-07-05 Thread Russell Keith-Magee
On 6/29/07, Michael Sylvan <[EMAIL PROTECTED]> wrote: > > Is there a way to do this sort of things cleanly, short of using the > newforms-admin branch of Django? Or do I have to do something like > changing the form's fields attribute by hand? Using formsets from newforms-admin will be the

Re: Using newforms to create multiple related objects?

2007-07-04 Thread yml
Hello, It would be great if one of the Gurus could spend some time to answer this kind of questions. I am trying to do something similar. But so far I haven't been able to achieve this. I am looking for a way to build dynamically a form representing a mashup of several models and its associated

Using newforms to create multiple related objects?

2007-06-28 Thread Michael Sylvan
Hello, I am trying to use newforms and templates, together with the following models, to mimic what the admin application does with num_in_admin : provide a form for Person's fields, and multiple Phone forms. With just one Phone form things are quite straightforward: validate the Person form,

RE: Using newforms for multiple db rows

2007-05-14 Thread Chris Brand
> I think if it were me I'd build a form builder function, metaclass, or > do it in __init__. Probably the easiest is passing in an argument to > __init__ , that gives enough information to build the form. That sounds like the kind of thing I'm looking for. Thanks very much once again, Chris

Re: Using newforms to show a single form for multiple models

2007-05-14 Thread anders conbere
CKED, num_in_admin=10`. In the admin > interface for adding a new List, this is represented perfectly: it > shows the fields for the List object and 10 sets of fields for the > ListItem objects. > > How would I replicate this same form setup (1 List, 10 ListIems) using > newforms i

Using newforms to show a single form for multiple models

2007-05-13 Thread Brad Fults
object and 10 sets of fields for the ListItem objects. How would I replicate this same form setup (1 List, 10 ListIems) using newforms in my app? I looked at the admin code on the newforms-admin branch, but it's very genericised and dense. I'm thinking there's a simple way to accomplish

Re: Using newforms for multiple db rows

2007-05-11 Thread dballanc
If any two inputs have the same name, both values are returned in a list ala [request.POST.getlist('score')] With the checkboxes it's easy to identify by value. I assume you might be able to figure out where that score belongs by order, but I'm not sure order is guaranteed. I think if it were me

RE: Using newforms for multiple db rows

2007-05-11 Thread Chris Brand
After a few false starts, I managed to get this going. Now my problem is that this approach only really works for Booleans. What if I wanted a form to enter test scores for a class, one score per student ? All my approaches so far have ended up with multiple fields with the same name, which then

RE: Using newforms for multiple db rows

2007-05-04 Thread Chris Brand
> For the attendance form, you might use a MultipleChoiceField > checkboxSelectMultiple widget, where the value of each choice is set > to the pk of the student model. You should get a list of id's that > were checked when the form gets submitted. Thank you very much. Sounds like that approach

Re: Using newforms for multiple db rows

2007-05-03 Thread dballanc
Don't try too hard to directly link form to model. For the attendance form, you might use a MultipleChoiceField checkboxSelectMultiple widget, where the value of each choice is set to the pk of the student model. You should get a list of id's that were checked when the form gets submitted.

Using newforms for multiple db rows

2007-05-03 Thread Chris Brand
I've been reading all about newforms and playing a little, but I can't see how to approach what I want to do. Say I wanted to do something like a class attendance form, where my model has a class Student, and I want a form with a checkbox for each student to allow me to say whether they were

Re: validating using newforms

2007-03-16 Thread Rubic
I don't work much with form_for_model, but you could probably do something like this: IconForm = forms.models.form_for_model(Icon) if request.method == 'POST': form = IconForm(request.POST) Then perform your own validation, assigning an error to the field and returning: context =

Re: validating using newforms

2007-03-16 Thread Benedict Verheyen
Rubic schreef: > Benedict, > > You add a clean_XXX method to your form class, > where XXX corresponds to the field name you wish > to validate. > > In your clean_XXX method, you return > self.clean_data['XXX'] if your data validates, > otherwise raise a ValidationError exception. > > I just

Re: validating using newforms

2007-03-16 Thread Rubic
Benedict, You add a clean_XXX method to your form class, where XXX corresponds to the field name you wish to validate. In your clean_XXX method, you return self.clean_data['XXX'] if your data validates, otherwise raise a ValidationError exception. I just posted a similar response on this

Re: Using NEWFORMS to select data from the MODEL

2007-02-13 Thread Brian Rosner
On 2007-02-10 18:22:53 -0700, "johnny" <[EMAIL PROTECTED]> said: > > I have to include some fields from 3 different models. How do you > create a selection field, for selecting a category data, in category > model, using newforms? > > Thank You in advance.

Using NEWFORMS to select data from the MODEL

2007-02-10 Thread johnny
I have to include some fields from 3 different models. How do you create a selection field, for selecting a category data, in category model, using newforms? Thank You in advance. --~--~-~--~~~---~--~~ You received this message because you are subscribed

creating forms from models using newforms

2007-01-13 Thread ashwoods
on irc there was more than one who were really interested in creating forms from model defintions are were really sad that newforms does not do this. but! the newforms documentation isn't nearly finished, so if you are really impatient, just dive into the code yourself :) or if you read the