Anders (izzno / gooood) πŸ‡³πŸ‡΄
This book is not "very" good at explaining every consept (which by the title, is not its purpose) so you might want to team up other tuto's as well if you are just starting. Like the mozilla django library totu, and a good python crash course.
Kaio
Morning y'all! I just found some spelling mistakes in the django-humanize brazilian portuguese translation.. What's the best approach to fix that?
George
Hey fellas, i have an interesting question. I have added a new charField with a set of options in the form of tuples. How do i set a default value for tuple values? Like directly ('tag','tagValue') or tagValue directly Should i set null?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
its just normal python
George
George
of, i guess it's better to explicitly say it
Anders (izzno / gooood) πŸ‡³πŸ‡΄
I would guess thats a "on case" basis.
George
i have used a enum and i put it like this class TestEnum(Enum): # A subclass of Enum TAG = "TagValue" #model name=models.CharField(choices=[(tag, tag.value) for tag in TestEnum], max_length=100, default=TestEnum.TAG.value)
George
its an Enum
George
Are you iterating through a class object?
i saw a tutorial on enums and i think it's worth because i need the same choicefield twice
George
https://hackernoon.com/using-enum-as-model-field-choice-in-django-92d8b97aaa63
Rajjix
and i thought i know how enum worked 🤦‍♂️, this is new, already googled it xD
George
i find tuple sintax also not nice
pylance
can I move my project's root directory anywhere?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
https://django-mysql.readthedocs.io/en/latest/model_fields/enum_field.html?highlight=enum
George
can I move my project's root directory anywhere?
to mars, if you want to stay behind bars
Anders (izzno / gooood) πŸ‡³πŸ‡΄
can I move my project's root directory anywhere?
That depends if your virtual env is in it or not
pylance
okay
George
https://django-mysql.readthedocs.io/en/latest/model_fields/enum_field.html?highlight=enum
nice, no i don't use a specific EnumField cos i'm ok with CharField
George
i'm getting better at not fucking up migrations yahoooo
Anders (izzno / gooood) πŸ‡³πŸ‡΄
default=
Anders (izzno / gooood) πŸ‡³πŸ‡΄
:)
Anonymous
Anonymous
Pipenv sucks.
Rajjix
Pipenv sucks.
Please don’t say
Anonymous
My whole project blew last night because of pipenv
Anonymous
I guess you are referring to pyenv
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Whoops
Anders (izzno / gooood) πŸ‡³πŸ‡΄
:D
Anonymous
pyenv is good
Anonymous
I better use pyenv than pipenv
Rajjix
My whole project blew last night because of pipenv
sorry to hear that, i’m really relying on docker instead of virtual envs, idk if it’s good practice but it’s saving me tons of work
Anonymous
Anders (izzno / gooood) πŸ‡³πŸ‡΄
pyenv is ❀️
except you will have issues on Linux with missing possibilities of different python / python3 shims
cj
also I use it with many python versions
Anders (izzno / gooood) πŸ‡³πŸ‡΄
The problem I faced is it does not seperate between 2 and 3
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Not the system python
cj
Not the system python
well... my system python is 3 by default
cj
I use pyenv to have python2
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Thats not a problem
cj
Why did you install python2?
probably old projects
Anders (izzno / gooood) πŸ‡³πŸ‡΄
The other way around is
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Python is still symlinked to python 2 in Redhat / Ubuntu
Anders (izzno / gooood) πŸ‡³πŸ‡΄
python3 = 3
Anonymous
alias python python3
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Anonymous
Yup
Anders (izzno / gooood) πŸ‡³πŸ‡΄
no offence ;)
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Anonymous
I now have a habit of typing python 3
cj
LTS
let me try with Ubuntu 18.04 LTS, I will tell you later (downloading ISO ...)
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Anders (izzno / gooood) πŸ‡³πŸ‡΄
use python3 :)
Anders (izzno / gooood) πŸ‡³πŸ‡΄
But many packages depends on "python" being python2 and python3 is python3
cj
I will make a clean Ubuntu 18.04 installation and directly use pyenv
cj
You got too much time.
I'll try in my local
George
I'll try in my local
Isnt there a demo of ubuntu online?
Anders (izzno / gooood) πŸ‡³πŸ‡΄
anders@3ZVCRC2:~$ python --version Command 'python' not found, but can be installed with: sudo apt install python3 sudo apt install python sudo apt install python-minimal You also have python3 installed, you can run 'python3' instead. anders@3ZVCRC2:~$
Anders (izzno / gooood) πŸ‡³πŸ‡΄
If I now install a package thats depends on python2 it will install python2 and symlink python. If you then use shims youre screwed
cj
🤔
Anders (izzno / gooood) πŸ‡³πŸ‡΄
BUT, that does not make pyenv suck. Its not made for that ;)
cj
then Ubuntu is 💩
Anders (izzno / gooood) πŸ‡³πŸ‡΄
Its like using "pip" without "β€”user", if you do that you mess up the system packages...