Re: Incorrect query generated from ~Q/exclude

2020-05-18 Thread kirk
I struggled to find this in the Django ticketing system when I posted it, but I searched again this morning and found a few bugs that seem to be related. They were closed with comments indicating that https://code.djangoproject.com/ticket/10060 seems to be the root cause. Looks like this is a

Incorrect query generated from ~Q/exclude

2020-05-12 Thread kirk
Django 2.2.12 Python 3.7.5 Postgres 10.11 I am receiving what I perceive to be an incorrect SQL query from a Django queryset. I am hoping I've just done something wrong. Here's the setup: from django.db.models import DecimalField, DO_NOTHING, F, ForeignKey, Model, Q, Sum, TextField class Ta

Unable to establish odbc connection to MS SQL Server

2020-04-27 Thread Kirk Brown
USER': 'user', 'PASSWORD': 'password', 'OPTIONS': {'ODBC Driver 17 for SQL Server', } } } And here is the error: (venv) C:\Users\Kirk\PycharmProjects\PyShop>manage.py runserver Unhandle

Re: "None of the above" in a form?

2008-05-09 Thread Kirk Strauser
"Submit". Imagine a field in a job application like "Which crimes have you been convicted of? [Armed robbery] [Arson] [Kidnapping]". You bump "Arson" by mistake. Don't you wish there was a "none of the above" option to select instead? -- Kirk Strauser signature.asc Description: This is a digitally signed message part.

"None of the above" in a form?

2008-05-06 Thread Kirk Strauser
wever, the list of Company objects renders as a MultipleChoiceField, and there's no way that I've found to clear the list of selected values. Is there a way to get a "None of the above" option or a "Clear" button to get rid of unwanted or accidentally selected op

Re: Trying to dynamically generate labels in newforms

2008-01-31 Thread Kirk Strauser
= forms.IntegerField() Yells "d'oh!" and slaps forehead. Thanks! -- Kirk Strauser signature.asc Description: This is a digitally signed message part.

Re: Trying to dynamically generate labels in newforms

2008-01-30 Thread Kirk Strauser
consolidate a bunch of ad-hoc code into a single inheritable class. - -- Kirk Strauser -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHoRX05sRg+Y0CpvERAurkAJ0e+UGaOyv8ofaTARs2GJPBK1qw7wCcC3rO p6N4YJ+wXbvOJddGxWdQeQY= =/lEi -END PGP SIGNATURE- --~--~-~--~

Trying to dynamically generate labels in newforms

2008-01-30 Thread Kirk Strauser
27;t have the behavior I'd expect of changing somefield's label from 'Somefield' to 'foo'. Is this possible? -- Kirk Strauser signature.asc Description: This is a digitally signed message part.

Debugging pointers wanted

2007-12-14 Thread Kirk Strauser
I'm trying to figure out why changes I make to a user's profile in the admin section don't actually get saved (even though it claims they were). I'm newish to Django and don't have a clue how to start debugging this. Any pointers? -- Kirk Strauser signature.a

Re: Trying to reuse models and forms

2007-12-12 Thread Kirk Strauser
On Wednesday 12 December 2007, l5x wrote: > form_for_instance? Check: > http://www.djangoproject.com/documentation/newforms/#generating-forms-for >-models That's only in the SVN version, but if we have to move from .96 to SVN to get it then so be it. -- Kirk Strauser signature.a

Trying to reuse models and forms

2007-12-12 Thread Kirk Strauser
for_instance(umod.UserProfile())() >>> print form['market'] Is there a way to get it to render as a select widget with the same values as in /admin? I'm going to be doing such things quite a few times and I don't want to have to repeat the same definitions in a bunc

How to let some users manage other users

2007-10-25 Thread Kirk Strauser
m bare metal with mod_python or PHP then I could imagine how I might do this, but I'd much rather work *with* Django than *against* it. So, is there a Django-ish approach that anyone would recommend? -- Kirk Strauser --~--~-~--~~~---~--~~ You received this m

Injecting validation errors into newforms

2007-08-24 Thread Kirk Strauser
ur legacy system instead of having all such errors bunched up at the top of the form. I'm currently using: def clean(self): myerrors = longprocessonremotemachine() # returns a dict raise forms.ValidationError('\n'.join(myerrors.values()) wh

Re: Importing Excel/CVS into Database

2007-08-21 Thread Kirk Strauser
On Tuesday 21 August 2007, robo wrote: > Have any of you guys imported excel/cvs by using Python/Django? Check out "pydoc csv". Python ships with a nice CSV-reader module. -- Kirk Strauser signature.asc Description: This is a digitally signed message part.

Best practices for xmlrpc authentication

2007-08-21 Thread Kirk Strauser
So, is there a best practice for such things? The one hard requirement is that it has to work with Python's xmlrpclib's basic authorization support, and therefore probably also with our .NET clients. -- Kirk Strauser --~--~-~--~~~---~--~~ You receive

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
in a RequestContext for every single view, since I want to have a login or logout link at the top of each one. Is that correct? -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django use

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
eware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', ) -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
ly which has a different template > inheritance chain? This is my first Django project. I hate it when you feel *so close* to finding the answer but can't make that final little leap. :-) -- Kirk Strauser --~--~-~--~~~---~--~~ You received this message b

Re: Variables available to all templates

2007-06-29 Thread Kirk Strauser
tch. Please try again. {% endif %} Username:{{ form.username }} Password:{{ form.password }} http://www.example.com/"; /> {% endblock %} --- ...which yields the text "Welcome, kirk. Thanks for logging in." I'm finding th

Variables available to all templates

2007-06-28 Thread Kirk Strauser
Is there a list of variables that all templates can access? I'm asking out of general interest, but the problem I'm trying to solve is that I want to have a "login" or "logout" link on every page of the site, depending on whether a visitor is currently authenticated, and I don't want to have to p

Question on Modifying the admin interface.

2006-09-05 Thread kirk reeves
I have 2 issues with Admin and I am looking for a suggestion. I am currently using models.ForeignKey(Type, edit_inline=models.TABULAR, blank=True) for a field in one of my models. In Admin of the parent Model the children items appear as expected, however it would be nice to collapse the childr

Primary key with db_column set results in errors in admin

2006-02-25 Thread Kirk McDonald
ticket) work just great. -Kirk McDonald --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this

Re: manage.py vs. django-admin.py

2006-02-24 Thread Kirk McDonald
he app your project's subdirectory. To solve this, either rename the app, or move it. I think renaming is easier. -Kirk McDonald --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Subclassing user and OneToOneField

2006-02-21 Thread Kirk McDonald
Kirk McDonald wrote: > PS: The following hackish thing occurs to me: > > class User(users.User): > node = meta.OneToOneField(Node, db_column='id') > id = meta.IntegerField(db_column='id', editable=False) > class META: &g

Subclassing user and OneToOneField

2006-02-21 Thread Kirk McDonald
ango-0.91-py2.4.egg/django/contrib/admin/views/decorators.py in _checklogin 85. request.session[users.SESSION_KEY] = user.id [snip] Oh dear. I have two options as I see it: I can either edit the admin code (not preferable for any number of reasons), or I can somehow convince an id att