PRASANA
Docopts
NaamMainKyaRakhaHai
Hello All, I am @NaamMainKyaRakhaHai , I want to know that how to get data from multiple model, without using itertools's chain method.. if yes please suggest me , 1 Model class modelOne(models.Model): cname = models.CharField(max_length=25, primary_key=True) descr = models.CharField(max_length=40, blank=True, null=True)
NaamMainKyaRakhaHai
2 Model class ModelTwo(models.Model): ttype = models.CharField(max_length=2, blank=True, null=True) cname = models.ForeignKey('Scripts', on_delete=models.DO_NOTHING) dates = models.DateTimeField() I want the data for specific dates and also need to get the description of the Model1 with it.
Anonymous
Someone can help me with this question? https://stackoverflow.com/questions/64981828/django-staticliveservertestcase-cannot-truncate-and-flush Thanks in advance
Neo
how can i check the created date exceeds 24 hours in django model, i have a model with created datetime and updated datetime , want to check if the created date exceeds 24hrs user should get 24 hours exceeded error to update.
Deku
Hey.. If any one can help, I wanted to make a form where there are fields from different table linked by foreign key Form has drop downs which are dependent on each other(fields from different model - foreign key) In a way that when we select one field ,the next dropdown should be filled according to previously selected dropdown. Is there any fast way of creating such form in django?
Neo
Calculate the differnece in hours And then check if it's exceeding 24 or not
Tried def clean in model, but i wanted to validate when updated date entered
Vishnu
https://stackoverflow.com/questions/64945097/indexerror-at-first-app-upload-8-list-index-out-of-range-while-uploading-non-c
Vishnu
please guys
NaamMainKyaRakhaHai
please guys
check the CSV reader's column and Print that column variable as I can ell you that email on column[1]
NaamMainKyaRakhaHai
tell*
mat
In fact Your code only accepts csv files
Jd
How to add cart in product
Jd
Plz help me
NaamMainKyaRakhaHai
How to add cart in product
https://www.youtube.com/playlist?list=PLLRM7ROnmA9Hp8j_1NRCK6pNVFfSf4G7a this Playlist might be helpful
Viswa
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/ latest/development/release-process/#python-2-support
Viswa
i am getting this error
Viswa
while deplying project
Ghorz
python 2 is dead
Not in 2years time. It will still be in use. I work on enterprise systems that depends heavily on python2 for the CLI. It will take years to switch to py3. There are several companies that will still receive support for the next 5years
Ghorz
Google, Instagram and a host of others still run python2.
Ghorz
Even Letsencrypt Certbot SSL is still using py2 till date
Mirco
come on @Ghorz , I know but Viswa is working with a fresh project by using py2 😅
Ghorz
come on @Ghorz , I know but Viswa is working with a fresh project by using py2 😅
Not advisable for a fresh project. I myself start fresh project with py3.8
Ghorz
exactly that's what I meant
OK, now I understand you. 👍
Vishnu
I'm able to upload and process the csv files bro
I'm just not able to validate when a non csv file is given to upload
NaamMainKyaRakhaHai
I'm able to upload and process the csv files bro
if possible share the data reading through the csv reader...
NaamMainKyaRakhaHai
as that error clearly says that there are on column[1] having the no data for the position
Vishnu
Sry bro I didn't understand
Mirco
I'm just not able to validate when a non csv file is given to upload
You mean when another kind of file the user will try to upload ?
Mirco
Yaa
have you ever heard about Validators ? https://docs.djangoproject.com/en/3.1/ref/validators/
Mirco
Bro I please check this
https://docs.djangoproject.com/en/2.2/ref/validators/#fileextensionvalidator Django has already built-in what u r looking for
Mirco
you just need to choose the allowed extensions
faran
class Avenue(models.Model): region = models.IntegerField( ) Id = models.CharField( ) I use MYSQL with Django. How can i do partitioning for this model based on region field in django?
NaamMainKyaRakhaHai
try to check below code import architect @ architect.install('partition', type, subtype, constraint, column, db=default) class MyModel(object): pass
NaamMainKyaRakhaHai
for more check ... https://medium.com/@arunshaji95/django-partitions-with-architect-4b758f4a5511
faran
try to check below code import architect @ architect.install('partition', type, subtype, constraint, column, db=default) class MyModel(object): pass
thanks for your answer but architect for mysql just supports date type and region is not dateField unfortunately.
Vishnu
you just need to choose the allowed extensions
bro how do i give that validation on that views
NaamMainKyaRakhaHai
Doragonsureiyā
bro how do i give that validation on that views
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
Mirco
really Vishnu it's a very common issue, spend 10mins on Google and you will find all u need study how Django Validators work
Mirco
and in 10 lines of code you will achieve your goal
Vishnu
bro i'm not having any idea how to do it bro
Mirco
bro i'm not having any idea how to do it bro
Stop calling everyone bro please 😁 Spend time on studying, you have all u need out there
Snickers
Hello django boys! Need help with LIQPAY for PYTHON3 , have error like 'check_allies_error', pls help!
Hello world
IS anyone here who made project using django rest framework and Vue.js
Doragonsureiyā
IS anyone here who made project using django rest framework and Vue.js
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
Hello world
ok
deioces
😐
Anonymous
How to different makemigrations between migrate?
Hamidreza
How to different makemigrations between migrate?
makemigrations saves changes in migrations folders and migrate submit changes in database
Anonymous
I am learning django
N-34512082
Plz tell me how to insert data in Django without using migration... Bcz I already created a database Nd tables
Darya
Guys i'm creating a shopping cart API using django sessions but it doesn't work . Can any one help?? Or do you have some recourses for cart api with sessions???
Hamidreza
Thanks a lot
yw 🙌🏻
Doragonsureiyā
You're welcome! 😊
Anonymous
https://pastebin.com/zAgGqj5t
Vishnu
https://stackoverflow.com/questions/64945097/indexerror-at-first-app-upload-8-list-index-out-of-range-while-uploading-non-c
Bro in this I'm validating whether it's a csv file or not and printing an error message like this If not csv_file.name.endswith('.csv'): messages.error(request, 'please upload a .csv file .') If the given file is not a csv file it should print the error message Naa, At that time I'm getting an error like this
Vishnu
Bro but I'm passing a primary key within that so that's the reason I was using it inside the view
Vishnu
Like if u look my views page you can understand
Vishnu
Without that I can't upload the contents in the csv file
Mirco
Bro but I'm passing a primary key within that so that's the reason I was using it inside the view
stop calling me bro, I'm not your bro and I ask you the same thing of this morning do you know what a Django validator is ?
Mirco
and how can you use it in a Model ?
Vishnu
I didn't use it ther