Re: Aggregation and following relationships backwards multiple levels

2017-02-01 Thread Patrick Joy
Hi, Thank you for your response, this works perfectly! Patrick On Thursday, February 2, 2017 at 4:07:21 AM UTC+11, pradam.programming wrote: > > Hi Patrick, > you can do like this: > def total(self): > return ContractItem.objects.filter(contract__subbudget__budge__in= >

Re: Limiting choices in a lookup by exclusion

2017-02-01 Thread Melvyn Sopacua
And there's 2 other options to consider: * The ne lookup is actually the first example in the documentation for custom lookups[1]. So you get its implementation for free and can consider adding it. * You can extend Field to add exclude_choices() which sets limit_choices_to to the

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Melvyn Sopacua
On Wednesday 01 February 2017 02:40:48 Thames Khi wrote: > I tried to use locally installed bootstrap. My render HTML function is > calling my page. However using the relative path or even if add the > complete path, nothing works. Save some time down the road:

Re: Possible bug in queryset "gte" function

2017-02-01 Thread Dylan Reinhold
After you changed it did you migrate the database? What database are you using? Dylan On Wed, Feb 1, 2017 at 9:05 AM, wrote: > What you say does sound plausible since previously the field was a > timestamp that I modified into a date, but then, what can I do? > > On

Email attachments in Django1.10 failing

2017-02-01 Thread E kamande
Hi Kindly need help to be able attaching a logo and a pdf when emailing, I have been following this great articles 1 and 2

sqlmigrate does not quote default string values

2017-02-01 Thread Michael Grijalva
Not sure if this is considered a bug, but the SQL output from sqlmigrate contains a small syntax error with default string values: Add a new column as so: class City(models.Model): ... name = models.CharField(max_length=100, default='a b c d') Create migration, and run sqlmigrate

Re: video tutorial dating site

2017-02-01 Thread engross web host
Thank you Aaton, will work with this any other comment is welcome by others On Wednesday, February 1, 2017 at 2:30:57 AM UTC+1, engross web host wrote: > > am new using python(django) i built an app lately but i want to build a > dating site using django. I will be comfortable with video

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
Great to see that I could be of help :-) Regards, Andréas 2017-02-01 21:35 GMT+01:00 Thames Khi : > Thank you so much, you are a legend, sir! I can now continue my learning > and combine my python database code with django. > > I am very grateful, thank you for taking the

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Thames Khi
Thank you so much, you are a legend, sir! I can now continue my learning and combine my python database code with django. I am very grateful, thank you for taking the time to explain this to me. Kind Regards, TiKhi On Wednesday, February 1, 2017 at 8:11:52 PM UTC, Thames Khi wrote: > >

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Thames Khi
Thanks very much, I will give this a try now. On Wednesday, February 1, 2017 at 3:58:54 PM UTC, Andréas Kühne wrote: > > The setting you have to specify are: > > STATIC_URL and STATIC_ROOT. > > STATIC_URL is the url base for creating paths for the webserver to the > static files. Usually you

Re: Send mail bug needs password passed as bytearray

2017-02-01 Thread elliot
Thanks for getting back to me. I guess I have gotten myself confused. Im using 1.10.5 and have been looking at the master version on github. My work around has the emails working so I'll just leave it and get with the times and work with python 3 in the future. On Thursday, February 2, 2017

RE: Link to urls containing slug

2017-02-01 Thread Matthew Pava
Hi David, Thank you for the clarification, but it doesn’t change my response much. Use the {% url %} tag in your detail view template. Job Application Form I thought you had a JobApplication model, but you can use the Job model just as above. Use the job object you passed into the detail view

Re: Channels - query_string

2017-02-01 Thread Andrew Godwin
Hi, You're right - a lot of the information only appears in the first "connect" message. If you want to persist it, you can use a channel session: http://channels.readthedocs.io/en/stable/getting-started.html#persisting-data This will let you save information (such as the token, or even a User

Re: formset in form_class

2017-02-01 Thread schaf . mh
Hi All, problem solved. The problem was the default value None for the form_class parameter at get_form. It works when changing: def get_form(self, form_class=None): to: def get_form(self, form_class=LayoutFormSet): Cheers Schaf Am Dienstag, 31. Januar 2017 17:55:15 UTC+1 schrieb

Re: Aggregation and following relationships backwards multiple levels

2017-02-01 Thread pradam programmer
Hi Patrick, you can do like this: def total(self): return ContractItem.objects.filter(contract__subbudget__budge__in= self.budget_set.all()).aggregate(Sum('total'))['total__sum'] try like this..! On Wed, Feb 1, 2017 at 7:14 PM, Patrick Joy wrote: > Hi all, > >

Re: Possible bug in queryset "gte" function

2017-02-01 Thread jjddgg9999
What you say does sound plausible since previously the field was a timestamp that I modified into a date, but then, what can I do? On Wednesday, February 1, 2017 at 11:47:02 AM UTC-5, Dylan Reinhold wrote: > > Your date field is probably a date-time field in your database. > So your filter is

Re: Possible bug in queryset "gte" function

