Альберт
cart = models.ForeignKey(Cart, verbose_name='корзина', on_delete=models.CASCADE, related_name='related_products') NameError: name 'Cart' is not defined
Oumaima
hello can someone tell me how to change admin interface
Bunty chhatri wala..
https://dpaste.org/DFpp
Only 1 relationship is enough.. Either use productAdd in Cart or use Cart in ProdutAdd.. It is showing error because Cart model is defined below the product Model.. I'm not sure..but maybe this is the issue..you can make some change according to this .or ask from a professional
Альберт
I link them , it should not give an error
Mirco
I link them , it should not give an error
Did you understand what the error says ? Do you have an idea ?
Mirco
It's not a Django ORM error, it's a simple python error, if you have doubts study better Python
Anonymous
NameError: name 'Cart' is not defined
This means it didn't find the class Cart, either u didn't define a class or u used the class before defining it
Sacs
Please which model field type should i use I want to print out results of something
Mirco
Please which model field type should i use I want to print out results of something
Results of which type ? Why u need to save them ? Give more context
Anonymous
Can any one help me As I am not sure what to put in django's Sitemap framework -> ping_google function's *ping_url* parameter? Like which URL exactly we have to put here?
Sacs
Results of which type ? Why u need to save them ? Give more context
I will push an sms via post method So i want to display it
Sacs
Display it where ?
On a site Am working on django rest framework
Mirco
On a site Am working on django rest framework
And why you cannot show that message via SMS and via a pop-up like a notification into the web app ? Instead of saving it into the db
Sacs
?
Mirco
I want it to be 100%cloud base
What is the relation with a pop-up and sms ? You can still use a cloud based service for the sms sending and show a notification with same data
Mirco
Am building everything my self😅
Anyway to answer your first question a CharField could be enough if you don't exceed 255 chars
Pradip
Help me I was developing oder management system using django ,I want to calculate final amount of order without cart methods also need to generate pdf invoice
Anonymous
I am getting missing 1 required positional argument:on_delete
on the model part you have defined using a ForeignKey() in its argument include on_delete=models.CASCADE
Tzipi
Hi, question in Django: This is the models I have: # Handle users class User(models.Model): email = models.EmailField(unique=True) fullname = models.CharField(max_length=100, default='Unknown') number_of_posts = models.IntegerField(default=0) # handle post : Relate many -> one to user class Post(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) post_text = models.CharField(max_length=150) number_of_likes = models.IntegerField(default=0) When I’m saving new post(that has a field - FK to User) , I want to increment the number_of_posts field in User class that stands as user property innPost class. model (/class). I don’t want new post will be created without it. I tried to do overload to save() in Post: # Save post and update User numerator @classmethod def save(self,user,*args, **kwargs): self.user.number_of_posts += 1 self.user.save() if not self.id: super(Post, self).save(user ,*args, **kwargs) But I receive tan error that ‘ number_of_posts’ field is not recognised on User. How can I implement it?
{{Obj.name}}
hi people
{{Obj.name}}
Im new Django
{{Obj.name}}
but i will work with Django and Docker
Sai
Hi all I had all the makemigrations and migrate in django but while I am adding data into the server I am getting the error as "operational error, no such table found" Guys please solve this issue
Anonymous
Hi i am teying to fetch a dynamic image on a popup how to do it..pls anyone?
Ani
the models are represented, how can I increment a field in User from Post connected to saving new instance of Post. Thanks. # Handle users class User(models.Model): email = models.EmailField(unique=True) fullname = models.CharField(max_length=100, default='Unknown') number_of_posts = models.IntegerField(default=0) # handle post : Relate many -> one to user class Post(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) post_text = models.CharField(max_length=150) number_of_likes = models.IntegerField(default=0)
Ani
I can’t see the connection ... autofield is , fir what I know created auto...
shivam kumar
Can anyone make otp authentication system and connect with mysql
Anonymous
How do I setup or install docker in Django
Anonymous
??
Anonymous
Any idea
{{Obj.name}}
pip install django
{{Obj.name}}
its in the documentation
Anonymous
Django is already installed
R.U.S.H.A.B.H
Hi i am teying to fetch a dynamic image on a popup how to do it..pls anyone?
Just call the image in img tag on html with for loop
Muhammed
On Google search
The mint of Linux **
Anyone expert...with Google search console??
R.U.S.H.A.B.H
Hello I want to make team/ group of users ... For that I need another model (I don't know logic behind the making team) ... Can anybody help me 🗣️
Ani
the models are represented, how can I increment a field in User from Post connected to saving new instance of Post. Thanks. # Handle users class User(models.Model): email = models.EmailField(unique=True) fullname = models.CharField(max_length=100, default='Unknown') number_of_posts = models.IntegerField(default=0) # handle post : Relate many -> one to user class Post(models.Model): user = models.ForeignKey(User, on_delete=models.CASCADE) post_text = models.CharField(max_length=150) number_of_likes = models.IntegerField(default=0)
*_*
Hello...I want to deploy my website on heroku. Can anyone provide with what are the limitations to deploy website in heroku for free?
Anonymous
NoReverseMatch at / Reverse for 'quries' not found . 'quries' is not a valid view function or pattern name ?? Can any help me, how to solve this ...........!!!!!!!
Anonymous
Does anyone know ?
What kind of groups ... Like admin, staff etc or the one like on social media @Newusrname
Anonymous
NoReverseMatch at / Reverse for 'quries' not found . 'quries' is not a valid view function or pattern name ?? Can any help me, how to solve this ...........!!!!!!!
No one can answer this without looking at code. Check your urls file and view names in both views and urls file @RaaVan_116
Anonymous
Just call the image in img tag on html with for loop
The for loop is already done and closed the chalenge is to fetch it after loop
Pradip
Help me I was developing oder management system using django ,I want to calculate final amount of order without cart methods also need to generate pdf invoice
Pradip
I am not able to calculate final amount based on dynamic quantity
Pradip
Already done product and stock model .Now need to calculate order amount
R
Buddies I want to create a q and a app... Where we could ask users to answer the questions ... Is there any plugin to create multiple q and a forms and publish as and when required?
Ankit
Hey guys can you help me with django rest api
Ankit
?
Ankit
Actually I have to insert value by one post method in 2 table
Ankit
The id of first table should be save to other table
Ankit
And the 2 nd table data is coming from excel
Ankit
So need to use library to read excel data and loop through it one by one and save all data in 2table while having one primary key of 1st table
Pradyum
So need to use library to read excel data and loop through it one by one and save all data in 2table while having one primary key of 1st table
try import- export library of django or if you are using postgress database then they have also explicit support to directly upload csv in db
Pradyum
from there you can manage you can choose depending upon your simplicity
Ankit
No m using sqllite
Pradyum
Actually I have to insert value by one post method in 2 table
Once you take out the values from excel then you may directly do it by using for loop method