Orack
lots of python modules have been released
Prateek
i dont know what is system programming ?
Anonymous
Any link is there
Master
Anonymous
YouTube link from starting basic django
Mirco
Orack
!res
Oo seeing u after long time
Anonymous
Ya
Anonymous
Bro
Anonymous
Ya i see python and alla things
Mirco
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
Orack
Orack
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
Anonymous
Eric
Master
> Python, common-sense, OOP
Anonymous
And have some Knowledge about front-end
Mirco
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
Orack
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)
Rohan
Master
Read about default param for update_or_create
Rohan
Orack
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
Orack
if new data is sent to same userid
Orack
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
Orack
so this
userid to be unique, and also want it to be updated
Orack
hasn anyone used mezzanine ?
Orack
which cms is best
Orack
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
Adonis
Adonis
What do you want to know exactly ? Have you use one of them ?
Orack
Orack
nvm ill give wagtail a try
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?
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
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
Itay
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.
Adonis
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