Re: how to set up a calculated field in Django?

2019-10-23 Thread Tyler Lynch
If you're using the newest postgres 12, you could also use their new generated column feature ( https://www.postgresql.org/docs/current/ddl-generated-columns.html). You can implement that in Django by editing the SQL in the migration setting up your table. Though I do look forward to this featur

Is it easy to switch User model from inheriting AbstractUser to AbstractBaseUser if already in production?

2019-01-20 Thread Tyler Lynch
Just wondering how difficult that switch is? I know, for example, that it's best practice to atleast set AUTH_USER_MODEL to a custom user model that inherits from AbstractUser, because switching this setting afterwards is difficult, because of updating all the foreign keys, etc. But if that i

Re: Should I use Django-Rest-Framework for performance reasons, despite not needing an externally-consumable API?

2018-10-27 Thread Tyler Lynch
ASCUAL > > Centre Scientifique et Technique du Bâtiment > 290 route des Lucioles - BP 209 > 06904 SOPHIA ANTIPOLIS CEDEX > http://www.cstb.fr > > -- > *From:* django...@googlegroups.com < > django...@googlegroups.com > on behalf of Tyler L

Re: Should I use Django-Rest-Framework for performance reasons, despite not needing an externally-consumable API?

2018-10-27 Thread Tyler Lynch
; > DRF doesn't help importing from / exporting to CSV - it mainly understands > json. I would use some form of CSV export lib - there are a lot of them on > pypi. Or pandas of course! > > Regards, > > Andréas > > > Den fre 26 okt. 2018 kl 16:14 skrev Tyler Lynch >

Re: Should I use Django-Rest-Framework for performance reasons, despite not needing an externally-consumable API?

2018-10-26 Thread Tyler Lynch
hings in > different places. You can for example cache an entire response with > template, or just cache the database calls and present them in a template. > This is not hard to cache or to setup. > > I think I would need to know more about your use case to understand it > b

Re: Should I use Django-Rest-Framework for performance reasons, despite not needing an externally-consumable API?

2018-10-26 Thread Tyler Lynch
n entire response with > template, or just cache the database calls and present them in a template. > This is not hard to cache or to setup. > > I think I would need to know more about your use case to understand it > better :-) > > Regards, > > Andréas > > >

Should I use Django-Rest-Framework for performance reasons, despite not needing an externally-consumable API?

2018-10-25 Thread Tyler Lynch
I have no need for an externally consumable API, but I am interested in using Django-Rest-Framework simply for performance reasons. I'm led to believe that by decoupling my front and back end and then simply consuming the DRF api within views, that I can setup a better caching system? Does thi