16:49 PM
stealthii joined the channel
16:49 PM
iiie joined the channel
16:51 PM
shredding has quit
16:51 PM
MrJmad joined the channel
16:56 PM
lucasxu joined the channel
16:58 PM
lucasxu joined the channel
16:59 PM
Galera joined the channel
16:59 PM
Galera
hey guys
16:59 PM
Ferdroid has quit
17:00 PM
I've setted up a django with guinicorn & nginx
17:00 PM
and now I've got to import someone else's proyect into this webserver
17:00 PM
do you know any documentation I could follow?
17:00 PM
Haudegen has quit
17:00 PM
I'm quite lost in this world
17:04 PM
SuperSeriousCat
If you are "going live", Im pretty sure you will find info under something like "Deploying Django" or similar
17:05 PM
nkuttler
Galera: django docs have a deployment section
17:06 PM
Combined2857 has quit
17:07 PM
Seaninho joined the channel
17:10 PM
Xiti joined the channel
17:11 PM
kyheo joined the channel
17:13 PM
Or1on joined the channel
17:16 PM
kyheo has quit
17:17 PM
samsagaz has quit
17:21 PM
READ10 joined the channel
17:22 PM
XofP joined the channel
17:24 PM
eperzhand joined the channel
17:25 PM
djosh has quit
17:26 PM
SuperSeriousCat has left the channel
17:27 PM
tobias47n9e
I am trying to get a page running in production. When I try to test the startup script the unix socket is never found. Is it not correct to just use the path to the folder?
17:27 PM
venv/bin/python3 -b unix:/home/username/projectname/projectname.sock
17:27 PM
nix64bit has quit
17:27 PM
SuperSeriousCat joined the channel
17:29 PM
fission6 joined the channel
17:30 PM
shodan45 joined the channel
17:33 PM
OtherAllan joined the channel
17:37 PM
ycon_ joined the channel
17:38 PM
gugah has quit
17:41 PM
ycon_ has quit
17:41 PM
gugah joined the channel
17:41 PM
lucasxu joined the channel
17:46 PM
paratox joined the channel
17:47 PM
greg_f has quit
17:49 PM
kr joined the channel
17:51 PM
Itkovian joined the channel
17:51 PM
DrYockel has quit
17:53 PM
natea joined the channel
17:56 PM
fission6 has quit
17:56 PM
jobelenus_ joined the channel
17:57 PM
jobelenus_
I’ve done this a million times before, but its being a PITA at the moment. I’m changing a choice field chocies after form __init__ but something is being weird, Django 1.9, what am I missing??
https://pastebin.com/PEWfZbp9
17:57 PM
apollo13
17:58 PM
jobelenus_
sry, my b
17:58 PM
17:58 PM
apollo13
that code cannot work
17:58 PM
is_admin on line 6 is nowhere defined
17:59 PM
jobelenus_
18:00 PM
apollo13
is_admin = kwargs.pop('is_admin', False) would be shorter ;)
18:01 PM
jobelenus_
did form __init__ change in a meaningful way where i cant change field.choices??
18:01 PM
apollo13
jobelenus_: I don't think you could ever add choices to a model choice field like that
18:02 PM
jobelenus_
its not a model choice field
18:02 PM
just a choicefield
18:02 PM
apollo13
then you should show your whole model + form
18:02 PM
and not just parts
18:02 PM
jobelenus_
...
18:02 PM
apollo13
cause that is exactly the error you'd get for a choice field on a model
18:03 PM
cmheisel has quit
18:03 PM
kr has quit
18:03 PM
jobelenus_
which makes no sense since the field specifically allows for the value its receiving
18:03 PM
kartik has left the channel
18:03 PM
apollo13
no it does not
18:03 PM
you just added it as choice for the widget
18:04 PM
fields baked by a model field validate that against the database
18:04 PM
if you enable database query logging you will most likely see a query against that table with unknown
18:04 PM
SupaHam joined the channel
18:04 PM
(or not, but without seeing the full data it is just guesswork)
18:05 PM
cmheisel joined the channel
18:05 PM
jobelenus_
18:07 PM
sjms joined the channel
18:10 PM
apollo13
jobelenus_: weird, I'd look at it in pdb
18:13 PM
kr joined the channel
18:15 PM
dal220 joined the channel
18:16 PM
Cyph0n joined the channel
18:17 PM
scunion joined the channel
18:17 PM
beebot_ joined the channel
18:18 PM
morenoh149 joined the channel
18:19 PM
natea has quit
18:21 PM
NomadJim has quit
18:21 PM
Cyph0n has quit
18:22 PM
NomadJim joined the channel
18:22 PM
Itkovian joined the channel
18:28 PM
rpkilby has quit
18:29 PM
fission6 joined the channel
18:32 PM
cmheisel has quit
18:35 PM
cmheisel joined the channel
18:37 PM
jobelenus_ has quit
18:37 PM
wvdakker joined the channel
18:37 PM
renlo joined the channel
18:38 PM
renlo
if I have a model Foo, which has a M2M to a model Bar, if I do `foo1.bars.add(bar1) && foo1.bars.add(bar1)` will bar1 be added twice?
18:38 PM
or is it only once
18:39 PM
default M2M
18:39 PM
default pk / auto id
18:39 PM
hylje
it goes both ways, unless you have a directional m2m
18:39 PM
renlo
'goes both ways' meaning it could be either?
18:40 PM
Haudegen joined the channel
18:40 PM
hylje
ah nevermind i read that wrong
18:41 PM
i think you'll only able to add a model once if you don't have a through model given
18:41 PM
through models you can work however you like
18:41 PM
fission6
anyone use memoize or something similar for a expansive function in django?
18:50 PM
k3rn3lwalk3r joined the channel
18:50 PM
k3rn3lwalk3r
how can i query database to get the value instead of object
18:51 PM
Wooble
can you be more specific? Everything in python is an object.
18:51 PM
rpkilby joined the channel
18:51 PM
hylje
.values()
18:51 PM
k3rn3lwalk3r
this query buildingid = Rooms.objects.filter(id=room_id).only("ParentBuilding_id")
18:52 PM
is returing query object to buildingid
18:52 PM
i want the value whats stored in ParentBuilding_id
18:52 PM
RatanShreshtha joined the channel
18:52 PM
dessu
Rooms.objects.filter(id=room_id).values_list('ParentBuilding_id', flat=True)
18:53 PM
18:53 PM
rpkilby has quit
18:55 PM
18:56 PM
djosh joined the channel
18:57 PM
k3rn3lwalk3r
dessu, that worked but im getting value and L at the end of it
18:57 PM
rpkilby joined the channel
18:57 PM
like valueL
18:58 PM
how can i remove L?
18:58 PM
Wooble
k3rn3lwalk3r: that just means it's a long in a py2 repr()
18:58 PM
hylje
the L is in there just for the repr()
18:59 PM
pytony has quit
18:59 PM
k3rn3lwalk3r
i want to pass that value in another query and i cant pass L
18:59 PM
dessu
your ID for the object is stored as a long integer in the database, you do not need to remove it
18:59 PM
Wooble
k3rn3lwalk3r: it won't pass an L.
18:59 PM
cmheisel has quit
18:59 PM
k3rn3lwalk3r
ok leme chk
18:59 PM
dessu
what are you trying to do? explain the whole problem at one time instead of pieces of it
19:00 PM
Wooble
(if it really bothers you, upgrade to py3 and it will disappear forever)
19:00 PM
k3rn3lwalk3r
Wooble, lol
19:00 PM
im quering a value from database using this query which i sent
19:00 PM
dessu
you shouldnt really be running Python 2 anyway
19:00 PM
samsagaz joined the channel
19:01 PM
it will be out of support in 2.5 years
19:01 PM
k3rn3lwalk3r
and inserting into another table
19:01 PM
i see its just my final year project which i have to submit in 2 months
19:01 PM
buildingid = Rooms.objects.filter(id=room_id).values_list("ParentBuilding_id", flat=True)
19:01 PM
query = CmdsLog(IssuerUser_id=current_user_id,Room_id=room_id,Command=cmd,ParentBuilding_id=buildingid)
19:02 PM
query.save()
19:02 PM
dessu
well maybe you should be learning your school work and basic Python data types yourself?
19:02 PM
use dpaste for pasting code
19:02 PM
cmheisel joined the channel
19:02 PM
k3rn3lwalk3r
yes im learning all by my own i never learned python in school
19:02 PM
Itkovian joined the channel