2017-02-01 Thread Dylan Reinhold
Your date field is probably a date-time field in your database. So your filter is going to be looking for 2016-12-03 00:00:00 thru 2016-12-04 00:00:00. Dylan On Wed, Feb 1, 2017 at 6:16 AM, wrote: > Hi, guys. > > If I'm not madly blind (which has been the case before,

Possible bug in queryset "gte" function

2017-02-01 Thread jjddgg9999
Hi, guys. If I'm not madly blind (which has been the case before, you know), there is a bug in the "__gte" function for the orm queryset. To name it, whenever I call the function, it gives the same result that the "__gt" function, that is, greater than or equal to, is behaving the same as

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
The setting you have to specify are: STATIC_URL and STATIC_ROOT. STATIC_URL is the url base for creating paths for the webserver to the static files. Usually you just leave this at '/static/' - however you could also set this to a completely different domain (if for example you were serving

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Thames Khi
Thank you very much for your reply. I think I have missed something as the python is duplicating the files and sticking them into a path I specified. Here are my steps based on the document and what happens. 1) updated the urls.py in the project: from django.conf.urls.static import static

Re: Aggregation and following relationships backwards multiple levels

2017-02-01 Thread pradam programmer
from django.db.models import Q def total(self): subbudgets = SubBudget.objects.filter() contracts = Contract.objects.filter(subbudget__in=subbudgets) return ContractItem.objects.filter(contract__subbudget__budget__in=self.budget_set.

Aggregation and following relationships backwards multiple levels

2017-02-01 Thread Patrick Joy
Hi all, Would appreciate some advice on this, I'm having trouble working out the best way to aggregate across multiple foreign key relationships. I have come up with the solution below however I'm not sure if this is the correct way to handle this situation. Any advice would be appreciated.

Channels - query_string

2017-02-01 Thread Sgiath
Hi, I am trying to use the query_string parameter and I want to ask what is the correct way how to use it. I am using JsonWebsocketConsumer and when debugging I noticed that on the Handshake the message content contains path, headers, query_string, client, server, reply_channel and order. But

Re: Making email required

2017-02-01 Thread Larry Martell
On Wed, Feb 1, 2017 at 5:32 AM, wrote: > You can define a single form to use for creating and updating users like > this: > > class CustomUserChangeForm(UserChangeForm): > class Meta: > > > model = User > > > fields = ('email', 'password', 'first_name', 'last_name',

Re: Stuck at Tutorial 1

2017-02-01 Thread ludovic coues
Sharing the contents of polls/urls.py could help but I assume you didn't make any errors on the first line. To be sure, you can add a comment on the first line and leave the second line blank. If you still have an error on line 1, it might be related to how you save your file. Python might not

Re: Stuck at Tutorial 1

2017-02-01 Thread Nibil M S
There is some syntax error in the file. Please ensure that your file is following python syntax. I hope you know basics of python. On Wed, 01 Feb 2017 13:17:39 +0530 Zhou Sicong genie10...@gmail.com wrote Hi, I tried doing exactly everything as told in Tutorial 1

Re: Validating and cleaning related models ...

2017-02-01 Thread Bernd Wechner
Melvyn, Thanks. Alas That was but one example in an apocryphal model set, and I have rather more relationship criteria to test in a more complex nest of models. I'm still drilling down into Django to see what I can uncover. Notably form.instance for the main form and all the related formsets,

Stuck at Tutorial 1

2017-02-01 Thread Zhou Sicong
Hi, I tried doing exactly everything as told in Tutorial 1 ( https://docs.djangoproject.com/en/1.10/intro/tutorial01/) I use idle to write the polls.py and urls.py Do i totally overwrite the code already in those file or leave them alone and add on the codes in the tutorial. Because i

Re: Send mail bug needs password passed as bytearray

2017-02-01 Thread Tim Graham
Following the Django 1.11 alpha release, the stable/1.11.x branch was created and master became Django 2.0 pre-alpha. You can read more details about how that works at https://docs.djangoproject.com/en/dev/internals/release-process/#release-process On Tuesday, January 31, 2017 at 9:24:13 PM

Re: good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Andreas Kuhne
Hi, You will have to follow the following information: https://docs.djangoproject.com/en/1.10/howto/static-files/ Make sure that the css files and js files are in the static directory. Then you can use {% static "css/bootstrap.min.css" %} for the filepath to the static files. The static files

good doc and example on how to use bootstrap with DJango

2017-02-01 Thread Thames Khi
Hi, I tried to use locally installed bootstrap. My render HTML function is calling my page. However using the relative path or even if add the complete path, nothing works. If the html page is opened directly it works. Is there any decent documentation and examples of using locally installed

Re: Making email required

2017-02-01 Thread jorrit787
You can define a single form to use for creating and updating users like this: class CustomUserChangeForm(UserChangeForm): class Meta: model = User fields = ('email', 'password', 'first_name', 'last_name', 'photo', 'is_active', 'is_staff', 'user_permissions') class

Re: Web-based Voting System for our capstone project

2017-02-01 Thread Avraham Serour
I recommend instead of tweaking the admin app to just making your own dashboard template. You can start learning django by doing the official tutorial at djangoproject.com On Tue, Jan 31, 2017 at 2:44 PM, Genaro Lubong wrote: > I just want to ask, how can I customize my