Sergey
Hello I'm building site which have one news box where i want to show latest news first but default django model entries shows latest entry in last what should i do for my correct output?
In class Meta overwrite ordeing and add '-' for example if you want to see lastest by id you need ordering = ['-id']
Krishna
Thanks
Mirco
Thanks
it depends if u wanna the default ordering so it will be shown also inside admin panel or just an ordered queryset for your view
Chandu
Hello friends, I have a doubt. Typeerror:__str__ returned non-string? How it solve ?
Gaurav
Please Help me someone- https://stackoverflow.com/questions/65773461/how-to-import-user-and-userprofile-data-from-userprofile-model-admin
Doragonsureiyā
Ok, thanks
You're welcome! 😊
Nurgazy
django inlineformset_factory add button?
Nikhil
I want to query this (2021-01-16T12:13:45.822128+05:30=2021-01-16 12:13:45) filter(datetimefield=2021-01-16 12:13:45)
Himalaya
https://docs.google.com/document/d/1qVMspkXHQyrJUCPh0zr9IuVWGwUMQRxwO9rsemdBaeg/edit?usp=drivesdk Can anyone help me out on this.
Himalaya
I'm having an error when i extended Django User Class
Mikael
Hello people. I have ran into a problem and am kindly asking you to help me. So i have added a custom method to my fee profile model, and i wanted it to calculate for me the fee balance when a fee instance is created. First, before adding the custom method, everything was working out well. I could add a fee profile instance in the django admin without getting errors. Also, i have included a dictionary that stores the fee payment history and am unable to figure out a way to display the fee payment history on a template.I am running django 3.1.4, and using python 3.8.5. Here are the screenshots to my work
Mikael
Ooops, can't post any media...
Doragonsureiyā
Ooops, can't post any media...
To share code or error tracebacks, be considerate and use an online pasting service - here is a list of suggested sites: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you post a wall of text message (many lines), delete it quick or you may get a warn strike.
Mikael
Let me work on how to share the code
F.
https://docs.google.com/document/d/1qVMspkXHQyrJUCPh0zr9IuVWGwUMQRxwO9rsemdBaeg/edit?usp=drivesdk Can anyone help me out on this.
Mentioned related model Publisher in CampaignToPublisher but you try yo save User object on the foreign key field. Anyway Publisher & User related onetoone you can call instanse.user = request.user.publisher
mukul
What is django cms
Himalaya
It is now showing 'User' object has no attribute 'publisher'.
Himalaya
As Publisher is the foreign key i guess
Himalaya
It is now showing 'User' object has no attribute 'publisher'.
The AbstractUser class have no idea about the extended publisher class.
F.
I want to query this (2021-01-16T12:13:45.822128+05:30=2021-01-16 12:13:45) filter(datetimefield=2021-01-16 12:13:45)
Just make "2021-01-16 ..." datetimefield object, refr django QuerySet https://docs.djangoproject.com/en/3.1/ref/models/querysets/
Mikael
Hey, i have pasted the code on dpaste, here is the link: https://dpaste.org/TnWS
Mikael
Here's my admin.py code link: https://dpaste.org/psXZ
Mikael
Here's what the error message looked like: str returned non-string (type Child)
Kirill
Hello. Can I create such constrain in django CHECK ((availability_end - availability_start)>0); using CheckConstraint ?
F.
Yes I'm
Okay okay, related_name given. Try. request.user.Publisher_User
Himalaya
I'll try tomorrow as i have signed off for today. I'll try it tomorrow and let you know. Thanks for helping
mukul
Joel
SMTPAuthenticationError at / (535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials g136sm1899975lfd.272 - gsmtp')
Joel
am still new to django i have that error i have tried all possible troubleshoots such as turning on less apps, and setting up app password in two factor authentication
Mirco
Yes
specifically it's a Django app
𒂵𒐊𒍝𒊏
Any suggestions on colors of sidebar & face in html please 🙏
Doragonsureiyā
Any suggestions on colors of sidebar & face in html please 🙏
Looks like you need an offtopic group, please continue this conversation at @pythonofftopic as it's not related to Python
antonov
Hi there! Are there any packages for OAuth support that don't create or login users and let us own write the logic for successful authentication?
Mirco
and write your auth backend for Django
antonov
you can do it by yourself without any package
I thought about it. I just would like to have already written code of some providers (google, facebook, etc.)
antonov
you can do it by yourself without any package
well, ready-made endpoints would not hurt too (as with allauth)
Yash
Python 'float64' cannot be converted to a MySQL type
Yash
i m getting this error when i m trying to populate my django database from a pandas dataframe
Yash
Can someone help
antonov
Have a look on oauth2_provider
do u mean it " https://github.com/jazzband/django-oauth-toolkit/tree/master/oauth2_provider " ?
Mirco
usually those packages allow u to customize and specify the class u prefer to provide custom behaviours
Doragonsureiyā
I'll check it! Thanks 🙃
You're welcome! 😊
Anonymous
My custom user model is not able to generate tokens. Users are registered to database but token is not generated can anyone help
Anonymous
Showing error : <user: mike> token. User must be a user instance
Nikhil
*datetimefield -> datetime
Can you elaborate please
Lucid
Are Numpy and Pandas are compatible with django framework
Lucid
Sure they are
If you don't mind would you help me i am getting the sense of solution for my problem
xzenon
What's the problem?
Lucid
What's the problem?
I have columns in my database table like Quiz mids and finals against multiple rows and I want to add them in the other column for every row/Student
Lucid
Tried aggregation on columns but don't have the idea how to aggregate rows
Teutranian
using {% static 'base/....jpg' %} sticks /portal infront of link. I m at localhost:8000/portal
Teutranian
how to avoid this?
#!/bin/sh Inَactive
Teutranian
base twice?
#!/bin/sh Inَactive
no no just / before base
#!/bin/sh Inَactive
so it would be / as home not sure tho haven't try long time
Teutranian
Not Found: /portal/{% static '/base/employee.png' % }
Teutranian
I m able to load my downloaded bootstrap
Teutranian
so only problem with pics