Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread Michael Newman
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):

Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread Michael Newman
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

Re: Custom Validator inside of a Custom Manipulator

2007-10-20 Thread [EMAIL PROTECTED]
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

Custom Validator inside of a Custom Manipulator

2007-10-19 Thread Michael Newman
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

Custom Manipulator and update foreign key pointer

2007-01-16 Thread jeffhg58
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 =

Re: Custom manipulator, default form?

2007-01-16 Thread Aidas Bendoraitis
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

Custom manipulator, default form?

2007-01-16 Thread Rob Slotboom
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? --

Re: custom manipulator in admin

2006-12-20 Thread Rob Slotboom
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

Re: custom manipulator in admin

2006-12-20 Thread Aidas Bendoraitis
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

Re: custom manipulator in admin

2006-12-20 Thread Rob Slotboom
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

Re: custom manipulator in admin

2006-12-20 Thread patrick k.
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

custom manipulator in admin

2006-12-19 Thread 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 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

Re: custom manipulator and setting a default in select element (drop down) (SOLVED)

2006-12-19 Thread Benedict Verheyen
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

custom manipulator and setting a default in select element (drop down)

2006-12-19 Thread Benedict Verheyen
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

Re: Populating select field in custom manipulator

2006-11-30 Thread [EMAIL PROTECTED]
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 --~-

Populating select field in custom manipulator

2006-11-29 Thread jeffhg58
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']

custom manipulator check if field is filling

2006-11-08 Thread Grigory Fateyev
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 =

Re: Custom manipulator

2006-10-31 Thread [EMAIL PROTECTED]
; > 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

Re: Custom manipulator

2006-10-30 Thread Jorge Gajon
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.

Custom manipulator

2006-10-28 Thread [EMAIL PROTECTED]
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-23 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-23 Thread 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 explained in the last > few mails by reading the documentation. > e.g., I´m quite sure that there´s no explanation of "

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-22 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread 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 does the custom manipulator gets the data (stored > in the database) from. > the way I did it so

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread Ivan Sagalaev
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread patrickk
; 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 &

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread Ivan Sagalaev
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread Ivan Sagalaev
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread Ivan Sagalaev
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-21 Thread Aidas Bendoraitis
. 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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-20 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-20 Thread 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 using contemporary Django it should look like this: temp.music = Music.ob

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-20 Thread patrickk
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

Re: seeking clarification: custom manipulator foreign key / many-to-many

2006-09-20 Thread Ivan Sagalaev
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

seeking clarification: custom manipulator foreign key / many-to-many

2006-09-20 Thread va:patrick.kranzlmueller
=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

Custom manipulator save() function problem

2006-09-07 Thread Gacha
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

Custom manipulator save() function problem

2006-09-07 Thread Gacha
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

Re: Saving ManyToMany relationships in custom manipulator

2006-08-30 Thread Russell Keith-Magee
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

Re: Saving ManyToMany relationships in custom manipulator

2006-08-30 Thread Nowell
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. --~--~

Re: Saving ManyToMany relationships in custom manipulator

2006-08-24 Thread James Mulholland
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

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Ivan Sagalaev
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

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Russell Keith-Magee
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']:

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread Ivan Sagalaev
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

Re: Saving ManyToMany relationships in custom manipulator

2006-08-23 Thread James Mulholland
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 >

Saving ManyToMany relationships in custom manipulator

2006-08-22 Thread James Mulholland
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

Re: custom manipulator - TextField or SelectField in RadioSelectField?

2006-08-14 Thread Chris Kelly
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

Re: custom manipulator - TextField or SelectField in RadioSelectField?

2006-08-14 Thread John Sutherland
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.

custom manipulator - TextField or SelectField in RadioSelectField?

2006-08-13 Thread Chris Kelly
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

Re: File upload and custom manipulator

2006-08-05 Thread didier Belot
.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

Re: File upload and custom manipulator

