Orack
lots of python modules have been released
Prateek
i dont know what is system programming ?
Anonymous
Any link is there
Master
lots of python modules have been released
Count this in "general scripting" please :)
Orack
i dont know what is system programming ?
just get to learn something, node js if u like js or django if u like python
Anonymous
YouTube link from starting basic django
Doragonsureiyā
YouTube link from starting basic django
Check out PythonRes, a channel for Python resources (links to help you out).
Orack
!res
Oo seeing u after long time
Anonymous
Ya
Anonymous
Bro
Anonymous
Ya i see python and alla things
Orack
!res
https://hastebin.com/ejeyoreqic.py do u now how to update a unique object if it already exists using a single url ?
Orack
currently it throws error
Orack
user=001 is already saved in database in class As view , then when I post user=001 it shows that alreay exists as it is unique before userid data 001 abc I want userid data 001 xyz
Master
You have unique property for userid, so you can't create another 001-userid. If you want to update already existed record, use https://docs.djangoproject.com/en/2.2/ref/models/querysets/#update-or-create
Master
where shoud I use it in my case in serializers or views ?
serializer. Just rewrite your A.objects.create( userid=userid) to update_or_delete
Master
Just be careful, because default parameters of update_or_create
Preeti
hello all ...plz rly on this question which skills required for django? as a beginner
Master
> Python, common-sense, OOP
Anonymous
And have some Knowledge about front-end
Doragonsureiyā
And have some Knowledge about front-end
Please don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello I need help on $z" Just ask about your problem directly! With 48k+ people the probability that someone will help is pretty high. Also please read: http://catb.org/~esr/faqs/smart-questions.html
Master
doesnt work 😐
Doesn't work with which error?
Orack
{"error":{"userid":["a with this userid already exists."]}}
Orack
class Aserializer(serializers.ModelSerializer): class Meta: model =A fields='__all__' def create(self, validated_data): userid=validated_data.get('userid') instance = A.objects.update_or_delete( userid=userid) return instance
Master
Err... update_or_create(userid=userid, default=**validated_data)
Master
Read about default param for update_or_create
Orack
Why sending a list tho?
i didnt send list, it shows error like that
Orack
update_or_create(defaults=None, **kwargs)[source]
Master
Ok, what are you try to achive? Your A model and Aserializer have only userid field. What are you try to do with it?
Orack
if new data is sent to same userid
Master
> userid to be unique, and also want it to be updated You don't have a data in A model, your data in B model
Orack
so this userid to be unique, and also want it to be updated
Orack
hasn anyone used mezzanine ?
Orack
which cms is best
Adonis
hasn anyone used mezzanine ?
Am experienced in Django CMS and Wagtail CMS.
Adonis
which cms is best
Don't know much about mezzanine but I would recommend you Wagtail CMS
Adonis
It is more modern an simple than others, it is quite more technical to write Django CMS's plugins than Wagtail's one. For example
Adonis
Check this article: https://dev.to/simo97/djangos-world-cms-1aec
Orack
Check this article: https://dev.to/simo97/djangos-world-cms-1aec
nothing much explained related to technical or non-technical context
Adonis
nothing much explained related to technical or non-technical context
Yeah I know it is just a kind of comparison check list
Adonis
What do you want to know exactly ? Have you use one of them ?
Orack
nvm ill give wagtail a try
Adonis
nvm ill give wagtail a try
Yep I recommand it also...
Anonymous
Hi everyone, what is the best way to load test, stress test my django application
Anonymous
what should be the parameters? should i test for only one url or should i include all the urls on my api server to test?
Orack
Hi everyone, what is the best way to load test, stress test my django application
if its commercial u can ask some professional to test it, or release it in beta intrested people may report bugs
Anonymous
no, its a pet project and i want to test that myself
Anonymous
Is it necessary to use API if I want to deploy my ml model or any other ways?
Itay
How can i send the render content into a js file?
Adonis
How can i send the render content into a js file?
Into a js file ? Not sure to understand
Adonis
By doing an Ajax request you can get the result of a view and store it in a variable
Adonis
A js variable
Itay
Yes, just get the content into the js as vars
Eric
Hi everyone, what is the best way to load test, stress test my django application
Use locust (https://locust.io/) test all the URLs. Also do something to profile your back-end queries (maybe start with django-debug-toolbar)
Anonymous
thanks @ekiara
Fer
Gente alguém aqui tem experiência e disponibilidade para criação e deploy de um projeto piloto de gerenciamento de pacientes em UTI para eu colocar em teste em dois dias ? Já tenho o domínio registrado no registro.br Favor entrar em contato no pv para combinarmos valor.
Fer
Use Google Translator please.....from portuguese to en
Orack
https://hastebin.com/aguvekuwis.py
Orack
Im almost there "error": "cannot unpack non-iterable B object" what does this mean
Leonardo
class DeliveryFee(models.Model): min_price = models.IntegerField() max_price = models.IntegerField(null=True) price = models.IntegerField() @classmethod def get_by_total_amount(cls, total_amount): return DeliveryFee.objects.get(cls.min_price >= total_amount, cls.max_price <= total_amount) guys how can I do the method get_by_total_amount work?
Arturo
filter with gte and lte