Someone
How can I implement this?
Agent Q
How can I implement this?
Plenty of sorting algorithms out there. Google it
Agent Q
K
faran
Hi! I have a problem... I have model Company, which has two fields owner and general_balance these has a one-to-one relationship with Owner and GeneralBalance model... Each model has its own serializer, but CompanySerializer must include the serializer of Owner and GeneralBalance, so far so good, the problem appears when I try to send post, put request because I cannot modify nested objects... Does someone have any idea to solve this problem?
hi , serializers are read-only by default . but you can make function based on your needs and handle different methods in that functions .function names are important : def create(self, validated_data): # 'create' handle post def update(...): # 'update' handle put and ... so you should handle them in the serializer thats where to start related doc : https://www.django-rest-framework.org/api-guide/relations/#writable-nested-serializers
Jose Javier
Hi every one. I’m studying django channels for the first time. I have a question How can I transform this in to Class-based Views from django.shortcuts import render def room(request, room_name): return render(request, 'chat/room.html', { 'room_name': room_name })
Irrfan
Hi guys A quick question.... Is it safe to save sensitive data in session?!
Irrfan
No
So what should I use to store temp data?! For example store verification code that send to user....
Ghorz
Hi every one. I’m studying django channels for the first time. I have a question How can I transform this in to Class-based Views from django.shortcuts import render class Room(View): def get(request, room_name): return render(request, 'chat/room.html', { 'room_name': room_name })
H
Exception ignored in thread started by: <function check_errors.<locals>.wrapper at 0x7f8dafb05ca0> MigrationExecutor(connections[DEFAULT_DB_ALIAS]) File "/home/django/cms2021/cms/django/db/migrations/executor.py", line 18, in init self.loader = MigrationLoader(self.connection) File "/home/django/cms2021/cms/django/db/migrations/loader.py", line 49, in init self.build_graph() File "/home/django/cms2021/cms/django/db/migrations/loader.py", line 200, in build_graph self.load_disk() File "/home/django/cms2021/cms/django/db/migrations/loader.py", line 99, in load_disk directory = os.path.dirname(module.__file__) File "/usr/lib/python3.8/posixpath.py", line 152, in dirname p = os.fspath(p) TypeError: expected str, bytes or os.PathLike object, not NoneType can anyone help me with this error using ubuntu 20
Anonymous
How do I build the following? https://stackoverflow.com/questions/66377727/how-do-i-group-results-based-on-categories/66378257
Hitesh
Anyone integrated celery with django?
Hitesh
Want to know if I can use postgre as a broker for the celery in latest version or not
Dharmil
I created a customer model and give one to one field to User table now my register form data are store in User model so how can i give reference key to my customer model...
Hossein
How do i can enter Farsi numbers into integer field??
Anonymous
I did once
Meraj
hello how to get last item in views {{there is not iterable error}}
Meraj
Meraj
such az an blog
Meraj
e.g last blog
Mirco
of an model
YourModel.objects.order_by('-id').first()
Meraj
YourModel.objects.order_by('-id').first()
thts raise there is no itrable error
Mirco
thts raise there is no itrable error
Nope, show your code For sure you are doing something wrong That query works 😊
Doragonsureiyā
❎ ‎Mirco pardoned ‎mrj [586430089] for 3/3: ‎writing in PM is not admitted
Angel
Hello guys.
Angel
I want to try to update urlconf in django 3. Because i make dynamic the urls.
Angel
i mean , based on database data i create some links iun urls.py
𒂵𒐊𒍝𒊏
Does django support mathematical operations and how is it done?
Mirco
Does django support mathematical operations and how is it done?
Django is python You can do whatever u prefer
𒂵𒐊𒍝𒊏
Mirco
i mean in databace
Explain better
𒂵𒐊𒍝𒊏
Explain better
For example, I have data in the database and I want to do math operations on it, can I get that?
Mirco
For example, I have data in the database and I want to do math operations on it, can I get that?
Yes, get the data from database and do whatever you want You can do math operations directly with ORM queries
𒂵𒐊𒍝𒊏
Mirco
i need u in another thing
Write questions, if I have time I will answer
𒂵𒐊𒍝𒊏
Write questions, if I have time I will answer
I have a Django app and want to work on it online payment by Mastercard
𒂵𒐊𒍝𒊏
Write questions, if I have time I will answer
Can you explain the necessary steps simply?
Mirco
Can you explain the necessary steps simply?
You need strong Django basics before moving in something like that
Anonymous
https://stackoverflow.com/questions/66393070/django-rest-framework-group-data-by-its-parent-tag
Mirco
how i can do it
By studying
Dmitry
Hello. How can i flush database programmatically, e.g. not from CLI, django-admin etc?
Angel
Some way to reload url_conf in django 3?
Alexey
what are the advantages to use django with redis and postgresql in production?
Pignata
Hi everyone. I'm new with Django and having some trouble with models and PostgreSQL data types, in my database I have a field of a composed data type, that need to be mapped to varchar, but to do this, my model need add a cast function in this field. Ex: the query "select field from test_table", need to be "select field::varchar from test_table" or "select cast(field as varchar) from test_table". Ps: this explicit type cast need to work with insert and update commands too Anyone has a hint, how I could but this explicit cast into a Django model? Thanks!!!
Pignata
Thanks to all, i think that https://docs.djangoproject.com/en/3.1/howto/custom-model-fields/ it what I need :D
G
How to write this query in django.: select col1, col2, col3, col4, col5 where col2=xval group by col5 Problem: to do 'group by' we use .values(col5) but this results in selecting only col5 in output . I need all columns in output. Doing values(col1, col2...col5) selects all columns but results in 'group by' on all columns. Thank You
Hi
Hi All, I am new to django and trying to use login using authenticate method in one of my view function login My model contains user_name, user_email, password. When i try to pass user_email and password in authenticate, it returns None. Using postman to hit thr function. My register function works perfectly and i can see my user details in sqllite. For authenticate, is it mandatory to use username as parameter? Thanks in advance
Anonymous
I see
Anonymous
Guys how to do the abstractuser authentication? For serializer
Jack
Can someone help to create a POST request function for a model which is having a foreign key of another model in rest_framework?
Aslan
Can someone help to create a POST request function for a model which is having a foreign key of another model in rest_framework?
def add_comment(request, slug): if request.POST: form = CommentsForm(request.POST) post = get_object_or_404(Blog, slug=slug) if form.is_valid(): comment = form.save(commit=False) comment.post = post comment.save() messages.success(request, 'Комментарий будет опубликован после модерации') else: messages.error(request, f"Комментарий не добавлен! {form.errors}") return HttpResponseRedirect(request.META.get('HTTP_REFERER'))
Anonymous
Free hosting of Django with database Post PostgreSQL?
Anonymous
Heroku
Tomorrow I try, I can ask you for help? (I'm new in this)
faran
Tomorrow I try, I can ask you for help? (I'm new in this)
https://devcenter.heroku.com/articles/deploying-python https://www.geeksforgeeks.org/how-to-deploy-django-application-on-heroku/ this is all I know
Anonymous
Anyone can help me in crypto merchant
Doragonsureiyā
Anyone can help me in crypto merchant
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 ~90,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
Anonymous
Oky
Anonymous
Can anyone suggest a basic project in big data?
Neymar
Can anyone suggest a basic project in web development?
Gabriel
Gabriel
Can anyone suggest a basic project in big data?
I don't think Django is directly related to big data
Avi
Hello, I'm trying to deploy django application to AWS elastic beanstalk , followed every step from documentation. Yet , this error occurs , Path to wsgi file is incorrect. I opened (eb config) and changed wsgi path there , from application.py to mysite/wsgi.py Still error occurs . Can anyone help , please.
Mirco
!meta
Doragonsureiyā
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 ~90,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
NOOR UL AIN
Help me out with NLP related topics? Suggest me some NLP related papers! I'm beginner
noob
django session loss after payment
noob
how to get/retireve session after payment