token is already on template, but on post cant get csrf_token
doubitchou joined the channel
i use a class on views, what because of this?
hamub joined the channel
tneva82 joined the channel
foxmask
if you could show us the piece of code that display your form and save the data + the code of the template ; we try can see what is going worng
tneva82
Is there some sort of caching in django DB? Was looking at what SQL queries my page generates up. First load 8 queries. I hit refresh and only 7. I have identified SQL that went missing and certainly result is still visible on the HTML page. Not problem obviously(good if it has!) but just wondering why SQL queries goes down sometimes despite otherwise identical requests have lesser amount of
SQL queries.
shangxiao has quit
Debnet joined the channel
vdboor has quit
tulioz has quit
marmalodak has quit
Itkovian has quit
rokups joined the channel
waterCreature has quit
pendekar_langit has quit
tulioz joined the channel
Itkovian joined the channel
Nizumzen has quit
Combined2857 has quit
johnnypyve has quit
ubuntu_aze has quit
dlam has quit
kuter joined the channel
toxinu has quit
toxinu joined the channel
airstrik3 has quit
toxinu has quit
jtiai
tneva82: Django only caches results of querysets within queryset itself. There is no additional caching normally.
toxinu joined the channel
bochecha joined the channel
tneva82: There though exists session database backend with write-through caching. Which could explain what you see.
koniiiik
tneva82: Maybe you're setting some class attributes yourself without realizing...
airstrike joined the channel
lacrymology joined the channel
doubitchou has quit
jas02_ joined the channel
Lenz joined the channel
johnnypyve joined the channel
jas02_ has quit
lacrymology has quit
davur has quit
Popzi joined the channel
lacrymology joined the channel
Dennis82 joined the channel
arifin4web has quit
PabloSandav joined the channel
andygmb has quit
encod3 joined the channel
ubuntu_aze joined the channel
zamro has quit
plfiorini joined the channel
renlo has quit
doismellburning
db-backed sessions, so first load causes a Session INSERT?
(guessing here)
arifin4web joined the channel
StucKman joined the channel
FunkyBob
would help to know the code, template, and queries
StucKman
hi all. given the following model:
ubuntu_aze has quit
class CyrusUserModel(Model):
id = BigAutoField(db_column='AUT_ID', primary_key=True) # real_size=10
FunkyBob
don't paste in here ,StucKman
StucKman
FunkyBob: 3 lines
FunkyBob
read the topic
StucKman
ok, ok
FunkyBob
don't paste in here, StucKman
lacrymology has quit
now.. what's your question?
FunkyBob wonders if the answer is "editable=False"
Lauxley joined the channel
nazarewk joined the channel
kezabelle joined the channel
liothe has quit
morning, kezabelle
kezabelle
ahoy
kaizoku
YAARRR
Bajax has quit
StucKman
I was saying: given the model at the line 1 this: http://linkode.org/HOxwAD2s5oWf83NcaQhwT4 , how can I implement the sql query at line 10? I tried something at line 15, but I either get something that looks like None (line 19), or an exception (line 23). 'cyrus_crm-dev' is connected to the same mySQL db as the query
SimpleName has quit
FunkyBob: ok, ok, it was *more* than three lines :)
keimlink joined the channel
kuter has quit
FunkyBob
CyrusUserModel.objects.filter(is_active=True)
oops... is_actif
you likely want to mark supervisor as null=True too
StucKman
context: the table is a hierarchy of users, but it doesn't have a field marking supervisors. I can only findem as supervisors of somebody else
kezabelle
.filter(is_actif=True).distinct().values_list('supervisor', flat=True) would get you the distinct supervisor columns, I think
ASUChander has quit
StucKman
aha, and from there to the objects?
Ahuj joined the channel
FunkyBob
oh, missed the first line of the query
arifin4web has quit
StucKman
a query using id__in (sup_ids) ?
kezabelle
MyModel.objects.filter(pk__in=my_values_list) ... so it'd be a subquery, essentially
FunkyBob
aren't subqueries one of the (many) things mysql sucks at? :)
kezabelle
(unless you forcibly evaluate the values_list into a list/tuple/set, then it'd use the values themselves)
FunkyBob: for a given value of suck at :)
StucKman
FunkyBob: I can give a full list of things of which MySQL sucks at
kezabelle
it'll get gnarly at you sometimes for complex ones, or multi-nested ones, IIRC
vdboor joined the channel
but pk in some other simple query isn't usually the pathological case, IMHE.
annnnd I think recent versions are somewhat better.
arifin4web joined the channel
StucKman
ah, yes, then that, this one is not really recent
but that's 'an implementation problem' :-P
hylje
subqueries can be a less bad option when dealing with mysql
kezabelle
truth
FunkyBob
StucKman: so.. you want all supervisors of all active users?