whereas _perm is our session flag which defines the session to be permanent
the_rat_ has quit
optixx has quit
optixx joined the channel
tompaw joined the channel
tWoolie has quit
jayant__
apollo13: ok so i just import this class and use that function directly
apollo13
uhm
no
that's a middleware
kezabelle joined the channel
jayant__
ok, so i use that same logic in my code
how do implement it?
VadtecWk has quit
altipard has quit
apolloa13: how do i implement it?
ObseLeTe joined the channel
altipard joined the channel
codepython777 has quit
apollo13: how do i implement it? do i set the _perm value to something?
or remove it.
if remember me not needed
apollo13
neither nor
if remember me is not needed don't set _perm in the session
if the user wants to be remembered set _perm in the session
Vadtec has quit
jayant__
apollo13: ok thanks :D
jspiros has quit
pydave6367 joined the channel
Holocaine joined the channel
altipard has quit
goldfish has quit
ben_nicoll joined the channel
the_rat joined the channel
munichpython joined the channel
munichlinux has quit
tuxcanfly has quit
munichlinux joined the channel
rams3377 has quit
tuxcanfly joined the channel
munichpython has quit
tuxcanfly has quit
krak3n` joined the channel
xpen has quit
sylock joined the channel
xpen joined the channel
the_rat_ joined the channel
the_rat has quit
swex joined the channel
kinabalu has quit
TrioTorus has quit
NomadJim joined the channel
tuxcanfly joined the channel
TrioTorus joined the channel
kyrix joined the channel
Fid has left the channel
willie has quit
goldfish joined the channel
QuanSai joined the channel
QuanSai
heya
Any nice guides on using ImageField and handling files? Any example code?
jonasliljestrand joined the channel
gsin joined the channel
sylock
Hello guys. When using the values() method on a queryset, foreign keys are displayed with their ID. How can I do if I want to construct a complex data structure to make it a JSON string?
do I need to subclass the values() method to add some informations at each iteration?
cramm joined the channel
Luyt has quit
bmcorser
sylock: you can use json.dumps(obj) to get python to represent objects as json
xpen has quit
munichlinux has quit
cheshair
hi! i want to use a class based generic view to let my users to create orders (model "order") with multiple items (model "orderline"). is there any way to achieve some inlinetabular (or similar) to let the user to add items on the same form as the order?
sylock
bmcorser: I just tryied but it says that my object is not "JSON serializable'
munichlinux joined the channel
Luyt joined the channel
bmcorser: so I did a get on one of my object and put in a variable
xchu has quit
then did a json.dumps(var)
bmcorser
sylock: what query method are you using; filter, get, name_in?
sylock
get
a2on joined the channel
pydave6367 has left the channel
bmcorser
can you json serialize one of your objects?
pydave6367 joined the channel
m0rpho joined the channel
sylock: ?
sylock
no I'm not able to do it
maybe I'm using the wrong module?
bmcorser
import json shout do it
sylock
I imported json like this : import json
bmcorser
*should
the_rat_ has quit
do you use pdb or ipdb?
sylock
do I have to import a django json module?
bmcorser
no, the python json module should be finsd
sylock
I can use pdb but I'm currently in ./manage shell
kezabelle
... have you tried using the django object serializers?
Any nice guides on using ImageField and handling files? Any example code?
jonasliljestrand
if i have a tabularInline class. And i set readonly to some fields. Then when i click "Add another" i want a different form with those fields editable. How do i do?