i hava a post model that i'm rendering, but this post can be voted, and I needed something that know that this post has been already voted by the user on the template
i have*
fpk^away is now known as flashingpumpkin
flashingpumpkin is now known as fpk^away
bpietro joined the channel
lexflex joined the channel
fpk^away is now known as flashingpumpkin
Fuyou
well, you would like vote to be many-to-many model on user and post
seagreen joined the channel
and grab it in your view
luanp
yes, i have a posts and a votings app
Fuyou
well allow_vote = not Vote.objects.filter(user = request.user, post= current_post).exists()
what the problem?
pydanny has quit
luanp
but I'm rendering a lot of posts
Fuyou
then you may try annotate()
luanp
hmm..
i'm doing one on my PostManager
but it's to get the post reputation
Laybunz has quit
darkmutt joined the channel
aseemraj joined the channel
darkmutt
hi guys I'm new to django and I think i just might have correctly linked psql with django, what would be a good way to check that?
odinido has quit
anthonydb has quit
dirn joined the channel
Siecje
darkmutt: can you do python manage.py syncdb
darkmutt
that means its not correctly linked, although it didn't splash an error at 127.0.0.1 as it did earlier now it says peer authentication failed,thanks siecje ill figure something out i think :)
flashingpumpkin is now known as fpk^away
Siecje
syncdb creates tables in your database for your models
Fuyou
darkmutt change auth method
darkmutt
new to all of this here so i have yet to learn what that exactly means
dirn has quit
Fuyou
pg_hba.conf
it's some funny postgress auth methods, they say you better change auth method to md5 if you are novice
well i had to re-install postgres from batch installator run file and it seemed to fixed all steps
fpk^away is now known as flashingpumpkin
darkmutt
hmmm i have to admit i was wondering why the tutorial was telling me to change it to md5 without even trying to explain as to why i should do it
Jarus has quit
ToApolytoXaos joined the channel
xorox90 has quit
Jarus joined the channel
LysergicDreams joined the channel
jstump has quit
geaden_ joined the channel
the_rat has quit
the_rat_ joined the channel
shredding has quit
heedly joined the channel
sohail has quit
donkdonk has quit
the_rat_ has quit
the_rat joined the channel
sohail joined the channel
H25 has quit
jtri joined the channel
endra joined the channel
jtri
hello, good afternoon, salutations (and all that stuff): I'm wondering what is the best/good way to populate a form with a select (drop down) of table names, i.e. model names?
m4r10_ joined the channel
i'm aiming for a couple step wizard for doing CSV extracts, 1) select the table/model, 2) select the columns, 3) get the file
purkinje joined the channel
hyperair joined the channel
i'm looking for something like ModelsChoiceField, i think, noting it's Model(s) plural
and i'm looking to select from the models, first
velcrow has quit
kanja
I'm trying to set things up so I can use coffeescript along side django
but every solution I've found so far requires node to be installed on the application servers for the collectstatic step
is there a way around that?
batisteo joined the channel
djn has quit
Laybunz joined the channel
ehmatthes joined the channel
ehmatthes has quit
wwilliams joined the channel
donspaulding joined the channel
odinido joined the channel
donspaulding
Anyone know how I can teach django that accessing files in /tmp/ is not a SuspiciousOperation?
faust joined the channel
The user doesn't upload anything to /tmp/, I'm taking the user uploaded file, running some imagemagick commands on it, and then re-storing it on the FileField.
shredding joined the channel
flashingpumpkin is now known as fpk^away
Fuyou
donspaulding won't be better to use stringIO ?
donspaulding
I'm shelling out to imagemagick, which wants real filenames.
Fuyou
but before i switched to it i was operating with tmp alright
tanath has quit
ah, i should do it too some time )
guess it much faster than with PIL
bytephilia has quit
hyperboloid joined the channel
Do you use django.core.files.temp.NamedTemporaryFile ?
donspaulding
Fuyou: I didn't switch for performance reasons. I needed to be generating a CCITT Group 4 Compressed TIFF image, which PIL couldn't do.
maZtaiR has quit
Fuyou: I didn't know that existed, so no. But I'm looking into it now...
garrypolley has quit
Fuyou
Well, i do have performance reasons )
jstump joined the channel
timg joined the channel
I force all images to be converted to png
donspaulding
Fuyou: I was just saying I don't know that it's any faster to shell out to IM instead of running PIL in-process.
Fuyou
I guess python is just not language for strong math
hhatch has quit
aganezov joined the channel
donspaulding
I wouldn't know, I'm not human for strong math ;-)
kenbolton joined the channel
bytephilia joined the channel
lgp171188 joined the channel
lgp171188
Has anyone done a RPC to rabbitmq via Pika in Python from a django view?
Is it possible to do such a thing?
I tried doing such a thing and got a connection closed error.
Siecje
in a class based view that gets an id from the url how do I access the id?
bpietro has quit
lexflex has quit
val_erie joined the channel
bpietro joined the channel
Fuyou
Siecje you mean some like /mysite/mymodel/4/ -> 4 ?
Siecje
right
val_erie has quit
subbyyy has quit
kdawggg joined the channel
Fuyou
you make regex with capt group and pass group name to view
merb
(?P<pk>) <
or
(?P<field_id>)
and then use slug_field
Fuyou
or there is something unusual for model-based view