inchidi
iNcAeLuM
inchidi
iNcAeLuM
ok all explain it again.
i added in my models.py a line:
slug = models.SlugField(null=True)
then i execute: python manage.py makemigrations
and i got that error
iNcAeLuM
later i solved it manually
iNcAeLuM
but in fiurst place i got that error
iNcAeLuM
not get that error cuz y modify my db
Ajmal
but still dont know why i got that error
I get that error when I try to add a new filed to already created and DB migrated models.
Some times if there are many apps in one project
manage.py migrate --run-syncdb appname
Only work,
I'm also not aware about why this happening
inchidi
not get that error cuz y modify my db
okay if you like short answer without any in deep explanation, the answer is you get that error because your migration files doesnt match with your current (that time) db structure
iNcAeLuM
Ajmal
iNcAeLuM
Shiva
inchidi
Yes
thats not what its for, use django generic views instead
Wisdom
please how can i capture fingerprints in django?
Ярик
guys, can someone tell me how to change admin panel font size?
im using django-jet lib to beautify admin
Mirco
Ярик
yeah, like a <body> tag font-size
Mirco
Write your own css and override it
Or you need to find which rule uses Django but you should to check official source code
Ярик
i'll try
Anonymous
How to create question answer forum in Django like stack overflow
Anonymous
Any idea
Anonymous
If you guys can share any course or something
Anonymous
It would be a great help
Mirco
Doragonsureiyā
Anonymous
I am using Q to perform an or query.
Example Q(field=b) and so on, will the filtered results be in the same order as of Q
Sulistyo
Hello
Sulistyo
i have a problem to render data from tabel.. using django-datatabel-view
Sulistyo
i have table Collection and CollectionTitle.. i want to render data from field Hasilujian using models Collection.. how i do that? thanks
Sulistyo
sorry bad english
Turtle_In_Hurry
def validate_unique(self, exclude=None):
if not self.is_deleted and Department.objects.exclude(pk=self.pk).filter(location=self.location, name=self.name).exists():
raise ValidationError('Some error message about uniqueness required')
super(Department, self).validate_unique(exclude=exclude)
i'm overriding this method to ignore is_deleted=True
can anyone tell me what Department.objects.exclude(pk=self.pk) does
Sander
How to make sure every thread in Django uses the same instance of the database instead of creating a new connection to the database every time a thread is spawned?
GNU/Matt
GNU/Matt
it inherits all of the attributes of the main thread, variables included
GNU/Matt
So if the connection variable (whether it's the standard SQLite3 or other) is present in the main thread, it will be accessible also in the other threads
GNU/Matt
But be careful with that as changing a variable value affects all of the threads. Otherwise you need another process with multiprocessing module
Sander
I'm using gevent to create the threads
Sander
Problem is that checking for existing items always returns false
Naveen
GNU/Matt
GNU/Matt
do you connect to the database on each thread with like conn = db.connect()
GNU/Matt
Or do you pass the conn variable to a function?
GNU/Matt
GNU/Matt
like
import threading
def funcname():
print("foo")
thread1 = threading.Thread(
target=funcname,
args=(var1,),
name="foo")
thread1.start()
GNU/Matt
If you want you can also start many threads contemporary, instantiating as many Thread objects as you want.
You can also start a thread and wait for it to finish working and then start another one with *.join()
Sander
Sander
GNU/Matt
I mean, does it malform or either corrupt the database/the result?
GNU/Matt
GNU/Matt
Are you working on an SQL based db?
Sander
Because I perform multiple writes in the database in which some could contain the same values. In that case I want them to be filtered out (which I of course do using .exists())
Sander
GNU/Matt
GNU/Matt
What database
Sander
GNU/Matt
GNU/Matt
GNU/Matt
for instance when you have a socket connection, you can assign that object to a variable and use it whenever and wherever you want.
Can't you do the same with the mysql connection object?
GNU/Matt
so if i have sock = socket.socket()
i can do sock.bind().
Don't you have like
db = sql.connect(":server:")?
GNU/Matt
Maybe showing the code could help us help you
Sander
Jeez, do you use elif?
I perform the following check for example if(not Standing.objects.filter(league=league, round=round).exists()):
GNU/Matt
GNU/Matt
exists returns a bool value already
GNU/Matt
so that would be equal to if True
GNU/Matt
Sander
Anyways that's not related to the issue, how could SQLite fix this?
GNU/Matt
GNU/Matt
so you can pass it to a variable
Mirco
GNU/Matt
Why ?
Because It's weird