mcspud: Do i have to be retriving the function, or can I get the return? I'm terferring to attr= on line 12
Troy^ has quit
aossama has quit
cyphase has quit
schneid_3306 joined the channel
cyphase joined the channel
jerrcs has quit
schneid3306 has quit
jerrcs joined the channel
TheOrangeOne joined the channel
a5m0 joined the channel
adwin_ joined the channel
aossama joined the channel
timkofu joined the channel
edigiacomo joined the channel
xaldafax has quit
Biwaa joined the channel
Akari_ joined the channel
Akari_ has quit
Leeds has quit
adwin_ has quit
cyphase has quit
pgcd
leaving this for the logs: using mock.patch() on a context processors, with template caching enabled, seems to break tests in very original and inventive ways, for a long time after the fact
solution: don't patch context processors in tests.
Xiti joined the channel
unixbeard has quit
Wooble has quit
cyphase joined the channel
Koterpillar joined the channel
Koterpillar has quit
Wooble joined the channel
cyphase has quit
cyphase joined the channel
greg_f joined the channel
tulioz has quit
Biwaa has quit
mreznik joined the channel
maks25_ joined the channel
cyphase has quit
maks25 has quit
maks25_ is now known as maks25
FinalAngel joined the channel
cyphase joined the channel
steam_bell has quit
Troy^ joined the channel
foxmask
bonjello
sjdines has quit
Troy^ has quit
cyphase has quit
lb1c has quit
jarshwah_ has quit
mitaka joined the channel
Koterpillar joined the channel
Koterpillar has quit
cyphase joined the channel
adsworth joined the channel
Guard1an has quit
Leeds joined the channel
mine0901 joined the channel
cyphase has quit
SimpleName
in django template, when I show one instance in form, should I do it like this: {{form.isntance.field}} ??
cyphase joined the channel
lb1c joined the channel
Debnet joined the channel
drodger has quit
jayfk joined the channel
drodger joined the channel
drodger has quit
jeyraof^mbpr joined the channel
john2x joined the channel
Croepha has quit
helo joined the channel
_ursan_ has quit
cyphase has quit
EyePulp joined the channel
gadams joined the channel
Echoloth joined the channel
Echoloth
Hello!
Friends, I am in dire need of help
I want to make a thing that involves background jobs and I am not sure what tool to pick
drodger joined the channel
jtiai
Echoloth: celery is quite common tool. Cronjobs also does their job quite fine.
Echoloth
I want to make a tiny game. Travian/Clash of clans/Illyriad type. Each player has a city, each city has a building. The building has level. It produces resources proportional to its level every minute. It can be upgraded to increase its level by 1, but it takes time and resources
So two background jobs
1. Give each player resources generated by his buildings
al3n joined the channel
2. Apply any scheduled building upgrades
cyphase joined the channel
jtiai
celery beats (scheduler) or plain cronjob would do the trick.
Echoloth
Yeah I thought about celery
hylje
you need just one game mechanical cron task that will pick up when it ran last and applies any changes that should have happened since then
SimpleName
form[‘phone’] can get <django.forms.boundfield.BoundField object at 0x111ab96d0>, but if ‘phone’ is a variable , how to get the field data
just like form.get(‘phone’) but you know form is an object
Echoloth
Let me state why I didn't just pick celery / whatever
jtiai
SimpleName: you mean from from.cleaned_data ?
SimpleName: form.cleaned_data? Or you mean that you post random field that has on equivalence in form fields?
SimpleName
jtiai: not cleaned_data,
Echoloth
My concern: if there are 10000 timers, out of which 1000 are about to complete, and I run a celery job every second to query a table of timers (using simple .filter(time_finished__lte=now))
won't I screw up my database with constant querying?
jtiai
Echoloth: You wouldn't do that.
Echoloth
jitai: How would I go about it?
jtiai
One job that takes care of all timers.
Echoloth
I am now looking at django-channels as an option
jtiai
Echoloth: That won't resolve your problem.
it just creates another problem for you.
Echoloth
jtai: In my example I meant that I would run one celery job that would get all finished timers from db and perform actions on them, so yeah, one jon
jitai: how would you do it?
SimpleName
jtiai: I mean if ‘phone’ is an variable, you can’t do like this directly form[phone_var].value(), maybe it’s one python grammar problem
rokups joined the channel
jtiai
SimpleName: What variable? Can you post code example in pastebin?
SimpleName
of course
jtiai
Echoloth: Job that reads all changes that has to be done, does it and updates db.
jitai: Won't it be a major slowdown to keep the timers in database?
jtiai
That would be the simplest form, unless your task calculations aren't very complex could pretty well hold up to 100k concurrent tasks.
At some point your tasks queue will start saturating. When that happens you need to start figuring out something new.
But YAGNI at least not now.
phinxy joined the channel
Haudegen joined the channel
I bet that your game doesn't yet have even hundreds of players? :D
Echoloth
Heh
Well since its a learning exercise I might as well assume it does
but I see your point
Yeah I think I will just do it with a celery job
jtiai
Well that's the pitfall - you optimize something that you can't very well even measure.
hylje
important learning experience: don't optimize for problems you don't have
oEfterdal joined the channel
jarshwah_ joined the channel
jtiai
^^ very good experience.
Technodrome
anyone's job hiring?
jtiai
We're constantly.
cyphase has quit
Technodrome
where at?
jtiai
Technodrome: Finland.
Echoloth
Thanks guys!
Technodrome
ah , yeah, i'm in nyc :(
hylje
should've said that
:^)
jtiai
Echoloth: Good example, one of our products we produce reports - our reporting engine has worked just fine almost 10 years (written with Python and Django).
tourdownunder has quit
Echoloth: Just this January we hit first time problem that report generation was too slow for our new customer.
Technodrome
i've really been having a hard time finding employment after 6 years at another company