On 12/3/07, omat <[EMAIL PROTECTED]> wrote:
> In the actual case I have more fields in the Record model, and
> repeating those fields in the Review model is not DRY.

Ah, I see now. Using just "a" "b" and "c", I didn't realize they
actually mapped directly to the other model.

> If I create a model with "new" and "comment" and relate it to the
> Review, what would be the type of the field of the "new"?

You're right, that wouldn't really work for this case, now that I
understand you better.

> I want them to be, say, DateField for date fields, and an Integer
> field for integer fields, depending on the field type in the Record
> model.

Well, this is definitely possible, but whether or not it's easy
depends on a couple things.

* How many fields are we talking about?
* Is Record the only model you'll be doing this with?

Basically, it's quite possible to create the Review model dynamically,
based on fields from Record. But doing so would require a good bit of
code (probably more than just duplicating the fields), and it might
make everything less readable.

However, if you have 50 fields, or if you're doing this on a dozen
models, it might still be worth your while. Let me know what your
situation is like, and I can help you proceed.

-Gul

--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to