Hi folks,
I am a newforms newbie who is currently porting a .96 project over to
1.0
I have been trying to coerce the examples in the Django documentation
to
accommodate creating a "Document" .
I have three models:
Document, DocPart --> These are in the doc module. DocPart is an
intermediary
Part --> This is in the ipl module. There are hundreds of thousands of
parts.
<><><><><><><><><><>
Simplified models
------------------
class Document(models.Model):
number = models.CharField(max_length=30)
title = models.CharField(max_length=30)
class DocPart(models.Model):
part = models.ForeignKey(mysite.ipl.models.Part)
document = models.ForeignKey(Document)
# in mysite.ipl.models
class Part(models.Model):
number = models.CharField(max_length=30)
description = models.CharField(max_length=30)
<><><><><><><><><>
Forms
---------------------
DocumentForm(ModelForm):
class Meta:
model = Document
<><><><><><><><><><><>
If the user visits the document create page for the first time, in the
view I use:
form = DocumentForm()
DocPartFormset = inlineformset_factory(Document, DocPart)
formset = DocPartFormset()
.
.
.
return render_to_response('document_form.html','form':form,
'formset':formset)
<><><><><><><><><><><>
As expected the page takes a very long time to load since each select
for the DocPart is filled with hundreds of thousands of part numbers.
Since the raw_id_admin has been separated out of the model in 1.0 how
do I get the inlineformset_factory to understand that I want to use
raw_admin_field for part?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---