How to import models from other sibling app in Django - python-3.x

i create a project in django
in this project i am use the no. of app like
home ,payment
i am create some models in home/model.py file
and i want to use this model as a ForeignKey in payment/model.py file but i can't access and implode that file on this location i am using no. of method but it's give me some error.
show please help me how to access this file on this location
Thank You

This is how you can import your models module from CoupoonCode library
from home.models import CoupoonCode

Related

import module issue in a Django project: error ModuleNotFoundError

OS: Ubuntu
Django 4.1.6
I run into a very unexpected issue. I have created a Django project named data base. In this project I have created several apps (administrative, api, real_estate, telegram_app ...) with python manage.py startapp <app_name> inside the root folder.
Project structure with apps
I have added each app on the settings INSTALLED_APP.
settings.py file
Each of my apps apart from api and telegram_app have models. I have created in each app the corresponding admin.py.
After creating a New sqlite data base and the superuser i Can go to my admin site and manage each model of each app.
admin site with all modules models
So far so good then. My issue Come later. Now I want my telegram app and my api app to access models from other apps. So nothing wierd or fancy here.
But when I import model to use it I run into the error no module with that name.
error No Module name
Andy help?
I tried to change the import from database.api to api with the same result:
error 2
and also from ..api:models import but with the same result

NLog In a Class Libray can not write data to sqlite3 database

i config nlog in a c# class library named "common",added target to sqlite3 database, and add a other windows form application named "NLogtest", i was planned add "common" as a refrence in NLogtest. call loghelper class in common to write log, when write to log file it works fine, but when write to database it doesn't work.
so my question is can or can not config nlog in a class lib?
thanks to Rolf, the dbProvider it is a critical point. and after teat i have found that NLog.Database.dll and System.Data.SQLite.dll have to exist in the base directory where the exe at. you can copy these two dll from somewhere else or import from Nuget manager. then it would be work just fine.
enter image description here

created an app called users ,want to use "from users import views as v" .Already made changes in settings.py file. But it says unreferenced error?

from users import views is not working
I created two apps. the first one works fine. The same way I created another app called as users. But when I import it, it says unreferenced error. I already added it in installed apps in the main settings.py file of the project.
There are two apps. The first one is working fine. The second one is giving error when I import it. It says unreferenced error
Change url :
add urls.py in users.
and add this line:
from user import views as v_register
and add this line in blog url.
path('users/', include(users.urls)),

Jhipster using custom entity-client sub-generator

I am trying to create a blueprint for entity-client sub-generator by following the official guide. Tried several times. But when I try to use the generated blueprint, while importing jdl, it always says
Trying to use blueprint generator-jhipster-helloworld
WARNING! No blueprint found for entity-client falling back to default generator
then it generates the entity clients in the default way.
I can see the blueprint is linked into the node-modules folder of the generated app.
If anybody has created a simple working "entity-client sub-generator" blueprint, Please share the code with me. For example, "that adds <h1>lorem ipsum<h1> on the top of component.html file for the generated client of entity (on importing a simple jdl with just one entity)" would be sufficient.
Sample JDL
entity Item{
code String required,
description String required,
quantity Integer required
}
Best Regards.

Can I create multiple products with one Shopify API call or CSV import?

Is there any way to create and update products programmatically with csv import or by api calls ?
I am using Nodejs for the application.
Thanks
You cannot create multiple products in a single shopify api call [Refer this]. But, yes you can import multiple products by uploading csv file from store admin panel [Refer this].
EDIT: You cannot import csv programatically.

Resources