Re: get all current active connected users

2015-12-10 Thread Jani Tiainen
Hi, That last login field only applies when user really logs in. (IOW you call login() function from django.contrib.auth). After that user is persisted to session so there is no need to authenticate per request. Now if you have longer sessions than 24 hours user will stay logged in (I think

Custom date format stopped working in template

2015-12-10 Thread sandino
Hello, I have custom localized data formats ( https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#creating-custom-format-files ) that I use in my template. After upgrading to 1.8.7 it stopped working (it shows something like 0MarchSunMarchX_th00+RUTC_SunAMUTCMarchUTC0MarMarch_M

Re: Custom date format stopped working in template

2015-12-10 Thread Fabio C. Barrionuevo da Luz
This is a bug that will be fixed in the next bugfix release django (1.8.8) https://docs.djangoproject.com/en/1.9/releases/1.8.8/#bugfixes 2015-12-10 3:26 GMT-03:00 sandino : > Hello, > > I have custom localized data formats ( > https://docs.djangoproject.com/en/1.8/topics/i18n/formatting/#crea

Prevent field from becoming null

2015-12-10 Thread Samuel Muiruri
Hello, I want to override the save for the show model so I check for if the value passed for a field is null if so ignore saving for the field class Shows(models.Model): some_field = models.CharField(max_length=128, default="something") def save(self, *args, **kwargs): super(Show

Prevent field from becoming null

2015-12-10 Thread Samuel Muiruri
Hello, I want to override the save for the show model so I check for if the value passed for a field is null if so ignore saving for the field class Shows(models.Model): some_field = models.CharField(max_length=128, default="something") def save(self, *args, **kwargs): super(Show

Re: Django for Data Tables to group by when coloumn hidden

2015-12-10 Thread Carsten Fuchs
Hi Sid, if with Data Tables you are in fact referring to http://datatables.net/, then you should put your questions with the folks over there. I guess what you want is possible with DataTables (I haven't checked), but be prepared for some customization with JavaScript being required. If you

Re: Prevent field from becoming null

2015-12-10 Thread monoBOT
The default is simply the default value, the user can still delete it. You can control how the user enters the values in the form, in particular on the clean_atribute method or redefining the clean one inherited from the forms.ModelForm class If your want to be "hacky" you can rewrite the save m

Django models in file sharing system

2015-12-10 Thread Vasu Dev Garg
models.py : `class Document(models.Model): docfile = models.FileField(upload_to='documents/%Y/%m/%d') user = models.ForeignKey(User, null=False, blank= False) ` I have created a model for file upload as shown above. docfile is the field that represents file to be uploaded and user fi

Multiple serializers

2015-12-10 Thread miguel angel lopez mendo
i have this serializers class ValuarCoche(serializers.ModelSerializer): class Meta: model = Valuacion depth = 6 fields = ('coche','Precio_Venta','Precio_Compra') class CocheSerializer2(serializers.ModelSerializer): valuacion = ValuarCoche(many=True) class Meta: model = Coche fields = (

Re: Tests not passing in suite but pass individually

2015-12-10 Thread Tim Graham
I didn't see any indication in your previous posts that you were using database routers. That's why I continue to ask for a sample project - it's difficult to debug problems without seeing the entire picture. On Wednesday, December 9, 2015 at 2:33:20 PM UTC-5, learn django wrote: > > After makin

Re: How to add myself as a developer for hire in the wiki?

2015-12-10 Thread Tim Graham
Feel free to remove such entries if you like. On Wednesday, December 9, 2015 at 1:40:58 PM UTC-5, larry@gmail.com wrote: > > On Wed, Dec 9, 2015 at 7:41 AM, Tim Graham > wrote: > > You can login using a Trac or GitHub account, then click "Edit this > page" at > > the bottom of the page.

Re: What will be the replacement for .extra()?

2015-12-10 Thread thinkwell
So how would an query like this be written, with the new Query Expression API? Where a count of events by day is required but the date column is datetime? Triggers.objects.all().extra({"day": "date_trunc('day', date)"}).values_list ('name', 'severity', 'day').annotate(total=Count('severity'))

Re: What will be the replacement for .extra()?

2015-12-10 Thread Dan Stephenson
Following is worth a watch https://opbeat.com/events/duth/#expressions On Thursday, 10 December 2015 21:22:39 UTC, thinkwell wrote: > > So how would an query like this be written, with the new Query Expression > API? Where a count of events by day is required but the date column is > datetime?

Re: Django models in file sharing system

2015-12-10 Thread Mike Dewhirst
On 11/12/2015 5:00 AM, Vasu Dev Garg wrote: models.py : Â `class Document(models.Model): Â Â Â docfile = models.FileField(upload_to='documents/%Y/%m/%d') Â Â Â user = models.ForeignKey(User, null=False, blank= False) ` I have created a model for file upload as shown above. docfile is the f