Sai
Nginx is my webserver
godmode
I never think about that , what It matters for if my apps works...
Rohan
🤦♂
Rohan
Organic ban 🤷♂
godmode
I was going to call the admin but you're one hahahah
godmode
And i saw your power
godmode
Hahaha
r0b0t
Mirco
Mirco
Emeka
Mirco
Mirco
?
Anonymous
nothing man
Anonymous
Ignore it
Anonymous
what is use of views.py in Django project?
Anonymous
ok
Shekhar
hi. I was trying to make a multi choice select on a query result.. but I can't find a good resource for the implementation
Mirco
Shekhar
suppose a user created 5 contacts one by one so in display view he can see all the contacts he created but he wants to multiselect from the contact for some other function
Shekhar
or he just want to select multiple contacts and delete that as we do in admin view
Anonymous
!d2(hello)
Mirco
It's a frontend stuff, add to an array clicked item
Shekhar
i think its form stuff and some modelmultichoicefield
Mirco
Mirco
What you wanna do is just select multiple rows and make something with those ones
Shekhar
Mirco
Shekhar
Shekhar
not*
Mirco
Why not ? It's js stuff
Mirco
By clicking on an element, you add it an array, then send that one to a view
Shekhar
ok what if i need some more details while processing then just those array items
Shekhar
which i can get if i have instance of those items
Mirco
Shekhar
so making form field is a bad idea??
Mirco
so making form field is a bad idea??
Buy you "duplicate" things
You already have the display view, use js to select multiple contacts and do something with them into a view
Shekhar
ok thanks I will try
Mirco
Yw 😁
Mirco
Anonymous
Anonymous
*isn't it
Mirco
Isn't yours
Yup! I was thinking json could be avoidable for just an array of numbers
Anonymous
Shekhar
Shekhar
a form which respond in a queryset
Shekhar
ok wait i will share the link
Shekhar
http://796dbad8.ngrok.io/
user :shekhar password shekhar1
Mirco
Shekhar
I want those field should be selectable as we have in admin user or any model page..on multiple select do some action
Root
Hello everyone, I need some help about saving multiple objects in db using other class's data.
i have a class called product: which contains items named p1, p2, p3, p4
now i have another class called product_package which will have set of items and their quantity, say. p1:0, p2:4, p3:2, p4:2
So, i'm trying to run a loop based on list from product class:
class product_package(models.Model):
package_title = models.CharField(max_length=140)
p_list = product.objects.all()
for p in p_list:
# ????? what do i do here so that the model is saved as:
# p1:0, p2:4, p3:2, p4:2 under
product_package class alongside package_title
I'm concerned about related data, maybe datatype, as i can Use models.IntegerField for the quantity of each product, but i dont know how to handle the relation between item_title and item_quantity.. Sorry, I'm a beginner
Mirco
Ильдар
Hi guys. I have a problem. I have a model with two fields and there are two lists. how to add all the data from the first list to the first field, and from the second list to the second field. tried to use bulk_create fails.
OUHBOY
Ильдар
`bcxus = [bcxu_numbers ,bcxu_ips ]
#bcxus it is Two-dimensional lists
#bcxu_numbers list number 1
#bcxu_ips list number 2
for i in range(len(bcxus)):
for j in range(len(bcxus[i])):
print(bcxus[i][j])
BcxuModel.objects.bulk_create([BcxuModel(bcxu_num=bcxus[i], bcxu_ip=bcxus[j])])
#Bcxumodel.objects.create(bcxu_num=bcxus[i], bcxu_ip=bcxus[j])`
Akash
I have this python project which uses standalone django orm so have an app called standalone
Now I am building a web app for same project which will use the same database and models. Web app will have a dashboard where user can see stats of tables from standalone script.
What will be a better design:
1. I use the standalone app itself as the dashboard app
2. Create a new app dashboard and import database of standalone app to query data. I also plan to allow users ability to modify data from web app at later stage. Right now they can modify only from the standalone python app running separately
Naveen
Naveen
Ильдар
Ильдар
`bcxus = [bcxu_numbers ,bcxu_ips ]
#bcxus it is Two-dimensional lists
#bcxu_numbers list number 1
#bcxu_ips list number 2
it = -1
col_iter = len(bcxu_numbers)
its = col_iter
its = its -1
for i in range(col_iter):
#for j in range(len(bcxus[i])):
#print(bcxus[i][j])
it = it + 1
its = its + 1
BcxuModel.objects.create(bcxu_num=bcxus[it], bcxu_ip=bcxus[its])`
Naveen
then split the list using a special character save it and when later needed you can split the string into a list based on same character
Ильдар
this is code return fault: BcxuModel.objects.create(bcxu_num=bcxus[it], bcxu_ip=bcxus[its])
IndexError: list index out of range
Naveen
it says list element doesnt exist did you try to print the list ?
Ильдар
`#bcxu_numbers list number 1
#bcxu_ips list number 2
it = -1
col_iter = len(bcxu_numbers)
for i in range(col_iter):
it = it + 1
BcxuModel.objects.create(bcxu_num=bcxu_numbers[it], bcxu_ip=bcxu_ips[it])` This code solved my problem
Ghorz
Hey guys, I'm really messed up right now. I've been working on open source project for over a month. Am less than 2 weeks to release. I used froaleditor in my project, observe the license term lately, emailed them for explanation.
Boom reply: (3.8) “Redistribution of the Software to Third Parties through Open Source projects is not allowed under any of the Licenses.”
On this link, you can find the Froala Editor License Agreement: https://www.froala.com/wysiwyg-editor/terms
Please which other editor is better, I don't like ckeditor, tinymce. Loved froaleditor but can't redistribute.
Anonymous
Why does djamgo2.0 add / some can be accessed, some can't find a page, no / some can be accessed, some can't be accessed?
👍
django app login with twitter not working
Shubham
Hello guys
Shubham
certifi==2019.6.16
chardet==3.0.4
defusedxml==0.6.0
Django==2.2.3
django-allauth==0.39.1
django-rest-auth==0.9.5
djangorestframework==3.10.2
httpie==1.0.2
idna==2.8
oauthlib==3.0.1
Pygments==2.4.2
python3-openid==3.1.0
pytz==2019.1
requests==2.22.0
requests-oauthlib==1.2.0
six==1.12.0
sqlparse==0.3.0
urllib3==1.25.3
Shubham
this is my requiurements.txt content
Shubham
mkvirtualenv --python=/usr/bin/python3.6 school
Shubham
in that if i try to pip install psycopg2 then throwing an error ERROR: Failed building wheel for psycopg2
Anonymous
A neat step by step guide for database design for Car Parking management app in django here is the link if you like the story please give me a clap
Anonymous
https://medium.com/@balaraju.mme/car-parking-reservation-database-system-with-django-434e468ae110
Shubham
great work Balaraju
Shyam
Can anyone please help me to understand how makemigration and migrate work and how django identify any changes in the model when we run this two command.
Mohit
local file name for language code "zh-hans" & "zh-hant"