the other way is Question.objects.annotate(choice_count=Count('choice')).filter(choice_count=0)
blackfry joined the channel
foxmask
bonjello
AzMoo joined the channel
AzMoo has quit
FunkyBob
foxo
mastizada has quit
mastizada joined the channel
bradfordli123 joined the channel
marlinc has quit
deltaskelta joined the channel
kmodo joined the channel
kmodo
hi, really noob question: doing a query as a listview, and returns as object_list, how can i rename that so I can use {% for project in projects %} instead of in object_list?
FunkyBob
quite sure the docs cover how you can set that name
context_object_name ?
deltaskelta
I'm having some trouble understanding what the docs mean about validating formsets (MAX_FORMS), example here: https://dpaste.de/mhQK
FunkyBob
I believe by default you will have object_list and {model}_list
true, i was doing a couple other views this way return render(request, 'search.html', { 'query_string': query_string, 'posts': posts }) and didn't realize all I needed to do was set a variable
greg_f has quit
mattste joined the channel
FunkyBob
careful passing raw query strings to templates...
mattste has left the channel
not_a_web_devbot has quit
jessamynsmith joined the channel
kmodo
I believe I'm just doing it as a "you searched for..." thing, is it dangerous that way without being sanitized?
mattste joined the channel
FunkyBob
yes
Rune joined the channel
SamSagaZ has quit
ekkelett has quit
pyface has quit
jessamynsmith has quit
kmodo
from an injection standpoint?
mattste has quit
iron_houzi joined the channel
ekkelett joined the channel
skeuomorf joined the channel
FunkyBob
yes
kmodo
I didn't know that, thought django sanitized everything
greg_f joined the channel
pyface joined the channel
Biwaa joined the channel
pedro_ joined the channel
not_a_web_devbot joined the channel
Lokefar joined the channel
not_a_web_devbot has quit
pedro_
hi all, is it possible to only change the hostname to something else than localhost in StaticLiveServerTestCase?
FunkyBob
kmodo: well, it depends
mattmcc
You can put an entry in your /etc/hosts that points to localhost..
pedro_
mattmcc: already have that, I would like to make tests use that domain...
Biwaa
that point to 127.0.0.1 (as you can't put an other name but only an ip) :)
If it's just a class attribute.. Set it in your test.
pedro_
it's dynamic and only gets created later, changing it at that point won't affect the localhost part
the hackish `self.live_server_url = self.live_server_url.replace('localhost', self.tenant1.domain_url)` does work but quite ugly :)
compow has quit
rokups joined the channel
Leeds has quit
pupil has quit
badet0s joined the channel
tulioz has quit
samj1912 joined the channel
mastizada joined the channel
zamro_ has quit
flobin joined the channel
zamro joined the channel
dlam has quit
moerin joined the channel
zamro has quit
SimpleName has quit
Biwaa has quit
Biwaa joined the channel
SimpleName joined the channel
mar77i
hmm, I'm wondering. how far I should write this cache thing myself. This is kind of a gateway proxy whateverthing which is supposed to cache external resources after some post-processing.
Ahuj joined the channel
one thing I wonder especially is whether I should store the data in the database or as files, which can be text and binary, images I don't think past a few mibs...
I think cleaning up is simpler when I only have database rows to clear...
mattmcc
If it's a few mb, it'd fit in memory just fine.
madboxs has quit
mar77i
yes. the piece.
but there will be quite a few requests to quite a few pieces, dunno, some 3-figure per day
mattmcc
Oh, you mean a few mb per image?
mar77i
yup.
oh, let me check anyway
nah, it's not even mibs. it's usually not even hundreds of kilobytes. but having thousands of ~100 kib-heavy entries in a database doesn't seem right to me...
StvnW has quit
mattmcc
Yeah, I was thinking more like redis.
brxs joined the channel
Ahuj has quit
mar77i
the entries expire after a few weeks.
not_a_web_devbot joined the channel
mattmcc
You can set ttls on redis keys.
mar77i
some at least. I don't know whether I want to add another dependency, as I have a dedicated media directory an a django app on postgres already
*that depends on
mattmcc
It's not exactly a difficult thing to set up.
It also makes a good option for Django's cache system anyway.
mar77i
I imagine it could be added to requirements.txt, right?
mattmcc
No, it's not Python.
You'd install it from distro packages, like Postgres.
mar77i
ugh.
EyePulp joined the channel
not_a_web_devbot has quit
mattmcc
apt-get install redis-server, done.
foxmask
Does someone (try to) use VueJS with Django ?
I search some tips / advices on how to make them work altogether
not sure if I can mix django template and vue template or make 2 things completly seperated