These are chat archives for django/django

22nd
Jan 2018
djangoReactGuy
@SanskarSans
Jan 22 2018 02:03
Does anyone know how to show only the root nodes in django-treebeard?
moneer-alasmar
@moneer-alasmar
Jan 22 2018 05:48
hi guys, can anyone please help? I'm trying to create a coin collecting game. I am using session.request['gold'] to store the value of my gold. the problem comes when I try adding a value to it such as 'request.session['gold'] += randomamount
randomamount being an amount from random.randomint
I get this error: int("1")
coercing to Unicode: need string or buffer, int found
Kyle Mulka
@mulka
Jan 22 2018 05:54
@moneer-alasmar I think things in the session are always strings, so you need to convert from string to int first, add your random number, then convert back to string
Or, maybe you just put in a string initially
moneer-alasmar
@moneer-alasmar
Jan 22 2018 05:56
How can I convert it? I'm very new
Kyle Mulka
@mulka
Jan 22 2018 06:02
If session supports ints which (now that I think about it) it should, just start with an int instead of a string
In the = “0” line, take out the quotes around the 0
And delete any sessions you’ve created already
moneer-alasmar
@moneer-alasmar
Jan 22 2018 06:19
@mulka bro... thank you so much!
@mulka I've been banging my head for hours!
Abhijeet Kumar
@arcticOak2
Jan 22 2018 06:30
Hello everyone I'm learning Django and I'm facing some trouble regarding models. I have defined one variable name that is CharField and I defined unique= True for name still after that when I'm opening shell and defining records with same name and I save it also but it's not showing anything. Its taking different records with same name
Ohh sry I forget to run makemigrations
I apologize
FoxMaSk
@foxmask
Jan 22 2018 08:25
@abhijeet1995 hi, welcome :)
Abhijeet Kumar
@arcticOak2
Jan 22 2018 09:21
haha I'm new and shit happens!
Tom
@tomwwabo
Jan 22 2018 10:03
hi folks,
do you know any admin themes which are django2.0 compatible ?
grapelli and suit are incompatible
Tom
@tomwwabo
Jan 22 2018 10:09
i am not sure about django-jet and afraid of https://github.com/sshwsfc/xadmin
since i am not fluent in chinese
Matt Conway
@MC-Escherichia
Jan 22 2018 18:30
I have a question about SQLAlchemy. I am trying to add new objects to a table (INSERT) using session.add(obj) followed by session.commit(). SQLAlchemy is adding an OUTPUT clause to the sql statement in order to return the PK of the inserted rows, but this is conflicting with a TRIGGER I have on the target table. Any ideas on how to disable the OUTPUT clause in the SQL Alchemy API
Matt Conway
@MC-Escherichia
Jan 22 2018 20:47
figured it out...it should be noted that this only applies to SQL Server...when the Table is created a keyword argument implicit_returning=False should be included