Mandar
Hi, I'm new to django. What's best way to create multiple user types? Like Student, Teacher, Administrator, Principal, etc?
I found this link useful for creating multiple users https://simpleisbetterthancomplex.com/tutorial/2018/01/18/how-to-implement-multiple-user-types-with-django.html
User
Hey guys, is there any way to pass context data to javascript?
User
I want to pass a query list to frontend and paginate it using frontend are there any resource which would help me, any help is appreciated, thanks
Mp
Or api
Hiku
Guys someone help me how to make automatic sequence number in table?
Dasa
I have a url like http://localhost:8000/new?param=some-value which generates a form to POST How do I get the value of param in my views.py? self.request.GET["param"] is an empty string
Dasa
but its empty :/ Do I need to make any changes at urls.py?
Maruf
class CustomUser(AbstractUser): user_type_choices = ((1, "Admin"), (2, "Staff"), (3, "Merchant"), (4, "Customer")) user_type = models.CharField(max_length=255, choices=user_type_choices, default=1) class AdminUser(models.Model): profile_pic = models.FileField() auth_user_id = models.OneToOneField(CustomUser, on_delete=models.CASCADE) created_at = models.DateTimeField(auto_now_add=True) class StaffUser(models.Model): profile_pic = models.FileField() auth_user_id = models.OneToOneField(CustomUser, on_delete=models.CASCADE) created_at = models.DateTimeField(auto_now_add=True)
Arezoo
Hi how can I delete image from cloudinary in django(I have the url in database)
Monday
Exception Type: NoReverseMatch at / Exception Value: Reverse for 'detail_view' with arguments '('',)' not found. 1 pattern(s) tried: ['blog/(?P<id>[0-9]+)/$']
Mandar
but its empty :/ Do I need to make any changes at urls.py?
Try with request.REQUEST.get('param')
Monday
any help
Dasa
Try with request.REQUEST.get('param')
No.. Its a form_valid method.. so it doesn't have a request obj. it has only the self..
Mirco
Try with request.REQUEST.get('param')
it's the same, the only difference is that he will get None instead of KeyError if that key does not exist
Mirco
but its empty :/ Do I need to make any changes at urls.py?
are u sure you are calling the right view ?
Dasa
are u sure you are calling the right view ?
Yes.. Because when I check the self.request.POST, I am seeing the form data
Dasa
self.kwargs is empty
Mirco
self.kwargs is empty
because it thats not the goal of kwargs
Mirco
Yes.. Because when I check the self.request.POST, I am seeing the form data
share the code of the view and the template via pastebin.org easier to help u
@LSR
Anyone can tell me what can i add domain name in vps hosting
Doragonsureiyā
Anyone can tell me what can i add domain name in vps hosting
Your question is not related to Django. If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
Godwin
How to render ManyToManyFields dynamic content for a specific user, I've tried {{ user.course }} It retuns None
KENNEDY
user.course.all
Sparrow
Hi all, any idea how I can style Django ModelForm with my custom styles??
𝓶𝓸𝓱𝓪𝓶𝓶𝓪𝓭
Hello everybody . How to use selected object fields in foreignkey? 🌹
𝓶𝓸𝓱𝓪𝓶𝓶𝓪𝓭
For example I select a product that this name is a1 I want to use of a1.price and ...
Saurabh
Can anyone tell me please how can I work with large dataset actually it is taking much time with DRF
Amor
Hi guys, I'm using saml to login as SSO but getting the error like "WSGIRequest object has no attribute session" could any one help me to solve this
Shilpy
Can anyone tell why postgreSQL is preferred for Django over other databases?
Khalid
Full support for Django
Shilpy
Full support for Django
Can you please elaborate
Shilpy
Like what extra functionalities it provides which others don't
cj
Like what extra functionalities it provides which others don't
read here: https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/ PostgreSQL has a number of features which are not shared by the other databases Django supports. This optional module contains model fields and form fields for a number of PostgreSQL specific data types.
cj
Okay
apart of that, PotsgreSQL is way much better, not matter if you plan to use it with django or not, PotgreSQL has a better SQL implementation and his engine is way more faster and optimized than ever —but that's offtopic for this group—
Shilpy
Ok thanks
Muhammadamin
guys how do I filter this is children = serializers.ListSerializer(read_only=True, child=RecursiveField()) please help me!!!!
Не выходи из комнаты.
Hi. How can I get size of file stored on s3 bucket? ` class MediaFile(Media): s3_file = GenericFileField(tag="s3-tag", null=True, blank=True, max_length=300)
Muhammadamin
Does it have a source keyword?
Yeap. If you want, I'll send my model serializer and views
William
Yeap. If you want, I'll send my model serializer and views
Use the below websites to share your code here.
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://del.dog - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
Doragonsureiyā
Check out these amazing topics: https://github.com/topics
Vaibhav
Can anyone tell why postgreSQL is preferred for Django over other databases?
Basically postgres is the database, which can be Designed both as relational and non relationship due to its fields types and django has support of all these field types for postgres like arrayfield,jsonfield and so on..
Arlegil
Hi Guys I want To know do how To write complex queries (combine at least 3 tables) with django??? From now, for two tables,I know. Thanks for response.
A
Can anyone help me out with django project ? I need help in data addition in database and deletion part .
Mohaali
Hello, I was wondering if you finish building a website using django how will you be able to sell it to some customers without showing the code. Or is it possible?
Doragonsureiyā
Hello, I was wondering if you finish building a website using django how will you be able to sell it to some customers without showing the code. Or is it possible?
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django related question, so move to @PythonOfftopic group and ask there.
Anonymous
Hello, I am using multiprocessing module in django to perform a task. It's working fine with single process. But it is unable to handle multiple processes at the same time. So how can I run multiple processes simultaneously.
S
Hey quick question!! After .update () how to get “number of effected row “??
S
Anyway to get to know?? I need it in my use case. I am clueless now
Mirco
it's not a feature of the ORM right now from update u get only matched rows, but not the real updated ones
S
Hmm.. Ok Thanks.
Mirco
Hmm.. Ok Thanks.
it will drop in next Django major release
Mirco
Yes, I see only matched rows count
in Django 4 u will retrieve also the updated ones right now u cannot, that's it
S
Thanks much appreciated
Doragonsureiyā
Thanks much appreciated
You're welcome! 😊
Mirco
Yep got it.. Hopefully it releases soon
not so soon, but alpha already in repo
Arlegil
Using fks
Thanks. Do you means Foreign keys?
Arlegil
use q lookups
Thanks. I ma looking from now