Skip to content

Modelset filter doesn't work in other DB except 0 #71

Open
@XinfuZheng

Description

@XinfuZheng

I have multiple dbs to store data. If I specify the db 1 in model class as below:
class Param(models.Model):
Name = models.Attribute(required=True, unique=True)
class Meta:
indices = ['Name']
db = redis.Redis(host="127.0.0.1", port=6379, db='1')

The object creation is successful, the object will be created and stored in db 1. But with Param.objects.filter(Name='xxxx'), the resultset is empty.
If I don't have this db specification in model class meta, the creation and query both work.

Anyone aware of this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions