Hi guys, I want to start using Sass for a django project of mine that I've been working on for a few years? Whats the best way to about doing this?
Olajyd has quit
staticshock
shogundynamite: heroku, elasticbeanstalk?
Coldblackice joined the channel
shogundynamite
Linode VPS
blackcross
So I have this javascript function: https://dpaste.de/sRVw and the response I am using is "return JsonResponse({'purchased': True})" how do I properly find out if purchased is set to True in javascript? I thought data['purchased'] would be correct, but it does not seem to be.
staticshock
shogundynamite: oh, i misread your question
mattmcc
shogundynamite: Asset managers like django-compressor or django-pipeline might be helpful.
madprops has quit
zujko joined the channel
shogundynamite
mattmcc: I saw some of those but the ones I found weren't very popular, I'll check out them out now.
dcrouch has quit
blackcross
found out why, i didn't have the d in purchased :(
zujko has quit
what is the pep standard for naming variables/json like that? just use present tense always?
guess i should use {'success':True} or {'success':False} would be best, so it will be universal
dheerajchand
Hey, so I can write a query on the model tables in PSQL, but I am having trouble translating to the Django ORM. Anyone mind helping? https://dpaste.de/pv5s
mattmcc: Do you mind if I deconstruct that and walk my way through it with you?
mattmcc
It produces essentially the same query.
You can see the result by doing qs = ^; print qs.query
dang`r`us
vyscond, not redis ... django session
dheerajchand
For all Crime objects, using the value of the field called `ward` as a key, create a value called `cc` that is a Count of all primary keys in that grouping, then show a list of JSON, where the property:value are ward: ward_id, cc: cc
vyscond
what?
raijin has quit
mattmcc
dang`r`us: What do you mean by collisions?
dang`r`us
nevermind, I'll get back to that issue once I solve everything else here
okay so real quick
mattmcc, request.session is more or less a dictionary, right? so, when putting something in there, should I prefix my key with my.app.fqdn or something?
to avoid stepping on others
nirakara joined the channel
mattmcc
Oh. If you're worried about your keys being overly generic, I suppose it'd be prudent.
Like I probably wouldn't set request.session['data']
dang`r`us
yup yup
this
dcrouch joined the channel
dheerajchand
mattmcc: I tried readin the documentation for the aggregate/annotate functions and it was just Esperanto to me
Your example made it more clear
dang`r`us
guess I'll prefix stuff with myappname-
dheerajchand
Any chance you can refer me to a really idiot level tutorial?
dang`r`us
should be safe enough
dcrouch has quit
hive-mind has quit
vyscond has quit
hive-mind joined the channel
madprops joined the channel
whaack joined the channel
vibepositive has quit
Olajyd has quit
TodPunk joined the channel
whaack has quit
Olajyd joined the channel
nirakara joined the channel
mihow has quit
mandeep has quit
arlekin
here i have interesting problem guys - probaly wrong channel to ask it, but if someone could point me where should i seek support than would be quite enough
so here goes...
jessamynsmith joined the channel
i want to allow users to create their avatars
by selecting various options
stacked on top of one another as layers
for instance bottom layer would be heads with different skin colours
then few different faces
then hair on top of that
i have few - let say - sprite's grids for that
and through simple css modifications im aligning them within some viewport
to create final image
but i'd like to store resulting avatar as flat picture
for displaying it on subsequent occassions
and i wonder how can i achieve that
any ideas ?
dang`r`us
that sounds like a job for <canvas>
MarkusH
arlekin: so, once a user is happy with what they chose, you submit that information to your Django application on do the overlay there
arlekin
MarkusH: so basically you are sayin i should send offsets and do same thing on the server side ?
dang`r`us: could you elaborate, im not familiar with <canvas>
MarkusH
arlekin: that's what I'd probably do. No idea if there's any front end side way to create the image
MarkusH neither
dang`r`us
well <canvas> is for bitmap manipulation basically.
it's almost 5am here so not giving a detailed intro .....
dang`r`us: same here, im not asking for tutorial ;) just wanted some hook
i'll look into canvas then
MarkusH: you don't know perchance any lib for such gluing layers of pictures in python ?
MarkusH
arlekin: pillow
that does *all* the image magic in python
former PIL
arlekin
MarkusH: reference to imagemagic intended or not ?
Jameswine joined the channel
MarkusH
kind of
arlekin
i see, i'll into that either then
Jameswine
If I have files that people are downloading from my website, what is the best way to handle generation and serving? Right now we have a downloads folder that gets zipped and cleaned for each set of files generated.
darkxploit joined the channel
dang`r`us
if you use canvas you probably won't need pillow
I mean it all depends a bit on your use case but personally I would probably compose it all in the browser, just using canvas
arlekin
i guess the perfect thing would be to kinda "screenshot" content of designated div
dang`r`us: the composing part is easy, since i already have my grids and its matter of moveing <img>'s, i worry about producing result though
MarkusH
arlekin: use the toDataURL() on canvas and send the data off to Django