Mirco
Place
Place
I can only test views and models
Place
But i don't know how thats why i am asking
Place
Like what to test on a model??
Place
Creation, update, read, delete
The CRUD
?? (well i don't have an api, as i mentioned all i have is the admin panel, its for a mobile app so i used django since it has a built in admin panel)
Mirco
Place
i have direct operations on the database (mongodb) with the django
Mirco
Place
django as i said is just for my admin panel, the app is on flutter
Mirco
Place
Place
only the admin url
Mirco
yes
You can use those urls to make tests
Mirco
But it makes sense to test only custom stuff you have added
Place
i don't know if it may helps someone, but i just found this link : https://realpython.com/testing-in-django-part-1-best-practices-and-examples/
Mirco
Place
that helps for finding what to test haha
Mirco
I prefer to use pytest, it has more power and a good integration with Django
Anonymous
str() is used for conversion
Mirco
Abhay
What are the changes when I depolyed my app to heroku. Like I want to do change debug and allowed host.. These things!
Artem
u can try do it in heroku bash
Maltapopoulos 🇲🇹
Hi guys, How can I do to reset migrations I try python manage.py migrate but I got that django.db.utils.ProgrammingError: relation already exists
I precise I dropped the tables
Maltapopoulos 🇲🇹
But I cannot achieve to recreate the tables. Have you got any tips to do that?
Anonymous
You guys have a DRF group?
Its_Me
yes
VarunTheLord
yes
Can you share the group link?
Mirco
Bully
Does anyone using django with python 3.9
Doragonsureiyā
Does anyone using django with python 3.9
Don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello, I need help on $z"
Just ask about your problem directly! With ~80,000 people here, the probability that someone will help is pretty high.
How to ask smart questions: http://catb.org/~esr/faqs/smart-questions.html
Bully
I how to find modules list
Bully
There
Bully
Django *
Mirco
Wich modules list ?
Bully
Djngo's module
Mirco
Could u explain better ? What u are saying has no sense
Mirco
Django files structure is always the same
Mirco
Despite python version
Bully
I'm getting problem with veiw. Py
Mirco
Mirco
We don't have any magic ball
VarunTheLord
Bully
Im binner mybe thts y
Mirco
Im binner mybe thts y
Share an error, a traceback, whatever you want but let us understand otherwise it's impossible to give u a hint
Ghorz
Anonymous
Best way to learn django and rest framework in one month
Place
hello everyone, i am having a little problem, django-admin does no longer generate the id (primary key)
Place
if i don't put it in my models, nothing works 😩! and when i try to add :
""" id = models.AutoField(primary_key=True) """ it doesn't work
Akash
I have 2 models as below - Disease, Patient
class Diseases(models.Model):
disease_name = models.IntegerField(null=False, unique=True, primary_key=True, db_index=True)
......
class Patient(models.Model):
disease_details = models.ForeignKey('SchemeList', on_delete=models.PROTECT, null=True, default='')
.....
Now I am using a form to get certain details of patient, and on certain form field say "disease name" I want to map disease_detail column as below
class NewPatientView(LoginRequiredMixin, CreateView):
model = Patient
def form_valid(self, form):
form.instance.disease_details = Diseases.objects.get(disease_name=form.instance.disease_name)
print(form.instance.disease_details) #to debug
The issue is though I get Disease object in print , when I check my Patient database, disease_detail is not mapped with Disease model object.
Any idea why ?
Mirco
I have 2 models as below - Disease, Patient
class Diseases(models.Model):
disease_name = models.IntegerField(null=False, unique=True, primary_key=True, db_index=True)
......
class Patient(models.Model):
disease_details = models.ForeignKey('SchemeList', on_delete=models.PROTECT, null=True, default='')
.....
Now I am using a form to get certain details of patient, and on certain form field say "disease name" I want to map disease_detail column as below
class NewPatientView(LoginRequiredMixin, CreateView):
model = Patient
def form_valid(self, form):
form.instance.disease_details = Diseases.objects.get(disease_name=form.instance.disease_name)
print(form.instance.disease_details) #to debug
The issue is though I get Disease object in print , when I check my Patient database, disease_detail is not mapped with Disease model object.
Any idea why ?
If you override the form_valid you need to call the parent one to proceed with saving into the db
If you don't call the form.save() is normal you won't see anything into the db
appu
How to add more database in django
appu
And how could I can add and retrieve data from particular Table in a database
Maltapopoulos 🇲🇹
appu
Rastapopoulos will u send those documentation
Faisal
Django-todo package, has anyone use this, if yes need some guide ho to implement
Shreehari
https://del.dog/talapatyth.txt
How can i access the get_image_path in values() in my views.py
using cloudinary as storage
Arezoo
Hi.how can i use jsonfield in F expression?
Doragonsureiyā
Hi.how can i use jsonfield in F expression?
Step 1: Open a browser
Step 2: Write down https://google.com or https://duck.com and press Enter
Step 3: In the search box, write down the same words you asked here
Step 4: Read the first results
Megh
hello
can anyone help me i cannot
i cannot create superuser in Django
i type email
then for password i just hit enter
they it show password (again)
i hit enter again
but again it shows
password (again)
Rahul
You have to enter password two times
Megh
but i am unable to enter anything
as password input
Rahul
Password is always hidden
Rahul
You just put your password and hit enter
Nirupam
Hi everyone i am facing challenging issue..
Nirupam
Django.db.utils.programmingError:('4200').Either the parameter @objectname is ambiguous orr the claimed @objtype(column) is wrong
Nirupam
Kindly help
Megh
thanks for help
Akash
I have an auto complete field that should contains "person name" value from database .
Now every time database has new "person name" I want my autocomplete field to contain that value.
I don't want to query my database every time autocomplete field is accessed as these names can be 10k+.
What can be a better solution to this?
Anonymous