Shubham
have created the custom user model in Django and created a superuser , in admin panel its not logging in although the right cred is given https://github.com/shubham1507/school
Shubham
tried the stackoverflow, although not working
Kev
and cannot u make them dict before using where u need ?
I am sending a dict, but one of the keys to the dict contains the list
Anders (izzno / gooood) 🇳🇴
hmm
Anders (izzno / gooood) 🇳🇴
skill_rec = Skills.objects.get(pk = skill.get('skill_id', ''))
Anders (izzno / gooood) 🇳🇴
whats your plan here ?
Anders (izzno / gooood) 🇳🇴
for every turn your changing the skill_rec, not adding to it..
Kev
whats your plan here ?
to get the Skill record from the db, where the pk matches the one in the skill object from the list
Kev
for every turn your changing the skill_rec, not adding to it..
I am actually using the skill_rec before iterating
Kev
use json
I am getting the error: TypeError: expected string or buffer when I try to do json.loads on the list
Anders (izzno / gooood) 🇳🇴
you have to send it in json as well
Anders (izzno / gooood) 🇳🇴
encode your list / dict, then decode on the other side.
Anders (izzno / gooood) 🇳🇴
But I dont really get what you are doing. And we are missing some code in your example (you're reffering to self, so your in a class? Wheres the rest), your iteration looks like it does nothing. And where is the data coming from, are you sending a dict from one program to another via http, you cant do that...
Anders (izzno / gooood) 🇳🇴
So i am guessing thats what you are doing, which means you need to use json.
Anders (izzno / gooood) 🇳🇴
ahh
Kev
problem is that the list I am sending in the request is arriving as a list of strings,.. string representation of the dicts
Anders (izzno / gooood) 🇳🇴
yes, and if you use json that would not be an issue ;)
Kev
yes, and if you use json that would not be an issue ;)
json.loads takes in a string or buffer, but I am getting a list instead
Anders (izzno / gooood) 🇳🇴
just manipulate the data to fit your needs...
Kev
just manipulate the data to fit your needs...
thank you, the issue was that I was trying to serialize a UUID, worked when I casted it to str
Anders (izzno / gooood) 🇳🇴
ahh, uuid's a tricky object ;)
Anders (izzno / gooood) 🇳🇴
(at least in mongodb)
Kev
I haven't used mongodb yet, I sure have learnt something today :)
Anders (izzno / gooood) 🇳🇴
👍
Ronald
Ahhh. Dealt with a Mongodb (with millions of data entries) in a Django app a few months ago for client. Quite a learning curve but fun once you get the hang of it
Shiva
Guys any one worked in geodjango ??
Manish
Why using custom user model is hard in django
Mirco
Why using custom user model is hard in django
It's not so hard and if u tried to do the same in other frameworks you'd agree with me imho
Manish
Changing default django behavior is really hard
Manish
On other framework i can easily create my own authentication model
cj
Why using custom user model is hard in django
it's not hard 🤷🏻‍♂️
Manish
Why i feel its very hard?
Manish
We can't change django user model in between work
cj
Why i feel its very hard?
maybe you're not reading the documentation?
cj
We can't change django user model in between work
yes you can... but if you're doing it "in between work" that means you have had a bad design at first 🤷🏻‍♂️
Manish
I get alot of error when i introduced custom user model with extra fields.😞
007
Refer simple is better than complex website
Manish
Manish
Django doc says that you can't change user model after first migration. It will cause conflict
Manish
How can i overcome this problem. I tried finding tutorial for this but got no success.
cj
Django doc says that you can't change user model after first migration. It will cause conflict
you can if you're smart enough and you have to deal with migrations and some SQL stuff... I guess that's a little bit hard, if you're refering to that
cj
but again... if you wanna do that in the middle of the project, you have had a very very bad design at first...
Macurrent
better use it as a standalone front-end library, as it's intended 🙂
Yesterday i failed to make my ckeditor save data to database after using you approach. It was nice though
cj
if it's not too late for you, start from scratch again...
Manish
but again... if you wanna do that in the middle of the project, you have had a very very bad design at first...
Well i was not prepared for this. I thought it won't be required. But now i need to introduce custom user model😞
Macurrent
Today i was going through the ckeditor doc and it was different with the approach you gave me. AM having problem saving my files
Manish
@c0x6A can you provide some reference but django designing system?
cj
Yesterday i failed to make my ckeditor save data to database after using you approach. It was nice though
but why? it's supposed to send the data of the form as any other normal field 🤷🏻‍♂️
cj
@c0x6A can you provide some reference but django designing system?
it's dependant on your project, not by django itself... django is just a tool, if your project has a bad desing, Django won't fix it... you will use Django in a bad way 🤷🏻‍♂️ fix your project not Django
Macurrent
https://django-ckeditor.readthedocs.io/en/latest/ .Could you please have a look at that doc. I dont know if its good
cj
https://django-ckeditor.readthedocs.io/en/latest/ .Could you please have a look at that doc. I dont know if its good
well... if you want to use a bundled package 🤷🏻‍♂️ use it from the beginning... I'd recommend you to use the standalone library.. it's up to you
Manish
I have already integrated ckeditor using this.
Macurrent
It has no error. Its jxt not saving data. From the documentation. They went ahead and explained the getting and saving data. The problem is that they use php
Manish
you want ckeditor on admin panel or in website?
Macurrent
you want ckeditor on admin panel or in website?
I wanted it in both admin and website...
Manish
I wanted it in both admin and website...
For admin just use django-ckeditor's richtextfield
Manish
for website simpally use ckeditor js file and for content field use id tag with value "editor". And catch the value of that field.
Manish
use request to get the value of field.
Manish
if request.method == 'POST': content = request.POST['content']
Macurrent
better use it as a standalone front-end library, as it's intended 🙂
I cant find your procedure in the internet... I would have followed it
cj
I cant find your procedure in the internet... I would have followed it
I'll make a little sample project later, when I have time, to show you