Benedict Verheyen schreef:
> == ChangeManipulator ==
> class TeamverslagChangeManipulator(Teamverslag.ChangeManipulator,
> CustomManipulator):
> default = {}
> done = False
>
> def __init__(self,object_id):
> # Construct the fields an
Hi,
here we use dates as dd/mm/. Therefore, i have to use custom
manipulators to add and change objects.
What i do is this. If the user clicks on an objectline to change the
record, the ChangeManipulator will format the dates the way i want and
display them.
On submitting the form, the dates
Hi,
You don't have a manipulator.flatten_data() call in your view. This is
what fills in those fields.
Take a look at django.contrib.admin.views.main.change_stage to see how
it is used.
-rob
Robert,
Thank you. I checked the link and made the changes in my source.
That is a pity that the doc is not up-to-date.
Regards,
L.
PythonistL wrote:
> Robert,
> Thank you for your reply.
> I am not still an expert( only a beginner) on Django. I tried to copy
> the example from
> http://www.djangoproject.com/documentation/forms/
> and there was no mention about manipulator.flatten_data() .
> Is there any example /description
Robert,
Thank you for your reply.
I am not still an expert( only a beginner) on Django. I tried to copy
the example from
http://www.djangoproject.com/documentation/forms/
and there was no mention about manipulator.flatten_data() .
Is there any example /description how to use manipulator.flatten_d
PythonistL wrote:
> Robert,
> no manipulator.flatten_data() is not nescessary for that.
But, it is extremely stupid not to use it, because that will cause your
form to break if you use any of a wide number of features : foreignkeys,
dates, inline editing, raw_id admin, etc etc. It pretty much
Robert,
no manipulator.flatten_data() is not nescessary for that.
Meanwhile I solved the problem.
The reason why it did not work was the fact that I used
in my template
name="{{Login}}"
instead of
{{form.Login}}
only.
Thank you all for your time and help
regards,
L.
> (FYI, the method I was referring to is created by "magic", and has
> probably already been removed from the magic-removal branch. It is
> django.core.meta.manipulator_flatten_data(), but since this is tied so
> closely into the admin code it probably wouldn't do much for you. Sorry
> to send you
Rob,
Thank you for your reply.
But I am passing the parameters ( the all form's values) like this
return render_to_response('board/TestCreateUserForm', {'form': form})
but stil does not work that is
the form fields do NOT
contain the current values of the object when editing.
But why?
Thank
PythonistL says:
> There is no command like
> new_data = manipulator.flatten_data()
Ahh, woops!
I've had my head in admin code so much lately I forgot this wasn't a
standard manipulator method.
(FYI, the method I was referring to is created by "magic", and has
probably already been removed from t
Rob,
I made my posted sample according to the example at
http://www.djangoproject.com/documentation/forms/
There is no command like
new_data = manipulator.flatten_data()
only
new_data = user.__dict__
Eventhough I tried manipulator.flatten_data(), it did not help.
So, where is the problem then.
T
Hi all,
How can I force the ChangeManipulator so that the form fields will
contain the current values of the object when editing?
I have the model:
###
class User(meta.Model):
Login=meta.CharField(maxlength=50,unique=True)
Password=meta.CharField(maxlength=30)
E
13 matches
Mail list logo