how do i create an endpoint for a singleton resource
FunkyBob
"the" rest framework, eh?
ItaRi joined the channel
at a guess, you'd subclass a detail view
Relaed has quit
dogeydogey has quit
OnkelTem has quit
NBhosting joined the channel
chamindu
yes the rest framework
will try that
OnkelTem joined the channel
FunkyBob
by "the rest framework"... do you mean the 3rd party all "Django REST Framework"
because there are several others
NBhosting
if request.domains contains a list of domains, how can i check if a user.domein is in the list of domains can i do a __in in a ifset?
sayan joined the channel
chamindu
django rest framework
DRF
FunkyBob
chamindu: details matter
Relaed joined the channel
mstrcnvs
NBhosting: like "if user.domein in request.domains:"
?
NBhosting
of that easy?
o.
gona try
mstrcnvs
we're talking about python?
then, yes, that easy
FunkyBob
mstrcnvs: some people still aren't prepared to accept things can be easy
Symon|away is now known as Symon
NBhosting
so true
:D
mstrcnvs
import antigravity
jreyno40 joined the channel
epsy has quit
robmorrissey has quit
robmorrissey joined the channel
robbyoconnor has quit
r0bby_ joined the channel
mstrcnvs has quit
r0bby_ has quit
tightflks_
schinckel: would i still use modelform?
but pass that to a formset?
Palash has quit
citizen-stig joined the channel
munichlinux has quit
zkanda
chamindu: Singleton's are anti patterns!!!!!!!!
tightflks_
can you not have two foreignkeys to the same model?
EstebanVelour joined the channel
DaneoShiga has quit
munichlinux joined the channel
FunkyBob
tightflks_: you sure can
schinckel
tightflks_: probably (re modelform/modelformset)
tightflks_
yeah i just found the piece about related names
so that allowed me to do that
Niharika joined the channel
robvdl has quit
munichlinux has quit
Guddu has quit
bkuberek has quit
ragsagar joined the channel
how do i pass the user attribute
to the form?
ajay123 joined the channel
mathjoke joined the channel
aeikenberry has quit
LordVan joined the channel
ajay123
I am using django-voting app :https://github.com/jezdez/django-voting, when i try this function form its doc: get_top(Model, limit=10, reversed=False),,its returns a dictionary of model name and score.
Dreadatour joined the channel
How do i use the model specific fields using this function
if i want to know if there is objects with a conditions, is better use: if Model.objects.filter(...).count() than: if Model.objects.filter(...) ?, in case i dont need the objects.