How can I auto-fill a field in the model without showing a form field to the user?

2017-07-24 Thread Alexander Joseph
I'm new to django, but coming from php I think its the greatest thing ever. I have a model for Invoices ... {{{ from django.conf import settings from django.db import models from django.core.urlresolvers import reverse #from django.contrib.auth.models import User # Create your models here.

Re: Multiple User Types in Django 1.11

2017-07-24 Thread Russell Keith-Magee
Short version: You don’t. Your site may have 2 types of user - but that doesn’t mean you have 2 user models. The user model is primarily for determining authentication; authorisation can be handled separately. So - set up a user model the way you normally would; then define a Teacher model

Re: The best way to use AMP of google with Django

2017-07-24 Thread Jani Tiainen
Hi I really don't know what AMP is but Django templates can be used to output any text you want to. Whout extra work. If you need content negotiation that is also relatively simple to do. 24.7.2017 20.55 "carlos" kirjoitti: > Hi, i have blogs with Django i need use AMP

The best way to use AMP of google with Django

2017-07-24 Thread carlos
Hi, i have blogs with Django i need use AMP (https://www.ampproject.org/) What is the best way to use it with django, someone has an example To apply with django or idea, book, tutorial etc. i read, see this projects https://github.com/shtalinberg/django-amp-tools But not working with django

Multiple User Types in Django 1.11

2017-07-24 Thread stan
What is the best way to create multiple user types in Django 1.11? For example, an e-learning platform will need 2 user models: Students and Teachers, which have different permissions and different attributes/methods -- You received this message because you are subscribed to the Google Groups

ModelForm validation of foreign keys - extra database queries and performance bottleneck

2017-07-24 Thread johan de taeye
I have a model that has a foreign key relation to a number of other objects. When saving an instance of this model from the admin (or a ModelForm), I see plenty of extra and redundant database calls. For a single record it wouldn't make much of a difference, but when using the same ModeForm to

Re: From old-school Post/Redirect/Get to modern web

2017-07-24 Thread Christian Ledermann
https://blog.levit.be/new-django-admin-with-emberjs-what-are-the-news/ could give you some insights HTH On 24 July 2017 at 11:36, guettli wrote: > I use Post/Redirect/Get since several years. I use simple HTML forms (via > ModelForm) with a plain old submit-button. > >

From old-school Post/Redirect/Get to modern web

2017-07-24 Thread guettli
I use Post/Redirect/Get since several years. I use simple HTML forms (via ModelForm) with a plain old submit-button. Above pattern works. But I think the web of the future works different. Up to now my web application sends html to the web