porton
porton

Reputation: 5803

Django model prevent saving to database

It seems that I already asked this question and got an answer, but I can't find it.

How to make a Django model not stored in the DB? I want it to be a model (derived from models.Model) only in order to be able to retrieve it with get_model() method.

Upvotes: 1

Views: 1076

Answers (1)

nik_m
nik_m

Reputation: 12086

class MyModel(models.Model):
    # model fields here

    class Meta:
        managed = False

More on this in the managed setting.

Upvotes: 1

Related Questions