Well, some more context then:
I've worked at a company that have exactly the same logic writen in perl
and using an ORM built inside the company. The ideia was to build a
plataform to interact with the DB, and with this interaction, extend the
information about the table been created/modified or t
Problem, as you see is that Django is build for static models. So if you
have a dynamic model, how would you construct (efficient) queries in
your other views unless you know the structure of the data?
Well you kind of can't since there is no structure. Also, what purpose
would such a models s
@Jani Tiainen
I really like Django ORM, and will make everything possible to keep it. I
think that losing the ORM will make things harder in the big picture
because it would make the logic built by the developers a lot more error
prone and not "database agnostic" (at least as far as thedatabases ba
Hi,
You're probably after EAV pattern (or anti-pattern depending who you ask).
Implementing that in Django is relatively trivial, though with any kind
of dynamics you'll going to loose most of the ORM goodies.
This kind of leads to question that is Django ORM really needed for you
at all? Ho
@Michal Petrucha
That was one of the insights that I've been wanted.
One way or another I will try, but will keep in mind these points. Thank
you!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving
ango-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Vijay Khemlani
Sent: Thursday, January 5, 2017 4:00 PM
To: django-users@googlegroups.com
Subject: Re: Dynamic Models
"That was exacly the points i'm willing to avoid.
Had any problems with the metaclass approach? W
"That was exacly the points i'm willing to avoid.
Had any problems with the metaclass approach? Why did you chose the
"virtual model" concept?"
We had to represent multiple product categories, each with their own
structure and particular fields.
In the end we had around 700 virtual models, which
On Wed, Jan 04, 2017 at 06:38:54PM -0200, Guilherme Leal 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
@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Guilherme Leal
Sent: Thursday, January 5, 2017 1:06 PM
To: django-users@googlegroups.com
Subject: Re: Dynamic Models
@Matthew Pava
>Going down that route, we would basically be developing an IDE for Django
>models
Well, th
@
> googlegroups.com] *On Behalf Of *Guilherme Leal
> *Sent:* Thursday, January 5, 2017 12:28 PM
> *To:* django-users@googlegroups.com
> *Subject:* Re: Dynamic Models
>
>
>
> @*ludovic coues*
>
> Like what? let the interface generate the python models? I thought about
>
Python including its models, though it’s not Django.
From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On
Behalf Of Guilherme Leal
Sent: Thursday, January 5, 2017 12:28 PM
To: django-users@googlegroups.com
Subject: Re: Dynamic Models
@ludovic coues
Like what? let the
@ludovic coues
Like what? let the interface generate the python models? I thought about
that, but it doesnt seem viable. Have any ideias?
2017-01-05 16:26 GMT-02:00 ludovic coues :
> Would it work if the interface provide a download for a bunch of
> models.py file ?
>
> 2017-01-05 19:12 GMT+01:00
@Vijay Khemlani
- No ORM unless you implement it
- No DB integrity checks
That was exacly the points i'm willing to avoid.
Had any problems with the metaclass approach? Why did you chose the
"virtual model" concept?
2017-01-05 16:12 GMT-02:00 Vijay Khemlani :
> I had to implement dynamic models
Would it work if the interface provide a download for a bunch of
models.py file ?
2017-01-05 19:12 GMT+01:00 Vijay Khemlani :
> I had to implement dynamic models for our project.
>
> In the end we represented them in four django models, two for the
> "virtual models" and its fields and two for the
I had to implement dynamic models for our project.
In the end we represented them in four django models, two for the
"virtual models" and its fields and two for the actual data
We used the django model system for these four base classes, but the
"virtual models" on top of them were custom (so no
I know metaclasses, and i know that the django models uses some "meta class
magic" to register the models on the model cache.
I gess i need to test the implication of refreshing the model cache on the
fly, since it doesn't have a "natural" way to refresh itself.
2017-01-05 14:05 GMT-02:00 Avraham
you should read about metaclasses, basically it enables you to build class
definitions in runtime.
http://stackoverflow.com/questions/13/what-is-a-metaclass-in-python
On Thu, Jan 5, 2017 at 6:02 PM, Guilherme Leal wrote:
> The "migrations on the fly" thing dont get to be a problem (since I
The "migrations on the fly" thing dont get to be a problem (since I gess we
could call the migrations api to generate the migration).
My concenrs would be contructing and refreshing the model cache (I say the
"model cache" like the list accessed through django.apps.get_models() ),
and the OBVIOUS p
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, Guilh
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 :
> I guess you could play with metaclass
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 wrote:
> Is there a
Hello André,
I wonder if you successfuly found a way to achieve what you were talking in
this post. Actually, I am looking for something similar. Instead of
uploading .csv my app would allow users to upload shapefile. I am reading
about dynamic models but the doc is scarce. If you can share a b
Thanks for the quick reply, Shawn!
The reason I wanted to use Django was so that I could leverage the ORM to
allow users to do arbitrary SQL filtering/grouping before the data gets
saved onto the production DB.
Assuming a 1.5 million lines CSV file (which is probably the smallest file
users would
I don't see where Django comes in -- at least not for the core of the
app. Python certainly, with the xlwt and xlrd modules being incredibly
helpful.
Secondly, I'd use MongoDB (via pymongo) to store the temporary data,
because I wouldn't bet a nickel that you'll get data in a consistent
forma
On Fri, 2008-07-04 at 09:28 -0700, mwebs wrote:
> Hello,
>
> I am trying to generate models at runtime. For this purpose I am using
> the method create_model() provided at
> http://code.djangoproject.com/wiki/DynamicModels
>
> create_model(name, fields, module='app.models' )
>
> When I am doin
On Jan 11, 2008 10:39 AM, WoonZai <[EMAIL PROTECTED]> wrote:
> >>> model = create_model('Empty')
> Traceback (most recent call last):
> File "", line 1, in
> File "/Users/../models.py", line 36, in create_model
> return type(UserForm, (models.Model,), attrs)
> File "/.../site-packages/d
26 matches
Mail list logo