Dave
Fabin
Dict={
'products':Product.objects.all()
'Users':User.objects.all()
}
I have a dictionary like this.
I want to console the Users key values in console.How can I console it in django?
Fabin
If i try to print
print(Dict['Users'])
It shows
<QuerySet [<Users: myname>]
All the fields and it's value not showing
𝑅𝑒𝑧𝑎
Fabin
It's shows Users is not defined,because Users is inside the Dict dictionary
bv
does the framework create Django Form object for each request of entity in admin panel?
bv
I have a json field in a model and want an option to edit it in the admin panel. I know it's possible to edit it as a string but I want it to be user friendly so I want each "key" to be editable as a different field
So I created a custom Form for my AdminModel but the problem is it's not being initialized on each request
Did anyone face/solve similar problems with creating dynamic fields in admin panel?
Fabin
Ali
guys
does django and react works good together?
Vlad
Maksim
When to better use unique=True in model Django? In time registration use for name and password or just for name?
Maksim
Ok, but passwords in project cannot to repeat, really?
Maksim
So me make to check passwords with the authentucation?
Andrej
Ok, but passwords in project cannot to repeat, really?
The most used password in the internet is: 123456
Many users use the same password on the same platform.
You don't want to expose that someone else has that password.
Never unique the password field! Just the username and/or email
Maksim
Passwords in project can repeat?
last
No, When pigs fly. never. if done, your database can be hacked from hacker
Maksim
Why I'm cannot to use name with unique=True for login?
S
Maksim
User with this Name already exists. How to resolve this problem?
Maksim
For USERNAME_FIELD you need to add unique, but with them I cannot to write name(USERNAME_FIELD) for login on site)😔
ASKAR
Krishnajith US
Hello.. somebody can suggest me tutorial for me.how can I connect postgresql with django...and how to create custom Admin panel
Maksim
Hell
hello once again to all sirs, I wrote a piece of code that displays changes to tables on forms after the user edits them. but there is a problem, changed_data takes the whole form, and starts checking every line, but I can only send part of the models.
each model in the form is exactly blank:true in order to be able to edit blocks using one form.
the problem is that changed_data for those fields that were not included in the post - returns them as none or null - and after this action I have contract.save() to save the model.
and that's when I give the user the option to edit smallintegerfield(choice) everything works fine. but in models with charfield(text) all information is erased, turns it into null. how can i fix this
Code: http://linkode.org/#i5OE2NwkBWU2VBitFKWoT2
The Inspired
The Inspired
for custom admin panel, search for 'modelAdmin' in django docs
Rajat
MR_X
I have knowledge about python and Django but I want to be pro. I want to learn advance python and Django pls help
Charly
Krishnajith US
Holla
http://linkode.org/#v71ROiSODPlM6MSiCAYNn2
Holla
are the paremeters not enought
Holla
i only entered three it should have taken as it worked for the instructor too
Johan
Hello Guys, how can I pass qs from a listview (CBV) to another view (FBV), I pass qs to context in listview but I don´t know how to get this qs in the other one, please your help.
class EmployeeListView(ListView):
queryset = Employee.is_active.all()
template_name = 'employees/list.html'
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context ['to_export'] = self.get_queryset()
return context
def to_export(request)
data_to_export = # here need queryset from EmployeeListView
Thank you in advance
Dave
MR_X
I have knowledge about python and Django but I want to be pro. I want to learn advance python and Django pls help
Alex
G4st0n
Krishna
DaVidoff
Hi all! Please, advise! I need to create a django model that will contain the title of the article and the "is_blocked" field.
I need the articles to be available to all users with is_blocked filed being binded to each specific user.
I need to be able to change the “is_blocked” field for any of the articles separately for each user using POST request.
Ramin
Hello everyone!
If I want to use web socket should I have to know JavaScript??
AK
Yes
Maksim
Custom user with this Name already exists
Ganesh
Hello everyone I develop group project
Ganesh
But I have face essue while adding multiple members in group
Maxim
Ganesh
offtopic
Django use inbuilt group functionality
Maxim
EAgold
how to import external module in django?
Koen de
how to import external module in django?
Exactly like you do with standard Python;
Search your module on pypi.org , then;
pip install <module>
In your code;
import <module>
or;
from <module> import <xyz>
EAgold
EAgold
Koen de
No it is not;
Enable your virualenv from your mainproject.
Browse to the “module” folder, then
pip install -e .
(With the dot)
Koen de
Or if it is in the same folder structure as your main-app, but then it is not an external module anymore, add it in your INSTALLED_APPS
EAgold
EAgold
Koen de
Koen de
Okay!
mypackage needs a setup.py
then you can import it with
pip install -e .
EAgold
Koen de
Else Python/Django can not see it as a module.
Koen de
Koen de
https://docs.python.org/3/distutils/setupscript.html
EAgold
Not easy, and not likable
but if i have two separated projects
one of them is django project
and another is for telegram bot
how to get access to bot project from django project?
EAgold
or for example i should edit uploaded photos with openCV before savind
i have some files with code for image edition
where i should put them?
Koen de
Your questions and my answers remain the same…
Koen de
Please read;
https://docs.readthedocs.io/en/stable/guides/private-python-packages.html
https://towardsdatascience.com/create-your-custom-python-package-that-you-can-pip-install-from-your-git-repository-f90465867893?gi=bb1a8ae08816
https://stackoverflow.com/questions/41535915/python-pip-install-from-local-dir
Anonymous
Mohamad
Hi
I have a ModelForm that I've added an extra CharField to it .
This CharField is not a field of my model.
I just want to use its value.
When im calling
form.save(commit=False),
i get an attribute error that tells me my model has no attribute to my CharField.
Is there any solution?