but this is not the main problem. I just don't see why altering the templates produces no results
rasca has quit
rasca joined the channel
got it
wrong templates set :)
Linovia has quit
maxvi
jdunck: Yes it was easily)
Linovia joined the channel
JJMalina
inside an app is there a way i can make a fixtures folder in my tests directory with fixtures that are only for testing?
cant figure out how to tell the test to read them from there
citadelgrad has quit
sgnb has quit
mattmcc
JJMalina: I tend to just put them in a 'tests' subdirectory.
__love__
JJMalina: anything not named `initial_data` won't be loaded by syncdb. and you can load fixtures by any name inside a test.
JJMalina
ah ok
i did appname/tests/fixtures/myfixtures.json
i feel like it's not a bad idea to have test fixtures in their own folder within tests
gremly has quit
mattmcc
It'll need to be appname/fixtures for the loader to find it.
I tend to use appname/fixtures/appname/tests/foo.json
XofP has quit
JJMalina
oh ok
bradleyayers joined the channel
__love__
yeah, i usually name them after the model.
mattmcc
Not unlike how you'd structure templates in the app's templates dir.
JJMalina
well that works now
funny though, the test output says "Installed 0 object(s) from 0 fixture(s)
"
even though it did install objects
maxvi
when I try use TabularInline in admin I get an error but if I set option "editable" of field "id" in True I won't get this error but an user will be able to change the field "id". Piece of the code here http://dpaste.org/qOwEM/ How can I disallow edit the field "id"?
jj0hns0n has quit
jj0hns0n joined the channel
chrislkeller has quit
antihero
urgh, I can't get the recursetree tag to work for django MPTT
sambao21 has quit
dandrinkard has quit
mattmcc
antihero: Personally I prefer the tree_info filter.
Does anyone know an app for posting to Facebook, Twitter, Google+ etc? I see only two and they are not really maintained it looked like
gongyiliao joined the channel
StuckMojo
phildini: thanks
phildini
oisa: posting to twitter, google+ and linked in is pretty easy (just pass a url) posting to fb is a little trickier, but definitely doable. have you thought about writing your own module?
__class__ has quit
oisa
phildini: Oh I didn't know. I was looking for a 5 minute solution but maybe I will do that
krassinger
oisa: i tried the $.post method to call my view and store the new position of the draggable, but it's not working for some reason...
that is i'm doing $.post("/dragged/"+name+"/"+x+"/"+y+"/");
so it works if i go to /dragged/krassinger/100/100/ in the browser
but if i drag to the position, it doesn't store it
ah, just clicked on jaddison's link
i think that's it :)
oisa
krassinger: oh good
StuckMojo
i can't figure out why that print doesn't work
notanumber has quit
not that i really need it of course
krassinger
but how do i put the csrf token into the jquery?
neataroni joined the channel
neataroni
is there a method to get just one object from a queryset?
kvda joined the channel
mattmcc
neataroni: It behaves like a list, you can slice it. Or there's qs.get(...)
neataroni
mattmcc: well, i thought there was a way to tell it not to bother getting the whole thing, i figure by the time its a list, its done more work that it had to
if i just want an arbitrary single object from a queryset
mattmcc
It's lazy, it won't execute until it needs to.
neataroni
ok
mattmcc
qs[:1] is 'LIMIT 1'
__love__ joined the channel
krassinger
actually, if the view doesn't have any csrf mention in it, can it still be a csrf issue?
neataroni
mattmcc: alright, that sounds good. for some reason i thought there was a .one()
oisa
krassinger: see if you have the middleware enabled too
bradleyayers has quit
krassinger
yep it is
mattmcc
neataroni: Well, that's essentially what qs.get() would do, except it's written to raise exceptions when 0 or >1 rows match the criteria. If you want it to fail silently (give you an empty list) then you'd use [:1]
AlbireoX has quit
neataroni
mattmcc: that seems pretty reasonable
mattmcc
To do that, though, it has to do a count(qs)
krassinger
can i just pass the csrf token as another argument in the url?
or is there a better way?
e.g. $.post("/dragged/"+player+"/"+x+"/"+y+"/", {% csrf_token %});