Artyom
https://stackoverflow.com/questions/55616356/typeerror-at-django-db-models-fields-related-foreignkey-is-not-json-serial
Artyom
may be somebody know this problem
Mirco
I face with unusual serializer error
gis or not serializable ?
Artyom
Artyom
thank you for alarm about gis, I will add actual trackback
Artyom
@pyflare yes, there is problem with <django.db.models.fields.related.ForeignKey> is not JSON serializable
Mirco
share your code :)
Artyom
share your code :)
http://pythonfiddle.com/djangodbmodelsfieldsrelatedforeignkey-is-not-json-serializable
Artyom
expired
https://pyfiddle.io/fiddle/486edc79-6252-4d9e-86a9-5ba8e6dccd25/?i=true
Mirco
https://pyfiddle.io/fiddle/486edc79-6252-4d9e-86a9-5ba8e6dccd25/?i=true
I think u need to pass many=True to your Serializer read more here
Anonymous
@Inchidi @pyflare
Jimmies San
fecking spammer
syedj
Hi
syedj
I have to pass a query param like. ?namespace="test1/test2/test3"
syedj
But test1/test2/test3 is taken as path not query param
syedj
Localhost:8000/project/?namespace="test1/test2/test3"
inchidi
This is the url
your code, all insode your urls.py and use dpaste.de
Amirul
Localhost:8000/project/?namespace="test1/test2/test3"
some hints. https://webmasters.stackexchange.com/questions/498/which-special-characters-are-safe-to-use-in-url my advice, dont use it
syedj
My namespace has forward slash without which i cannot proceed
syedj
That means i can't implement it that way
syedj
My urls.py is projects/<str:projectname_or_id>
Artyom
@pyflare I had trying to add mane = True : https://pyfiddle.io/fiddle/486edc79-6252-4d9e-86a9-5ba8e6dccd25/?m=Saved%20fiddle
Anonymous
What kind of error ?
Force_insert() error, i solved it
Artyom
@pyflare but new path with function cutareaurl responce same Error
Artyom
mmm
only trackback become more shortly)), It is only one achievement)) from 62 row.
Artyom
I really don't understand what is wrong, google silents too))
Omair
Hi i am a beginner in django and drf and am using genericApi views in django rest to create and list user profiles which also includes the user profile picture I wanted to get an idea as to how the update of user profile pic should be implemented such that the old picture associated with the profile is deleted and list view points to the new user profile picture
Denis
If so, just change address to new one in your db
Denis
Or i am dumb and didn't get it right)
Mirco
Stop pls, this is not the place for job requests
Omair
If i got it correctly, you want to just simply change pic?
Yes I want to change the picture and delete the previous picture as I am deploying my django app to a server so I want to minimise the wastage of space
Denis
Yes I want to change the picture and delete the previous picture as I am deploying my django app to a server so I want to minimise the wastage of space
Second, don't store image in db, if you do. Store the address to image. And when picture will be changed, function should be called, which will delete image due to previous address and add an address to a new pic to the db
Mirco
First of all you may need image CDN. Just a tip.
If u use S3 buckets, for example , it also overwrites file with same name, so if you don't care about filenames , you can set a default name on uploading profile pics
Omair
You people are very helpful 😊 thanks
Manish
How to create different user role "admin" User1 user2
Anandababu
Hi..i am new to django...Deployed django proj using fastcgi in IIS... images and css are not loading.. any help please?
R
Hi..i am new to django...Deployed django proj using fastcgi in IIS... images and css are not loading.. any help please?
Django will not serve them, you need to setup your webserver or a cdn to serve them
Luis
Hi..i am new to django...Deployed django proj using fastcgi in IIS... images and css are not loading.. any help please?
I never used IIS and DJango, but I found this link: https://stackoverflow.com/questions/32312590/how-to-fetch-static-css-files-with-django-on-iis
Anandababu
Thank you... will try this
inchidi
am really confused with people who use Enum for choice fields, i wrote a comment on article about this. would be nice if someone here can explain why Enum better than example given by django official docs
Anonymous
hey guys. i have a method in a model(person) that calculates the person's age. Im trying to access that age from a view. any help on how I can do that?
Adil
import the model in a view
Adil
and use the method
Mirco
Anonymous
I shouldn't include the parenthesis?
Mirco
I shouldn't include the parenthesis?
yep if it's a method, nope if it's a property
Nithin
How can i annotate on a boolean field with 'and' operator? For eg there is a model with fields user_id and passed. I want to annotate a field passed_all.
Ivan Putra
What is the best Django server
Ivan Putra
Heroku, pythonanywher or else?
Muflone
I use PA but many tell heroku is better
Nithin
So all users with passed set to True ?
yes, basically there are multiple rows with same user_id, some have passed False, some True.
Mirco
yes, basically there are multiple rows with same user_id, some have passed False, some True.
have you already tried something like User.objects.annotate(passed=True) ?
Nithin
yes, tried tham. But aparently none of the functions operate on boolean. what i need is User.objects.all().values('user_id').annotate(passed_all=LAND(F('passed'))).values('used_id', 'passed_all')
Nithin
But couldn't find the function LAND
Vladyslav 🇺🇦🇪🇺
folks, help plz
Vladyslav 🇺🇦🇪🇺
https://pastebin.com/uUaG5v6J
Vladyslav 🇺🇦🇪🇺
got a form with two customization fields, wich outside of forms.py of actual form i dont like to create this fields if forms.py bcz they need for frontend loading objects how i can sent objects from my customization fields in django request? for next parsing on server sive
Vladyslav 🇺🇦🇪🇺
side*
Vladyslav 🇺🇦🇪🇺
example field 1 = select choice 1 field 2 = secelt choice 2 and then djano request.dict must have this objects
Vladyslav 🇺🇦🇪🇺
how i can do that?
Alexander
for code formatting in telegram use it inside ```
Alexander
decide to use drango rest framework API (and serializers) and js-generated froms (Vue.js etc.)
Alexander
Django Forms & Templates looks like legacy in 2019 but do not marked as legacy for some reasons...
Alexander
so use https://www.django-rest-framework.org/api-guide/serializers/ instead...
Anonymous
I would like to know how can i debugging in Django and docker? Can somebody explain me? Or something link? Thanks
Naincy
Can anyone give me some project ideas in django+raspberry pi ??