Here I am creating django dynamic models but for getting data i am using
get method but i am not getting data it just says that table does not exist
even if it is present.
from django.http import JsonResponse
from.serializers import CreateTableSerializer
from django.db import connection
Hi All,
I'm working on an API-server project that uses dynamically generated Django
models, so it can service many user-provided datasets. To ease maintenance
work, we'd like to generate the SQL statements to migrate database tables
to a newer version of the schema. I've managed to use the inte
en-to-use-nosql) instead; and
> explore the use of its associated technologies which can meet your stated
> requirements.
>
> On Thursday, 10 March 2022 at 01:55:18 UTC+2 Ryan Nowakowski wrote:
>
>> On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
>> >
10:05AM +0530, Prashanth Patelc wrote:
> > How to create dynamic models in django rest framework?
> > Is there any chance to create dynamic models with APIs
> >
> > Any examples please send me thanks in advance..
> >
> > 1) Requirement is need create table name and
On Sun, Feb 27, 2022 at 09:10:05AM +0530, Prashanth Patelc wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
>
> Any examples please send me thanks in advance..
>
> 1) Requirement is need create table
On 28 Feb 2022, at 16:24, Prashanth Patelc wrote:
Any example?
Just read the django-extra-views documentation. Essentially a formset
can be as simple to use as any of the built-in class-based views, eg:
from extra_views import InlineFormSetView
class EditContactAddresses(InlineF
Any example?
On Mon, Feb 28, 2022, 5:27 PM Clive Bruton wrote:
>
> On 27 Feb 2022, at 17:54, Steve Smith wrote:
>
> > ...the documentation on Formsets is scarce in my opinion and to get
> > them to work is a lot of trial and error...
>
> To massively simplify formsets try django-extra-views
>
>
On 27 Feb 2022, at 17:54, Steve Smith wrote:
...the documentation on Formsets is scarce in my opinion and to get
them to work is a lot of trial and error...
To massively simplify formsets try django-extra-views
-- Clive
--
You received this message because you are subscribed to the Googl
Check out the api mentioned here
https://stackoverflow.com/questions/34768732/temporary-models-in-django#48042468
On Sun, 27 Feb 2022, 03:42 Prashanth Patelc,
wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
&
From: django-users@googlegroups.com on behalf
of Antonis Christofides
Sent: Sunday, February 27, 2022 12:58 AM
To: django-users@googlegroups.com
Subject: Re: How to create dynamic models in django??
Short answer: I don't know. It probably isn't straightforward, but it's doable
Refer here.https://docs.djangoproject.com/en/4.0/topics/db/models/
On Sun, Feb 27, 2022, 06:42 Prashanth Patelc
wrote:
> How to create dynamic models in django rest framework?
> Is there any chance to create dynamic models with APIs
>
> Any examples please send me thanks in adv
In my experience you should avoid doing such things—it's likely to lead to an
unmanageable code mess. Keep it simple. Consider working without a relational
database.
Regards,
Antonis
Antonis Christofides
+30-6979924665 (mobile)
On 27/02/2022 05.40, Prashanth Patelc wrote:
How to create
How to create dynamic models in django rest framework?
Is there any chance to create dynamic models with APIs
Any examples please send me thanks in advance..
1) Requirement is need create table name and fields in frontend
2) we are getting the data and store in to the db create db structure
3
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
t;.
>>
>> Guilherme Leal
>
> Hi Guilherme,
>
> I kinda got lost deeper in the reply chain in this thread, but
> regarding the original question, have you had a look at
> https://djangopackages.org/grids/g/dynamic-models/ ? django-mutant, in
> particular, seems to
had a look at
https://djangopackages.org/grids/g/dynamic-models/ ? django-mutant, in
particular, seems to be quite close to what you're asking for. Even if
it's not a direct solution for you, you might be able to take a lot of
inspiration from there.
However, keep in mind that any kind o
@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
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 actual data
> >
> > We used th
@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 implem
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
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 the
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
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 some
gt;>> Em ter, 17 de mar de 2015 às 08:27, Django User
>>> escreveu:
>>>
>>> hello,
>>>> we are working on an application where users can register new types of
>>>> data streams through Django. so it requires a mechanism to create new
>&
w types of
>>> data streams through Django. so it requires a mechanism to create new
>>> tables (cassandra) on the fly. what is the best Djangoish way to implement
>>> such dynamic models? pls. let us know. thanks in advance.
>>>
>>> --
>>>
register new types of
>> data streams through Django. so it requires a mechanism to create new
>> tables (cassandra) on the fly. what is the best Djangoish way to implement
>> such dynamic models? pls. let us know. thanks in advance.
>>
>> --
>> You rece
cation where users can register new types of
> data streams through Django. so it requires a mechanism to create new
> tables (cassandra) on the fly. what is the best Djangoish way to implement
> such dynamic models? pls. let us know. thanks in advance.
>
> --
> You received this
hello,
we are working on an application where users can register new types of data
streams through Django. so it requires a mechanism to create new tables
(cassandra) on the fly. what is the best Djangoish way to implement such
dynamic models? pls. let us know. thanks in advance.
--
You
On Sat, Jun 8, 2013 at 2:11 AM, enemytet wrote:
> I learn dynamic models in Django but I don't understand when to use them.
>
> What are the best examples of the use of dynamic models? (real situation)
>
My advice - Don't. Ever.
If you find yourself in a situation where
I learn dynamic models in Django but I don't understand when to use them.
What are the best examples of the use of dynamic models? (real situation)
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this
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
Hi,
New user to Django. I have a class 'Server' and I want to set up my Django
site so that when a server is added through the admin interface, an
additional model along with its admin.ModelAdmin class are added. So say a
server 'Crushinator' is added to the database of servers. At its creat
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
the results of a query to the permanent table.
I'd really appreciate any help you can give me at all.
Thank you in advance
Sincerely,
André Terra (airstrike)
[1] https://code.djangoproject.com/wiki/DynamicModels
[2]
http://family.ubuntu-fl.org/mhall/fun-with-django-meta-classes-and-dynamic-m
Hi Matthias ,
Thank you, I went for option 1 and it works perfectly!
Funny, the add_to_class function basically does "setattr(cls, name,
value)". So I had the right solution, only you have to do this after
class creation, not inside its __init__ function. Good to know, will
blog about this :)
Ag
On Thu, Nov 26, 2009 at 9:56 AM, Kevin Renskers wrote:
> Just a small update: the DynamicModels way as described on the wiki
> doesn't work (it also says that it only works in Django 0.96, so
> yeah..).
>
> If anyone has any idea how to do this, I would be very thankful!
>
>
> On Nov 24, 2:35 pm,
Just a small update: the DynamicModels way as described on the wiki
doesn't work (it also says that it only works in Django 0.96, so
yeah..).
If anyone has any idea how to do this, I would be very thankful!
On Nov 24, 2:35 pm, Kevin Renskers wrote:
> Hi all,
>
> In my Django project I want to h
Hi all,
In my Django project I want to have a model that is dynamically
created. I tried using the __init__ function for this, something like
so:
fields = ['field_a', 'field_b', 'field_c']
class MyModel(models.Model):
def __init__(self, *args, **kwargs):
for field in fields:
ror
> 'project.src.app.models'
>
> Any ideas what I am doing wrong.
Quite seriously, if you're not able to debug this sort of error
yourself, given the source code for create_model() and the internals of
Django it calls, then you probably shouldn't be creating dynamic mo
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 doing like this i get a keyError '__module__'
then I tried to pass the
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
Hi, I was trying to follow the example on Dynamic Models over here but
it didn't work for me. [http://code.djangoproject.com/wiki/
DynamicModels]
I copied the code for def create_model in the file models.py, and when
I try to create a model in the shell, I have the following errors.
>
55 matches
Mail list logo