Closed wylswz closed 6 years ago
Hi this looks like a genuine djongo issue. Django connector expects several interfaces to be implemented and not all up yet! these will be implemented at some time.
@nesdis any suggestion how can we resolve this issue and please explain to me, I will work on this issue and contribute to this project. My problem is i want to write unit tests for our DRF API. But Django will create database so we are getting
I am stuck :(
In file introspection.py in djongo, you must implement the get_constraints
function. The function takes in the collection name and returns a dict of properties.
You need to use pymongo commands to get the constraints for different fields.
Some constraints like primary key, have no meaning in mongoDB, You need to store the primary key field name in schema , and return this in this function.
Indexing support needs to be added to djongo, you can then return indexed fields.
Returns a dict mapping constraint names to their attributes, where attributes is a dict with keys:
Hi guys,
Your solution looks greats!
But I have the same issue:
(fifa_mongo) C:\Users\alexk\development\projects\python\fifa_mongo>manage.py migrate --settings=settings_dev
Operations to perform:
Apply all migrations: admin, auth, contenttypes, django_celery_results, flows, frontend, sessions, viewflow
Running migrations:
Applying contenttypes.0001_initial... OK
Applying auth.0001_initial... OK
Applying admin.0001_initial... OK
Applying admin.0002_logentry_remove_auto_add... OK
Applying contenttypes.0002_remove_content_type_name... OK
Applying auth.0002_alter_permission_name_max_length... OK
Applying auth.0003_alter_user_email_max_length... OK
Applying auth.0004_alter_user_username_opts... OK
Applying auth.0005_alter_user_last_login_null... OK
Applying auth.0006_require_contenttypes_0002... OK
Applying auth.0007_alter_validators_add_error_messages... OK
Applying auth.0008_alter_user_username_max_length... OK
Applying django_celery_results.0001_initial... OK
Applying viewflow.0001_initial... OK
Applying viewflow.0002_fsmchange... OK
Applying viewflow.0003_task_owner_permission_change... OK
Applying viewflow.0004_extend_fields_length... OK
Applying viewflow.0005_rename_flowcls... OK
Applying viewflow.0004_subprocess... OK
Applying viewflow.0005_merge... OK
Applying viewflow.0006_merge... OK
Applying viewflow.0007_owner_permission_obj... OK
Applying viewflow.0006_i18n...Traceback (most recent call last):
File "C:\Users\alexk\development\projects\python\fifa_mongo\manage.py", line 22, in
CONTEXT: OS: Windows 10 IDE: PyCharm 2017.3 Python: 3.6.2 Mongo cluster
SETTINGS: ` ... INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', 'django_celery_results', 'django_extensions', 'material', 'material.frontend', 'viewflow', 'viewflow.frontend', 'fifa.flows', ] ... MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', ]
ROOT_URLCONF = 'fifa.urls'
TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [], 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ 'django.template.context_processors.debug', 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', ], }, }, ]
WSGI_APPLICATION = 'wsgi.application' ... MIDDLEWARE.insert(0, 'debug_toolbar.middleware.DebugToolbarMiddleware')
DATABASES = { 'default': { 'ENGINE': 'djongo', 'NAME': 'fifa_mongo', 'HOST': 'dev-hybrid-mongodb-service-us', 'PORT': 27017, } } .... `
Please, could you provide me some more detailed solution? Thank you!
Get constraints has been implemented, you may want to clone the latest version and check if it works for your project
Hi guys,
Thank you for the update!
The "pip install djongo==" shows me the last version is 1.2.9 Collecting djongo== Could not find a version that satisfies the requirement djongo== (from versions: 1.1, 1.2, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9) No matching distribution found for djongo==
Should we ignore the "pip install" and try to work via cloning of the project?
Thank you!
Yes clone the project..
On 06-Dec-2017 1:00 AM, "ayakut" notifications@github.com wrote:
Hi guys,
Thank you for the update!
The "pip install djongo==" shows me the last version is 1.2.9 Collecting djongo== Could not find a version that satisfies the requirement djongo== (from versions: 1.1, 1.2, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.2.7, 1.2.8, 1.2.9) No matching distribution found for djongo==
Should we ignore the "pip install" and try to work via cloning of the project?
Thank you!
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nesdis/djongo/issues/11#issuecomment-349414586, or mute the thread https://github.com/notifications/unsubscribe-auth/AQO4BL_o4QhDn7bNfEHYYJoaITEZ4UIUks5s9Zm-gaJpZM4Pexty .
A new version has been updated to pip as well. get_constratins has been implemented
Hi guys!
Thanks a lot for the update and for your supporting!
One line description of the issue
I was migrating my django project from MySQL to mongodb. When I apply the migration, this issue occurs. It seems like it's not working well with restframework.
Python script