Knyght: if I don’t get an answer in here I will, it’s just much easier and much faster to ask here first
:)
rain0r has quit
Knyght
I think it's going to be slower if nobody knows the answer
codeme has quit
gahbu joined the channel
shosca joined the channel
pyface joined the channel
disgrntld has quit
cebor has quit
anyonebutme has quit
blag has quit
codeme joined the channel
robbyoconnor has quit
cebor joined the channel
CashewGuy joined the channel
ybathia has quit
codeme has quit
qu9 joined the channel
whaack joined the channel
Or1on joined the channel
whaack has quit
chrisdrackett has quit
Haxor104 has quit
robbyoconnor joined the channel
Ergo joined the channel
cebor has quit
ybathia joined the channel
CrypticSquared joined the channel
chrisdrackett joined the channel
Nightwalkerkg joined the channel
Zren joined the channel
davea has quit
EduardoMartins has quit
davea joined the channel
arlekin joined the channel
arlekin
hi there
dang`r`us
oy
CrypticSquared has quit
arlekin
its silly probably, but im a bit confused - i'd like to have view for my landing page wired in a way that if user is logged on will be redirected to another view/url, but if he is not he should stay under current url and simply get the page
and i have no idea how to accomplish that
mattmcc
If request.user.is_authenticated(): ...
arlekin
mattmcc: that i know, the returns are a problem
vyscond joined the channel
how can i either return a page or redirect .
?
with class based views of course
cebor joined the channel
does my 'governing' view should be some special class ?
vyscond
arlekin see the docs there is a reserved variable to set this things
CrypticSquared joined the channel
mattmcc
Does it need to be a CBV?
AimerPaddle has quit
arlekin
or should i simply alternate between returning redirect and render_to_response
mattmcc: not really
mattmcc
In a CBV, I'd do it in dispatch.
arlekin
mattmcc: just figured it is the 'modern' way for handling things
mattmcc
If authenticated, redirect, else continue on as normal.
arlekin
mattmcc: thanks, i'll look into that
mattmcc
CBVs don't replace regular function views, there are always going to be cases where they don't necessarily buy you anything.
arlekin
so it could be a TemplateView ? if i'd override dispatch() ?
mattmcc
Yeah.
arlekin
great! i'll try doing that
thanks for help :)
vyscond
hey guys really need some clarification about nested objects on DRF. I was trying to pass a list of dictionaries through a post call but the all the dicts are being received as strings on the serializers .-.
Evidlo
Is there an example settings.py for me to go off of somewhere? Django 1.9 will not shut up about my TEMPLATES dict missing items.
jessamynsmith has quit
arlekin
vyscond: isn't that like the whole point of serializers ?
dang`r`us
Evidlo, generate a new django 1.9 project
arlekin
vyscond: i struggled with such matters in DRF recently so maybe i could be of help
vyscond: oh well... i thought you have some nesting issues related to... well.. relations in database, im afraid i'll be of little help here after all, didn't even know there was 'ListField'
newton_ joined the channel
harmaahylje has quit
tempp joined the channel
si14_ joined the channel
mattmcc: funny thing, just discovered that request passed to dispatch is actually some kind of 'meta' request and i need to do: 'request.request.user...' to check
contracode_ joined the channel
vyscond
arlekin ok bro
mattmcc
arlekin: Eh, no, it's not. What does your view look like?
tomwardill_ joined the channel
rdmurphy_ joined the channel
arlekin
mattmcc: i messed up something, just realised
JayFK_ joined the channel
SWAT__ joined the channel
hyperair has quit
hypera1r joined the channel
rfv_ joined the channel
dobie_gillis joined the channel
govg_ joined the channel
AntiSpamMeta has quit
vyscond
arlekin you messed up for real, no?
linovia_ joined the channel
arlekin
mattmcc: its okay now: i misread, and put 'request' in dispatch argument instead of self, hence confusion