Now that I am moving forward, I am beginning to wonder about the
automatic (Free) validation that is supplied in those docs I mentioned
above. The profanity filter for example is a great tool. Will that
stay in the 1+ versions of Django? I could use them in a BaseForm as:
clean_textfield(self):
Thanks for the help. I finally put two and two together. I was
following this tutorial http://www.djangoproject.com/documentation/forms/
and somehow got myself all messed up. Thanks for the reply and back to
the code.
On Oct 20, 4:02 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Well... Yo
Well... Your code looks like a crazy mixture of newforms and
oldforms :)
Now it is much wiser to use newforms. They don't have validators, nor
manipulators.
The information on newforms can be found in django documentation.
--~--~-~--~~~---~--~~
You received this m
I am so close to getting this project done. The last little bit is all
about validation. I have been following the docs pretty closely and am
really at a loss as to what is going on right now. The Error:
TypeError at /videoUploader/
__init__() got an unexpected keyword argument 'field_name'
Here
I have a customer manipulator and I am trying to figure out during the
save function how to
get a foreign key pointer updated with a new value.
Here is my save function:
def save(self, new_data):
print 'new_data is ', new_data
new_status = new_data['status']
newstatusid =
I would try just to extend the custom manipulator as you would do with
custom manager:
class CustomAddManipulator(models.manipulators.AutomaticAddManipulator):
# ... override the manipulator ...
class CustomChangeManipulator(models.manipulators.AutomaticChangeManipulator):
# ... override
ustom form is needed. The
manipulator will be used within Django's admin.
I searched and red and searched and red again but I couldn't find an
answer on this one:
How to add a custom manipulator, extending the default one, to a model
using the default form?
--
Hello Aidas,
Exactly. You answered your question yourself.
Seems I'm on the right way then :-)
Thanks for anwering, I'll give it a try.
Regards,
Rob
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Django
us
Exactly. You answered your question yourself. Just override the
existing urls putting them above the (r'^admin/',
include('django.contrib.admin.urls')).
For example:
(r'^admin/yourapp/yourmodel/add/$', 'yourproject.yourapp.views.yourmodel_add'),
(r'^admin/yourapp/yourmodel/(?P[0-9]+)/$',
'yourpr
On 20 dec, 10:54, "patrick k." <[EMAIL PROTECTED]> wrote:
do it like in any other application:
custom view, custom template, change urls
Hi Patrick,
That's exactely what I wanted to know for one exception.
How to call the custom view when using admin.?
By overriding the 'default' call:
(r'^a
RequestContext(request) )
don´t know if that really helps.
if not, maybe you can be more specific.
patrick
Am 20.12.2006 um 01:06 schrieb Rob Slotboom:
For a model I want to add a custom manipulator which can be used in
the
admin.
With this manipulator I want to be able to add an extra fo
For a model I want to add a custom manipulator which can be used in the
admin.
With this manipulator I want to be able to add an extra formfield for
displaying some additional data from a related object. There is no need
for database storage.
In this group I red that it isn't possible to e
Benedict Verheyen schreef:
> FimAddManipulator.default["patient"] = patientid
> or
> FimAddManipulator.default["patient"] = Patient.objects.get(id=patientid)
>
> But no patient is selected when the form shows.
> How can i set the selection of a dropdown box from a view or manipulator?
>
Appar
Hi,
i have a table that displays patients and risks. Now the users want to
be able to
add a risk for a patient by clicking on the cells that intersect both.
I do this by building the appropriate link to build a new object based
on the patient
id.
What i want to do is use my custom AddManipulator
The choices parameter to Selectfield expects a list of tuples, what
you've got is a list of strings.
Say you want to have to choices in the selectfield, it would go
something like this.
projects = [("choice1","Gen2"),("choice2","CRMC")]
I hpoe that clears things up for you ..
-- Torbjørn
--~-
I am trying to use a customer manipulator to build a search screen. One
of my
fields is a select field but I get an error to many values to unpack.
Any help would be greatly appreciated.
views.py
class SearchResults(forms.Manipulator):
def __init__(self):
projects = ['Gen2', 'CRMC']
Hello!
How can check if field is filling in the form using custom
manipuplator? The idia is, if user has permisson to edit article or has
authenticated field 'Publish' is visible in form, if not visible add
article with publish = 0. How to do this? My code is not working...
self.fields =
;
> which makes new_data['teacher'] contain a teacher object when you
> actually only need a value. You could change that to:
> teacher=str(course.teacher.id)
You're right, this works the way i wanted it!
> Another thing, maybe you are doing more things that you didn't
y need a value. You could change that to:
teacher=str(course.teacher.id)
Another thing, maybe you are doing more things that you didn't
included in the pasted code, but I don't see any need for a custom
manipulator there, and I would suggest you to use the default
generated manipulators.
Hi all,
I've got problems (mainly due to my misunderstanding of Django
manipulators) making a custom manipulator work.
The code http://paste.e-scribe.com/2421/ works but has two quirks:
1) {{form.teacher}} doesn't render the actual teacher assigned to that
course but just the first i
still learning ...
btw, it works fine now.
thanks,
patrick
Am 23.09.2006 um 12:45 schrieb Ivan Sagalaev:
>
> patrickk wrote:
>> thanks, I think I´ve got it now.
>>
>> the documentation of custom manipulators really lacks advanced
>> examples.
>> I don´t know how one should find out what you e
patrickk wrote:
> thanks, I think I´ve got it now.
>
> the documentation of custom manipulators really lacks advanced examples.
> I don´t know how one should find out what you explained in the last
> few mails by reading the documentation.
> e.g., I´m quite sure that there´s no explanation of "
ot; in the
documentation
anyway, thanks a lot.
patrick
Am 22.09.2006 um 08:42 schrieb Ivan Sagalaev:
>
> patrickk wrote:
>> I don´t want to stress your help, but do you know where to find an
>> example on using a custom manipulator for *updating* data.
>>
>> question is, where d
patrickk wrote:
> I don´t want to stress your help, but do you know where to find an
> example on using a custom manipulator for *updating* data.
>
> question is, where does the custom manipulator gets the data (stored
> in the database) from.
> the way I did it so
I don´t want to stress your help, but do you know where to find an
example on using a custom manipulator for *updating* data.
question is, where does the custom manipulator gets the data (stored
in the database) from.
the way I did it so far:
1. using a changmanipulator to get and display
yField it is SelectMultipleField.
> as mentioned above, I thought that´s the primary use-case for custom
> manipulators:
> the custom manipulator handles the custom form
> the changemanipulator handles the data
>
> is that wrong?
Yes. One manipulator is intended to handl
; patrickk wrote:
>> flatten_data() doesn´t relate to the custom manipulator but to model
>> resp. the changemanipulator.
>
> I see now... And if I'm guessing correctly you're creating a
> FormWrapper
> from user_profile_manipulator that just doesn't have that checkbox
&
patrickk wrote:
> flatten_data() doesn´t relate to the custom manipulator but to model
> resp. the changemanipulator.
I see now... And if I'm guessing correctly you're creating a FormWrapper
from user_profile_manipulator that just doesn't have that checkbox fiel
flatten_data() doesn´t relate to the custom manipulator but to model
resp. the changemanipulator.
btw, the table we´re talking about is extending the user model, it´s
a one-to-one relation - but I guess that shouldn´t be the problem.
i just reinstalled the whole project, generated all the
patrickk wrote:
> are there any workarounds?
> I´m still not able to save and retrieve the m2m-data. and since I
> have to meet a deadline I´m getting kind of nervous.
In your view code you use flatten_data() but I can't see it defined in
your custom manipulator. This must rais
thanks for your help (especially ivan).
are there any workarounds?
I´m still not able to save and retrieve the m2m-data. and since I
have to meet a deadline I´m getting kind of nervous.
thanks,
patrick
Am 21.09.2006 um 16:52 schrieb Ivan Sagalaev:
>
> Aidas Bendoraitis wrote:
>> Has your Mus
Aidas Bendoraitis wrote:
> Has your Music model a __str__ method? Maybe you get nothing using {{
> form.music }} because it is represented in no way.
In fact {{ form.music }} has nothing to do with the model itself. It's a
manipulator's field and should be represented as a group of
checkboxes
.
Good luck!
Aidas Bendoraitis [aka Archatas]
On 9/20/06, patrickk <[EMAIL PROTECTED]> wrote:
>
>
> Am 20.09.2006 um 21:40 schrieb Ivan Sagalaev:
>
> >
> > patrickk wrote:
> >> thanks. the data is sent now, but
> >> - how do I save
Am 20.09.2006 um 21:40 schrieb Ivan Sagalaev:
>
> patrickk wrote:
>> thanks. the data is sent now, but
>> - how do I save the data in my custom manipulator, referring to:
>> temp.set_music(data['music'])
>
> It looks like 0.91 syntax. If you're u
patrickk wrote:
> thanks. the data is sent now, but
> - how do I save the data in my custom manipulator, referring to:
> temp.set_music(data['music'])
It looks like 0.91 syntax. If you're using contemporary Django it should
look like this:
temp.music = Music.ob
thanks. the data is sent now, but
- how do I save the data in my custom manipulator, referring to:
temp.set_music(data['music'])
- how do I display the data (already in the database) on my site,
ref. to:
new_data = user_profile_manipulator.flatten_data()
additionally: I don´t unders
va:patrick.kranzlmueller wrote:
> self.fields = (
> forms.CheckboxSelectMultipleField(field_name="music",
> choices=MUSIC_CHOICES),
> ...
> )
I guess I know what is it... CheckboxSelectMultipleField
worksinexplicably different from SelectMultipleField i
=True,
related_name="music")
this is part of my CUSTOM MANIPULATOR:
class UserprofileManipulator(forms.Manipulator):
def __init__(self):
MUSIC_CHOICES = [(str(c.id), str(c)) for c in
Music.objects.all()]
s
I have a custom manipulator:
class Pircejs_Add(Manipulator):
def __init__(self):
self.fields = (
TextField(field_name='vards', is_required=True),
TextField(field_name='uzvards
I have a custom manipulator:
class Pircejs_Add(Manipulator):
def __init__(self):
self.fields = (
TextField(field_name='vards', is_required=True),
TextField(field_name='uzvards
On 8/30/06, Nowell <[EMAIL PROTECTED]> wrote:
I believe that the correct way to accomplish this is:temp = Message(...)temp.save()temp.teams = Team.objects.filter(id__in=data.getlist('teams'))Notice you need to use the getlist() function to return a list of the
M2M selections, the previous code will
I believe that the correct way to accomplish this is:
temp = Message(...)
temp.save()
temp.teams = Team.objects.filter(id__in=data.getlist('teams'))
Notice you need to use the getlist() function to return a list of the
M2M selections, the previous code will return only the last element.
--~--~
Russ and Ivan -- thanks very much for your help! I'd spent several
hours searching for info and could only find details of how to do it
for old versions.
Thanks again.
--
James
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Goo
Russell Keith-Magee wrote:
> temp = Message(...)
> temp.save()
> temp.teams = Team.objects.filter(id__in=data['teams'])
>
> i.e., there is no need to iterate through the data (which isn't really
> efficient, since every add is a separate db operation). Instead, you can
> assign an iterable to a
On 8/23/06, Ivan Sagalaev <[EMAIL PROTECTED]> wrote:
James Mulholland wrote:> temp.set_teams(data['teams'])> temp.save()This looks like 0.91 syntax that was changed in 'magic-removal' process.Now it should look like this: temp = Message(...)
temp.save() for id in data['teams']:
James Mulholland wrote:
> temp.set_teams(data['teams'])
> temp.save()
This looks like 0.91 syntax that was changed in 'magic-removal' process.
Now it should look like this:
temp = Message(...)
temp.save()
for id in data['teams']:
temp.teams.add(Team(id))
BTW, sav
x27;]:
temp.teams.add(Team.objects.get(pk=t))
However, only the last selected team in the list gets saved.
I would *really* appreciate it if someone could help me with this!
--
James
James Mulholland wrote:
> Hi, I have a routine like this in a custom manipulator (which handles
>
Hi, I have a routine like this in a custom manipulator (which handles
SMS message-sending from a web-page):
def save(self, data):
temp = Message(
contact_type = data['contact_type'],
mobile_number = data['mobile_number'],
message = data['mes
Hi John,thanks for the response. I was thinking about this overnight and I'd have to agree, it'd probably be best to use a "hybrid" approach as you were mentioning (I'm already breaking out the radiobuttons into an on-template loop: it wouldn't be much more than that, I'd assume).
thanks again,-Chr
Hi Chris,
I'd say there were two ways to handle this. The data that you really
want is the number of rows, you radios are really just to help the
user choose a value.
Option #1 -- Use a custom field.
You can create your own custom field type, but this is probably
overkill for this application.
Hey all,
I am trying to create a series of radio buttons where you can select
one radio button, and next to the selection will be a Text Field, drop
box, or maybe both, for additional information related/ needed for the
current radio selection.
like so:
Radio | Label
(o) show all rows
() Limit
.FILES[ 'file' ][ 'content' ]
Yes. The main point is that my form and view works great with the
automatic AddManipulator, but I want to make it working with a custom
manipulator.
Anyway, i'm currently trying to understa
I had problems with file uploading time ago and I found this post
http://groups.google.com/group/django-users/browse_thread/thread/d83259c6bdd0151f/3880fdebcef9a367?lnk=gst&q=uploading+images&rnum=5#3880fdebcef9a367
It helped me so much. And I wonder it could help you.
Notice the atributes of t
Hello,
I have a model with a FileField.
When using the MyModel.AddManipulator() in the view, everything works
as expected.
But I need a custom manipulator. I've already made some custom
manipulators that works pretty well, so I'm sure I'm not too wrong
here. The one that don&quo
One nice thing about doing it the way it currently is that you can
specify what yuo want the "blank" to be, e.g. "Please select an option"
or "", etc.
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Dja
I wonder if this would be worth pursuing as a new feature for the
SelectField widget.
It makes sense to me that if one sets is_required=False then the widget
should add the "blank" option.
--~--~-~--~~~---~--~~
You received this message because you are subscribed
As far as I know, that is the way to do it. That's the way I've always
done it, but someone might know a better method of doing it.
Chris
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To pos
I have created a custom manipulator for a search form.
#
from django import forms
from choices import AIRCRAFT_CHOICES, phase_choices, OBJECT_CHOICES,
STATUS_CHOICES
class SelectStatusManipulator(forms.Manipulator):
def __init__(self):
self.fields
ation methods defined in
my model,
and validator_list= for specified field in my model definition), but
I've decided to play (and learn the) with
manipulators.
Thanks!
Robert
Jorge Gajon napisal(a):
> Hi,
> You need to implement the save() method in your custom manipulator.
>
> C
's no need to write the custom manipulator.
Cheers,
Jorge
On 7/14/06, Robert <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> When using custom Manipulator (which in fact does nothing.. I've cut
> some additional custom validation here) I'm getting error as follows:
&g
Hi,
You need to implement the save() method in your custom manipulator.
Cheers
On 7/14/06, Robert <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> When using custom Manipulator (which in fact does nothing.. I've cut
> some additional custom validation here) I&
Hello,
When using custom Manipulator (which in fact does nothing.. I've cut
some additional custom validation here) I'm getting error as follows:
Traceback (most recent call last):
File
"/usr/local/lib/python2.4/site-packages/Django-0.95-py2.4.egg/django/core/h
Hello. I'm wondering if you've found a solution to this or if anyone
else knows what the problem might be. I'm having the same problem as
you, and my code is nearly identical.
Thanks,
Julia
--~--~-~--~~~---~--~~
You received this message because you are subscri
Hi again,
I think I found the answer to my own question, here:
http://code.djangoproject.com/wiki/ManipulatorScript
I hope this is useful to someone.
mikah
--
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Group
Hi,
I'm writing a custom change manipulator for a model. I'm not using
the default because there's some special processing that has to happen
on each save. Now, this model has a ManyToMany relationship. How do I
add a form field that will update that relationship? In effect, it has
to work on t
Hi there,
i am experiencing problems with the use of ImageField (model) in M-R,
revision
3007.
MySQL gets sql errors when saving. It seems to be wanting to save the
uploaded
image without quotes or something. This does not belong to mysql code i
think
since i want to save my file at MEDIA_ROOT...
Thanks, that works!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTE
Denis wrote:
>I wonder what would it be the best way to save the file while im using
>custom manipulator.
>It contains objects from several models and im saving everingthing in
>manipulator.save().
>Everything works great untill i have to save uploaded file. I wonder if
>ther
Hi
I wonder what would it be the best way to save the file while im using
custom manipulator.
It contains objects from several models and im saving everingthing in
manipulator.save().
Everything works great untill i have to save uploaded file. I wonder if
there is a way to save it
using django
No error message, but I don't know how to populate the
_inline_collections property in FormWrapper. FormWrapper has a
fill_inline_collections method:
def fill_inline_collections(self):
if not self._inline_collections:
ic = []
related_objects = self.manipulator.get_related_obje
Hi winston,
I a couple of weeks ago I was thinking about using this method to solve
one of the pb I was facing. I don't see anything there that should not
work, also I have never done such thing.
Could you please let us know what is exactly your problem? If there is
one, :-), could you also post
Hi,
I'm trying to set up a custom manipulator for a timesheet app. I don't
have the code in front of me at the moment but I'll try to create a
extremely simplified example (they'll be errors since I don't have
Django on this computer to validate the code, but it's
On 4/19/06, PythonistL <[EMAIL PROTECTED]> wrote:
> As to CHANGE manipulator, I do not know how to fill in (prepopulate)the
> form with the data, being changed, from the database. Any idea?
If you want to pre-populate the form data, you just need to be able to
set new_data to hold the data from t
Ian,
Thanks for your reply.
I implemented custom manipulator for ADDing but do not know how to do
that for CHANGING.
class ProductManipulator(formfields.Manipulator):# ADD manipulator
def __init__(self
On 4/18/06, PythonistL <[EMAIL PROTECTED]> wrote:
>
> Is there an example of a CHANGE Custom Manipulator?
> At http://www.djangoproject.com/documentation/forms/
> I found only ADD Custom Manipulator.
The example on this page, under the "Custom forms and manipulators"
Is there an example of a CHANGE Custom Manipulator?
At http://www.djangoproject.com/documentation/forms/
I found only ADD Custom Manipulator.
Thank you.
L.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"D
[EMAIL PROTECTED] schrieb:
> I used the manipulator.py script on the wiki to generate it then made
> the changes I needed.
Ouch. I can't give much of advice about this. Perhaps your manipulator
class should derive from yourModels.Model.ChangeManipulator and it
starts to work. Worth a try. Pleas
I used the manipulator.py script on the wiki to generate it then made
the changes I needed.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-users@goo
[EMAIL PROTECTED] schrieb:
> It appears that I need to have a custom flatten_data() that will
Have you derived it from the automatically (in the model) provided
manipulator?
Michael
--~--~-~--~~~---~--~~
You received this message because you are subscribed to th
Hi,
I currently have a custom manipulator that I wish to use for both
editing and creating new objects. I can create objects using this
manipulator, but am currently incapable of editing an object. I have
tried searching through the msg list and the documentation to no luck.
It appears that I
hello list,
I am trying to get the fantastic javascript caledars in use for my date
fields and found that I need to define them with
default=meta.LazyDate() ... sounds good except that I am using a custom
manipulator ... is there a way to do something like this, or can
someone point me towards
yes, it worked. I hadn't seen that part of the model documentation
about the automatically called validators.
thanks!
Babak,
It shouldn't matter. Take a look at django.core.meta.__init__
manipulator_methods[k[len(MANIPULATOR_FUNCTIONS_PREFIX):]] = v
and
_reassign_globals(manipulator_methods, new_mod,
new_mod.__dict__['AddManipulator'])
_reassign_globals(manipulator_methods, new_mod,
new_mod.__dict__['ChangeManip
rob,
well, i'm doing this in a custom form/view. It's not being done by the
site administrator.
Wait, what? I don't think you need to say object.AddManipulator()
Just put that method in your model, and go to the admin interface. It
should work for both adding and changing an object in the model.
-rob
Yes
so:
if I add the above method to my model, it is going to get called
automatically when i do object.AddManipulator()?
I think I get what your saying... I'm going to check it out and see if
it works.
The "tech support" here is amazing. You are you guys aren't
outsourcing to India?
Hi Babak,
I think you can have the cake. Don't mess with CustomManipulators, just
add this method into your model:
def _manipulator_validate_filefield(self, field_data, all_data):
# if file is not the right type
#raise validators.ValidationError, 'Please enter a valid file
type'
On 11/30/05, bsoltani <[EMAIL PROTECTED]> wrote:
> I'm trying to validate a file upload field to make sure that the users
> uploaded file is of a specific type. I know this can be done with a
> custom manipulator (and in turn a custom validator). However, I still
> wan
I'm trying to validate a file upload field to make sure that the users
uploaded file is of a specific type. I know this can be done with a
custom manipulator (and in turn a custom validator). However, I still
want to be able to use the default manipulator for my object for the
rest of the
Adrian Holovaty wrote:
The automatic manipulators set validator_list automatically, to some
automatic validation functions, but if you want to do things like
checking for uniqueness, you'll have to write the validator function
yourself.
Understood...
The idea was that declaring a field with
On 11/13/05, Maniac <[EMAIL PROTECTED]> wrote:
> Automatic manipulators (ChangeManipulator, AddManipulator) have all
> these nice things like uniqueness validation for fields that was
> declared unique in a model. I'd like to use all this goodness in a
> custom manipulato
Hi!
Automatic manipulators (ChangeManipulator, AddManipulator) have all
these nice things like uniqueness validation for fields that was
declared unique in a model. I'd like to use all this goodness in a
custom manipulator. Is it possible?
I can't seem to figure out how to rig my custom manipulator to save on
an object. It keeps telling me: AttributeError: 'Document' object
has no attribute 'id'
when it saves.
I'm confusored.
Thanks very much Adrian. It did the magic.
Armin
On 10/26/05, Armin <[EMAIL PROTECTED]> wrote:
> The world is different when you have a custom manipulator. It's more
> beautiful, except I can't find any docs on them anywhere.
Agreed on both counts. They're much better than the default
manipulators -- and they n
The world is different when you have a custom manipulator. It's more
beautiful, except I can't find any docs on them anywhere.
Here, I am uploading email in my custom manipulator using:
formfields.ImageUploadField(field_name="photo")
And showing it using {{ form.pho
98 matches
Mail list logo