2006-08-04 Thread [EMAIL PROTECTED]
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

File upload and custom manipulator

2006-08-04 Thread didier Belot
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

Re: Custom Manipulator SelectField "blank" option

2006-07-24 Thread [EMAIL PROTECTED]
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

Re: Custom Manipulator SelectField "blank" option

2006-07-19 Thread Paul Childs
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

Re: Custom Manipulator SelectField "blank" option

2006-07-19 Thread [EMAIL PROTECTED]
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

Custom Manipulator SelectField "blank" option

2006-07-19 Thread Paul Childs
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

Re: Custom Manipulator problem

2006-07-14 Thread Robert
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

Re: Custom Manipulator problem

2006-07-14 Thread Jorge Gajon
'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

Re: Custom Manipulator problem

2006-07-14 Thread Jorge Gajon
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&

Custom Manipulator problem

2006-07-14 Thread Robert
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

Re: M-R / ImageField / file upload / custom manipulator

2006-06-15 Thread [EMAIL PROTECTED]
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

Re: ManyToMany in a custom manipulator?

2006-06-13 Thread mazurin
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

ManyToMany in a custom manipulator?

2006-06-13 Thread mazurin
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

M-R / ImageField / file upload / custom manipulator

2006-05-30 Thread funk
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...

Re: Custom manipulator and file upload/saving

2006-05-03 Thread Denis
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

Re: Custom manipulator and file upload/saving

2006-05-03 Thread Ivan Sagalaev
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

Custom manipulator and file upload/saving

2006-05-03 Thread Denis
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

Re: Custom manipulator - multiple records

2006-05-01 Thread Winston Lee
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

Re: Custom manipulator - multiple records

2006-05-01 Thread yml
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

Custom manipulator - multiple records

2006-04-29 Thread Winston Lee
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

Re: Custom Manipulator

2006-04-19 Thread Ian Clelland
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

Re: Custom Manipulator

2006-04-19 Thread PythonistL
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

Re: Custom Manipulator

2006-04-18 Thread Ian Clelland
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"

Custom Manipulator

2006-04-18 Thread PythonistL
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

Re: Loading Data Custom Manipulator

2006-04-04 Thread Michael Radziej
[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

Re: Loading Data Custom Manipulator

2006-04-04 Thread [EMAIL PROTECTED]
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

Re: Loading Data Custom Manipulator

2006-04-04 Thread Michael Radziej
[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

Loading Data Custom Manipulator

2006-04-04 Thread [EMAIL PROTECTED]
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

LazyDate in custom Manipulator

2006-03-01 Thread [EMAIL PROTECTED]
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

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
yes, it worked. I hadn't seen that part of the model documentation about the automatically called validators. thanks!

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
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

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
rob, well, i'm doing this in a custom form/view. It's not being done by the site administrator.

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
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

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
Yes

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
so: if I add the above method to my model, it is going to get called automatically when i do object.AddManipulator()?

Re: Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
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?

Re: Adding a validator a custom manipulator

2005-11-30 Thread oggie rob
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'

Re: Adding a validator a custom manipulator

2005-11-30 Thread Adrian Holovaty
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

Adding a validator a custom manipulator

2005-11-30 Thread bsoltani
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

Re: Uniqueness validation in custom manipulator

2005-11-13 Thread Maniac
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

Re: Uniqueness validation in custom manipulator

2005-11-13 Thread Adrian Holovaty
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

Uniqueness validation in custom manipulator

2005-11-13 Thread Maniac
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?

Custom Manipulator Save

2005-10-27 Thread Brant Harris
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.

Re: Custom Manipulator File Upload

2005-10-26 Thread Armin
Thanks very much Adrian. It did the magic. Armin

Re: Custom Manipulator File Upload

2005-10-26 Thread Adrian Holovaty
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

Custom Manipulator File Upload

2005-10-26 Thread Armin
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