Code9
does capitalization matter
Karim Norman
Istartswith
Karim Norman
I use istartswith
Django Bot
>> Links
- Quickstart: Compose and Django | Docker Documentation
Karim Norman
so, to achieve what I needed in the endpoint I had to pass a param to the serializer and filter the related fields.
Karim Norman
this work
Django Bot
>> Blogs
- Equivalents in Python and JavaScript. Part 2
inchidi
https://stackoverflow.com/a/50141290/3925477
Maz
Has anyone done a migration from Sqlite to Postgres before?
For me it usually goes perfect...but today I'm getting a funny error.
Maz
The dumped data is only kilobytes in size...
Maz
The steps I followed are:
python2 manage.py dumpdata > datadump.json
Changed settings on backend to postgres
Connected to Postgres database.
python2 manage.py migrate (successful)
python2 manage.py shell
>>>from django.contrib.contenttypes.models import ContentType
>>>ContentType.objects.all().delete()
>>>quit()
python2 manage.py loaddata datadump.json
inchidi
Maz
The dump is going through, but the datadump.json only has schema and permission data, nothing else.
Maz
Nice, lemme check this out,
inchidi
you can try py manage.py dumpdata app_label >datadump.json also
inchidi
or --all
Maz
How about dumpdata --all > datadump.json
inchidi
just try it maybe, nothing to lose
Maz
Because if I start specifying apps I will have to specify all the apps in the project, right?
Maz
inchidi
open datadump.json and check what dumped first
inchidi
searching for the model name should work
Maz
As you can see, doing an 'll' on the datadumo shows it's only 14kb
Rohan
Open it
inchidi
open and check it
Maz
Opened it with a text editor and it only contains schema info and permissions data.
inchidi
have you try searching "yourmodelname"?
inchidi
use dpaste.de
Maz
use dpaste.de
No need...it's just a bunch of schema information. No real data.
inchidi
inchidi
what model with most data you have?
Pepeluqui
Maz
It only dumps schema info and permissions.
Maz
at least make me believe it
Lol..
This is business, man. I don't play around with this time.
Believe me I've checked and rechecked.
inchidi
Student using custom manager?
inchidi
Maz
inchidi
Yes
ah, then what filter that custom manager did?
Maz
Maz
results *
Maz
It's simply not picking the Student table.
Django Bot
>> Links
- Modern Django: Part 1: Setting up Django and React — v1k45
Anonymous
Leo
Leo
But you’re free to do so
Leo
inchidi
Leo
Well, yeah, there’s nothing I can do about that :/
inchidi
i'll increase the treshold
Anonymous
is it okey that i put some space ?
Anonymous
inchidi
Anonymous
I wrote this model and a function that can provide path for fields:
https://pastebin.com/eyZsU36g
I need to gather my folder together
like this:
assume my first field file name is like this : myapp.py
so my path will like this:
/media/username/myapp/myapp.py
/media/username/myapp2/myapp2.py
/media/username/myapp3/myapp3.py
but it need path like this:
/media/username/myapp/myapp.py
/media/username/myapp/myapp2.py
/media/username/myapp/myapp3.py
what is your point of view about it?
Anonymous
inchidi
inchidi
so, its nice thing to do
Django Bot
>> Links
- NewbieMistakes – Django
inchidi
Anonymous
nope, mind to elaborate?
my problem is that i can't save second , third , ... files in first folder , i mean in myapp folder that same with first file field myapp.py
inchidi
inchidi
Language:
py3
Source:
s = 'myapp3.py'
result = ''.join([i for i in s.split('.')[0] if not i.isdigit()])
print(result)
Result:
myapp
inchidi
inchidi
then why not just put inside username directory?
inchidi
each user have each username right?
Anonymous
yes i think is better to manage and get some statistical info for admins that use os for managing, 😐 i think i have no excuse for it just for clearing i think
inchidi
inchidi
Anonymous