I'm not sure how to do those tasks:
1. For a model, i want to allow the user to import settings from another
database. For instance, they fill in a number and hit a link or button,
then data is looked up in another database and some of these values
are then filled in the form so that when the user creates an object,
part of the data is prefilled by fetching from another database.
How can i fill in some fields of a form with data?
I think i'll need to make my own Manipulator, defining the fields and
passing default values, right?
Is there an example around somewhere for this?
2. A closely related question in regards to user authentication.
I have a model that also stores the user that is logged.
That user field shouldn't be visible on the form and should be automatically
filled in before the form is saved.
I found something about "follow" that allows one to exclude some fields.
If i then insert the correct user before the data gets validated, is that a
good way of dealing with this problem?
data = ""> if data:
new_data = data.copy()
-> Insert user <-
errors = self.get_validation_errors(new_data)
Thanks,
Benedict
--~--~---------~--~----~------------~-------~--~----~
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 PROTECTED]
For more options, visit this group at http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---
- automatically fill in some fields of a form, storing aut... Benedict Verheyen
- Re: automatically fill in some fields of a form, st... limodou
- Re: automatically fill in some fields of a form... Holger Schurig
- Re: automatically fill in some fields of a form, st... Andres Luga
- Re: automatically fill in some fields of a form... Benedict Verheyen