Re: django mathfiters

2018-02-27 Thread Peter of the Norse
I would do {% with a=42 c=b.value|default_if_none:0} - Peter of the Norse > On Feb 21, 2018, at 3:47 PM, Matthew Pava wrote: > > And how are you checking if it’s None? I would do it like this: > {% if c %} > {{ a|add:c }} > {% else %} > {{ a }} > {% endif %} > > From: django-users@goog

Re: How to get Foreign Key Objects programmatically?

2018-02-27 Thread Rob Schneider
Still a mystery to me. --rms > On 28 Feb 2018, at 03:22, Malik Rumi wrote: > > Did you ever find an answer? If so, do you mind sharing it? Thanks. > >> On Sunday, October 29, 2017 at 9:33:10 AM UTC-7, rmschne wrote: >> I'm using Django as front end to a MySQL database. User interface is a >

Re: Is there a way to make a field both foreignKey or allow user to fill it in themself?

2018-02-27 Thread Mike Dewhirst
On 28/02/2018 1:58 PM, Alexander Joseph wrote: Sorry, I think my question was confusing. What I want to do is allow the user to either select a user from a drop down list of users from the ForeignKey in the Users model, or if there is not a user suitable to select in the drop down, they can man

Re: How to get Foreign Key Objects programmatically?

2018-02-27 Thread Malik Rumi
Did you ever find an answer? If so, do you mind sharing it? Thanks. On Sunday, October 29, 2017 at 9:33:10 AM UTC-7, rmschne wrote: > > I'm using Django as front end to a MySQL database. User interface is a > terminal program, not a web site. > > I've written a very simple generic function to edi

Re: Is there a way to make a field both foreignKey or allow user to fill it in themself?

2018-02-27 Thread Alexander Joseph
Sorry, I think my question was confusing. What I want to do is allow the user to either select a user from a drop down list of users from the ForeignKey in the Users model, or if there is not a user suitable to select in the drop down, they can manually type in a name themselves. Thanks for you

Re: Is there a way to make a field both foreignKey or allow user to fill it in themself?

2018-02-27 Thread Mike Dewhirst
On 28/02/2018 1:26 AM, Alexander Joseph wrote: Is there a way to make a form field or model field either a foreign key reference or allow the user to fill in something themselves? I'm making a fixed assets app and each fixed asset has an owner field, which I would like to assign to an app user

Static/constant dictionary for get_initial or get_form_kwargs

2018-02-27 Thread Bob Glassett
Hello, Trying to bring a django app into production, and I ran into a real headscratcher. I have a Class based view inherited from create. When the page reloads, after validation, I check the initial dictionary for a field's value to fill in the queryset for a different field. I'm getting s

Why doesn't Django support managing Raw SQL changes using migration system like models

2018-02-27 Thread cmp
I have an problem that I wanted to solve recently using a Postgres Trigger + Procedure that I do not want to do via Signals or within Python itself. I want to make a log which when an entry is created the result is applied to a row. We need the log to be the source of truth and I don't want to

Re: Channels 1.x

2018-02-27 Thread Andrew Godwin
Yes, there is one session made per connection. They should expire and get cleaned up like normal HTTP sessions if you run the session cleanup in Django (or use backends that auto-cleanup) Andrew On Tue, Feb 27, 2018 at 11:00 AM, nferrari wrote: > Hello, > > I'm using django-channels for some mo

Channels 1.x

2018-02-27 Thread nferrari
Hello, I'm using django-channels for some months and I'm observing a behaviour for which I don't know if it's a normal one, or a misconfiguration from my side. Here is my pretty simple consumer : # Connected to websocket.connect @channel_session_user_from_http def ws_task_connect(message): i

Re: autocomplete

2018-02-27 Thread Maurizio B.
Django-autocomplete-light is probably your best option. We have used it in a couple of projects and it's customisable to a certain extent, and well maintained. On Monday, February 26, 2018 at 6:55:15 PM UTC+1, Mafabi Emmanuel wrote: > > how do i design an autocomplete in django 2.0 > > > -- Yo

What happened to CollapsedFieldsets.js?

2018-02-27 Thread Alan
Hi there, Well, I used that like 8 years ago. Just wondering what's the current solution for Django 2.0 if one want to collapse fields in forms. Thanks in advance, Alan -- I'll cycle across Britain in 2018 for a charity, would you consider supporting my cause? http://uk.virginmoneygiving.com/A

Is there a way to make a field both foreignKey or allow user to fill it in themself?

2018-02-27 Thread Alexander Joseph
Is there a way to make a form field or model field either a foreign key reference or allow the user to fill in something themselves? I'm making a fixed assets app and each fixed asset has an owner field, which I would like to assign to an app user if possible, and if not possible be able to fil

Re: autocomplete

2018-02-27 Thread Andy
for any more complicated admin autocompletes or stuff in the frontend use djang-select2 Am Montag, 26. Februar 2018 18:55:15 UTC+1 schrieb Mafabi Emmanuel: > > how do i design an autocomplete in django 2.0 > > > -- You received this message because you are subscribed to the Google Groups "Djan

Re: Seeking professional help for frontend design for a small django project

2018-02-27 Thread Andy
Whats in it for the potetial frontnd developer? Money? Just fame? How many pages are you talking about? Am Dienstag, 27. Februar 2018 00:04:45 UTC+1 schrieb cjwalter: > > Hi everybody > > I’ve started a small django website which is up and running but could > benefit from some frontend polish (b