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
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=(
> (None,'Mo
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 to
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'),
(2,'February
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.
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.
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/
--~--~
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()
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 = forms.ChoiceField(choice
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
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 cr
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 this
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 ca
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.-
--~--~-~--~~~---~
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 befo
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
user
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 pended
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. Mos
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.
Hi,
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. Most of the fields are not required for
a save() but i'd
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 ema
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. The
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 JavaScr
@ 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 filter
@ 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 filter
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 after s
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):
"""
Hi Ian
Found the problem, it was a design issue. Thanks for pointing out that
I was focusing on the wrong thing.
Regards
Catriona
On Sep 19, 10:27 am, Catriona <[EMAIL PROTECTED]> wrote:
> Hi Ian
>
> In my model, I have specified db_table = "Survey" so I don't think
> that is the problem
>
> I
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
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
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
SUR
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.
>
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, nu
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 cons
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':
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 easies
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 v
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, an
> 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
models.STACKED, 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
>
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 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
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
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 d
> 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
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.
Som
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 pres
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 = {'form
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 po
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 group
Hi,
i have a model (using newforms) where i have an image upload field.
Now i'm trying to check the image dimensions amongst other things.
I thought i could do this using validators.
It doesn't seem to call the validator specified in the model though.
How can i validate
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.
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 to the
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 comm
53 matches
Mail list logo