admindocs: simplify_regex

2018-08-06 Thread Nacharov Mikhail
Hi all, Does anybody know, why admindocs function `django.contrib.admindocs.views.simplify_regex` transforms "(?:something/)?" to '''/" ? "(?:)" is a *non-capturing* version of regular parentheses[1], so there is no "var" here, right? [1]: https://docs.python.org/3/library/re.html#regular-e

Re: Change the default route of a view

2018-08-06 Thread Andréas Kühne
Hi, Are you logged in when creating the swagger docs? Because it will not show up when not logged in Regards, Andréas 2018-08-05 2:44 GMT+02:00 Fernando Miranda : > Andréas, that's exactly what I want, but it does not show up in swagger or > api docs. Another question I am still is whether

Re: Using the admin navbar & bootstrap throughout my project

2018-08-06 Thread Andréas Kühne
Hi, I agree with Derek regarding this is something that you need to check out yourself. You will need to do some overriding and extending and it's hard to describe exactly how much you need to change and also where to do it. Unfortunately I can't share the code that I have, because I don't own the

Re: [SOLVED] primary key auto increment with PostgreSQL and non Django standard column name

2018-08-06 Thread Aditya Sangam
Naoko I ma facing the problem of updating primary key automatically in django with postgresql database Could you please suggest what need to be done. Do we need to create a sequence for the table to achieve this. Hoping for your reply On Sunday, May 29, 2011 at 8:32:45 PM UTC+5:30, Nao

Field forced to not-null

2018-08-06 Thread Phlip Pretorius
Hallo, I have created a model that looks like this: class ActionType(models.Model): """The type of actions that must be taken at a meeting with respect to agenda points e.g. 'Decide', 'Take Note'etc. """ AtpCode = models.Cha

write a function which will validate whether source data is same as destination data and highlight the differences.

2018-08-06 Thread talkdkg
Hi , can anyone tell the output code for below queues as soon as possible please.. Given source data and destination data (in json format), write a function which will validate whether source data is same as destination data and highlight the differences. Bonus: If you can validate order of

Given source data and destination data (in json format), write a function which will validate whether source data is same as destination data and highlight the differences.

2018-08-06 Thread talkdkg
please do solve this quires asap Given source data and destination data (in json format), write a function which will validate whether source data is same as destination data and highlight the differences. Bonus: If you can validate order of data in list type values as well. E.g. below sou

Re: Field forced to not-null

2018-08-06 Thread Andréas Kühne
Hi Philip, The field is required because you haven't allowed it to be blank - and django admin requires fields to have the following attributes if you don't require them: Active = models.CharField(max_length=1, null=True, blank=True) Otherwise the GUI will mark the field as required. See here: ht

Django ORM aggregate Sum function on foreign key

2018-08-06 Thread Gerald Brown
Greetings: I am having a problem using the above function. In my table I have a field payment that is a foreign key to a payment table. When I try to use aggregate(sum('payment')) it gives me the sum of the foreign key, not the value from the payment table. Currently I have 9 records in my test

RE: Django ORM aggregate Sum function on foreign key

2018-08-06 Thread Matthew Pava
You need to specify the field of the value in your ORM statement. I don’t know what your field name is, but this assumes that it is “value”: aggregate(Sum(‘payment__value’)) From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On Behalf Of Gerald Brown Sent: Monday, August

Re: Django ORM aggregate Sum function on foreign key

2018-08-06 Thread Gerald Brown
This is how I finally solved my problem!!! The following is a copy of my ORM statement:  Visit.objects.filter(visit_date = mydate).aggregate(total = Sum('visit_payment')) {'total': Decimal('27')}  This total is the total of the foreign key ids.  9 records each with a key of 3 = 9 x 3 = 27 T

Re: Field forced to not-null

2018-08-06 Thread Jason
A good thing to keep in mind is null is for the database, and blank is for django validation -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubs

sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread HEMENDRA SINGH HADA
Hi Team, My application using sqlite DB and in my model table class, I have define attributes like Below - class MyUser(AbstractBaseUser): email = models.EmailField( verbose_name='email address', max_length=255, unique=True, ) date_of_birth = models.DateFiel

Re: sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread Christophe Pettus
> On Aug 6, 2018, at 10:19, HEMENDRA SINGH HADA > wrote: > > If I am giving is_active field with default value True, Then why its not > showing in "is_active" bool NOT NULL. Django "default=" defaults are implemented in Django, not in the database. Django does not currently set database-l

Re: sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread HEMENDRA SINGH HADA
Than How can I achieve my Goal with sqlite and Django ?? Do you have any solution for that ?? On Monday, August 6, 2018 at 10:49:29 PM UTC+5:30, HEMENDRA SINGH HADA wrote: > > Hi Team, > > My application using sqlite DB and in my model table class, I have define > attributes like Below - > >

Re: sqlite DB missed DEFAULT parameter from table definition

2018-08-06 Thread Christophe Pettus
> On Aug 6, 2018, at 10:27, HEMENDRA SINGH HADA > wrote: > > Than How can I achieve my Goal with sqlite and Django ?? > Do you have any solution for that ?? You'll need to either: 1. Add the default to the database using a migration, either using Django's migration framework and the RunSQL

Re: response.status 404 testing problem

2018-08-06 Thread Mike Dewhirst
Had a thought overnight ... maybe the 301 (permanently redirected) is because the staging server is using https and the server redirects from http to https. I'll start looking there. If anyone has any advice on best practice for this I'd love to hear it. Thanks Mike On 6/08/2018 2:08 PM, Mi

How to pass variable dates to a ORM query

2018-08-06 Thread Gerald Brown
I have a Django/Python function that creates a Reportab PDF file based on the current date. Works GOOD. Now I want to pass any date to that function and have it create a PDF based on the new date. I tried creating another function that generates the date (yesterday) but I am not able to pass