How to add the evey objects to Many-to-Many relationship model
class MyUserGroup(BaseModel): my_user_types = m.ManyToManyField(‘MyUserType’,blank=True) I have this models which has the many-to-many relation ship to type. Now I want to give the every MyUserType objects to this model such as muy = MyUserType() muy.save() muy.my_user_types.add(MyUserType.objects.all()) However this shows the error like this, TypeError: Field ‘id’ expected a number but got <SafeDeleteQueryset [<MyUserType:A>, <MyUserType: B>, […]
How to make password hashing in django project, i am using custom autentication for login?
I want to make password hashing possible for a django project.
Django-MySQL remote connection trouble
I was trying to connect my app with a remote MySQL database (usually obtained from our hosting through cPanel) and encountered this error. Can anyone help me out? I’m stuck here. Does Django really allow remote MySQL connections?
pymysql.err.OperationalError: (1045, “Access denied for user ‘Mikael’@’localhost’ (using password: NO)”)
I’ve seen many threads and solutions but none have worked for me. I’m trying to run migrations on my django project via Mac. After running python manage.py makemigrations
, I get this return stack
Compute number of hours the user spent per day
I have Clocking table in database. I wanted to count the users’ time spent per day.
DJANGO Compute number of hours the user spend per day
I have Clocking table in database. I wanted to count the users’ time spend per day. For example 2024-03-21, user 1 spend 6.8 hours, the next day he spend n number of hours and so on ([‘6.8’, ‘n’, … ‘n’])
Speeding up Django’s total record count calculation for a site with 20 million records MySQL
I’ve encountered a problem with my Django website. Given that my database contains more than 20 million records, the operation of counting the total number of data (count) becomes extremely slow. I am using the following queries:
Django: Change Datatable by input value
I have an input field where the user can input specific ‘year’, and it will show all related rows. It’s not the search function that I want, this one is different. There are multiple rows that has the same information, so if I use the search bar, it won’t give me rows from other ‘year’. So all the info in my datatable will depend on what is in the input field. I’m not sure if you get what I mean. Is there any links or tutorials you can recommend to me?