I think you just need to define a generic model. I dont see how what you are asking is feasible since it would require that (on the fly that migrations are made). You can write a generic model where the types can be represented by a field name.
On Thursday, 5 January 2017 17:33:07 UTC+2, Guilherme Leal wrote: > > My idea was to build an user interface for the model definition, so the > developer (or in this case, the user) could define the model using a > register form. > > Like a user interface to define the model layer, I gess. > > 2017-01-05 12:34 GMT-02:00 Avraham Serour <[email protected] <javascript:>> > : > >> I guess you could play with metaclasses and generate the class definition >> on runtime using information from the database >> >> But why? You can save the model definition on files, why saving them to >> database and complicate your life? >> >> On Wed, Jan 4, 2017 at 10:38 PM, Guilherme Leal <[email protected] >> <javascript:>> wrote: >> >>> Is there a way to populate Django model cache on the fly? >>> I was thinking about saving the model definition on some backend >>> (database for instance) and loading as needed. This way we can basically >>> build a custom admin interface for the model definitions, and load the >>> models (through "type()" or something similar) into the cache "on the fly". >>> >>> Guilherme Leal >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "Django users" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to [email protected] <javascript:>. >>> To post to this group, send email to [email protected] >>> <javascript:>. >>> Visit this group at https://groups.google.com/group/django-users. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/django-users/CAOs3Lp7_R4RK%3DVconoQ1W6rzK8xYaiVJX-FHtyZ3Cxg4MmbOow%40mail.gmail.com >>> >>> <https://groups.google.com/d/msgid/django-users/CAOs3Lp7_R4RK%3DVconoQ1W6rzK8xYaiVJX-FHtyZ3Cxg4MmbOow%40mail.gmail.com?utm_medium=email&utm_source=footer> >>> . >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at https://groups.google.com/group/django-users. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/django-users/CAFWa6t%2B5DO5u8p5fRrGAGkW1KYR2DZxc_wtkNQG7bX3u6v7JuA%40mail.gmail.com >> >> <https://groups.google.com/d/msgid/django-users/CAFWa6t%2B5DO5u8p5fRrGAGkW1KYR2DZxc_wtkNQG7bX3u6v7JuA%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/e00f8c04-8c97-4827-9555-e155c4afd20a%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

