Альберт
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
Mirco
Sai
Sai
Альберт
Mirco
Альберт
I link them , it should not give an error
Альберт
Mirco
It's not a Django ORM error, it's a simple python error, if you have doubts study better Python
Альберт
Sacs
Please which model field type should i use
I want to print out results of something
Mirco
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
Mirco
Sacs
Mirco
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
Sacs
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
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?
Suyog
{{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
Sai
Star
Sai
ps
Anonymous
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?
Tzipi I have not worked much with cbv, but you can share the views file, I wout like to have a look at it
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...
Anonymous
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
Muhammed
Muhammed
On Google search
Sindhu
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 ...........!!!!!!!
R.U.S.H.A.B.H
Anonymous
Does anyone know ?
What kind of groups ... Like admin, staff etc or the one like on social media @Newusrname
Anonymous
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
Krishan
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
from there you can manage you can choose depending upon your simplicity
Ankit
No m using sqllite