Re: Using a RadioSelect widget with ModelChoiceField

2021-02-06 Thread Matt Rowbottom
ons/14541074/empty-label-choicefield-django > > суббота, 6 февраля 2021 г. в 06:31:52 UTC+3, Matt Rowbottom: > >> Hi wne >> >> Using `to_field_name` changes the value of the options/inputs, but >> doesn't seem to have any effect on whether a blank option is availabl

Re: Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Matt Rowbottom
: Screen Shot 2021-02-06 at 2.25.47 pm.png] On Saturday, 6 February 2021 at 1:35:02 am UTC+11 wne...@gmail.com wrote: > to_field_name="name", > > пятница, 5 февраля 2021 г. в 17:15:27 UTC+3, Matt Rowbottom: > >> Hello. I think I've found a bug. >> >>

Using a RadioSelect widget with ModelChoiceField

2021-02-05 Thread Matt Rowbottom
Hello. I think I've found a bug. Prior to Django v3.1, both of the fields in the following form would be rendered with an empty option, labelled as '-': ``` from django import forms from .models import Animal class AnimalForm(forms.Form): animal_select = forms.ModelChoiceField(

Intermittent Javascript Tests Headless Chrome Timeout

2020-06-16 Thread Matt Ferrante
After rebasing my PR (https://github.com/django/django/pull/12333), it failed the JS tests, but hasn't touched any JS files. I suspect this was an intermittent failure, unrelated to my PR and wanted to re-run the JS tests, but I don't think I have permission to do so. Is there a good way I

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-30 Thread Matt D
> > > ^ Is this where you deleted the migrations? I keep receiving this error when I enter py manage.py migrate products: -- 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

Re: A learner following a Mosh Tutorial on Django and having a problem saving a product to SQLite

2020-05-29 Thread Matt D
> > Hello Iain, > I am also working on Mosh's python tutorial and I'm having the same problems that you expressed in this chat. Did you delete the migrations through pycharm or through your computer to make it work? Thanks -- You received this message because you are subscribed to the Google

Re: Query help

2019-09-12 Thread Matt
Tosin, Please refer below. This should help. https://docs.djangoproject.com/en/2.2/topics/db/queries/ best, matt On Thu, Sep 12, 2019 at 10:01 AM Tosin Ayoola wrote: > Halo guyz I actually need a little help, I'm working on a airline tickets > reservations project using postm

Re: New user question: Where to put non-form validation code?

2019-07-25 Thread Matt Zand
Hi everyone, Does anyone know how to post blog at below page: https://www.djangoproject.com/community/blogs/ I am really frustrated as I submitted last week but nothing is there. Who is in charge of blog posts on Django site? Thx, Matt On Thu, Jul 25, 2019 at 12:38 AM Mike Dewhirst wrote

Blog or link sharing in the community page

2019-07-24 Thread Matt Zand
Hi, I shared one blog post last week in community section. It does not show up. https://www.djangoproject.com/community/ Can someone help me out. My article links was below: https://myhsts.org/upload-and-process-website-cvs-file-using-python-django.html and RSS link

Re: Set user permission via python

2019-04-10 Thread Matt Collins
I've solved this. First of all, the codename for the permission should be called as a codename and second, I had to remove the app name (display_data) like this: permission = Permission.objects.get(codename='settings') On Tuesday, April 9, 2019 at 9:25:09 PM UTC-6, Matt Collins wrote: > &

Set user permission via python

2019-04-09 Thread matt
Hi, I'm trying to set a permission for a user that I'm creating with a python script. I've tested and found that the codename for the permission is "display_data.settings" using the following: python manage.py shell from django.contrib.auth.models import User user_name =

Re: Channels: rejecting web socket connections with a custom close code

2018-10-08 Thread Matt F
Hi Andrew, Thanks for clarifying. I didn't think to look at the ASGI spec but it is described quite well there under the WebSocket/Close section. Thanks for your hard work on this project. Regards, Matt On Saturday, 6 October 2018 10:47:46 UTC+1, Andrew Godwin wrote: > > H

Channels: rejecting web socket connections with a custom close code

2018-10-03 Thread Matt F
to accept a connection and then immediately close it, but I understand if you have to do it this way, to get the custom close code returned perhaps you have to have an open connection in the first place. Can someone please confirm? Many thanks! Matt -- You received this message because you

Re: Creating models from json url feed

2018-05-12 Thread Matt Snelgar
All of the products will share the same fields. I would filter on products, but my searches would only be restricted to one market at a time. On Sun, May 13, 2018 at 1:51 AM, Ryan Nowakowski <tuba...@fattuba.com> wrote: > > > On May 10, 2018 7:40:47 AM CDT, Matt Snelgar <

Creating models from json url feed

2018-05-10 Thread Matt Snelgar
I am making a django app to browse available products at different markets. I am getting data for my models from a JSON url feed, I am not sure on the best approach to turn this data into models as the feed for a single market can contain upwards of 50k items. Models - feel free to suggest

Django development -

2018-01-25 Thread Matt
Thanks! -Matt -- 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+unsubscr...@googlegroups.com. To post to this group, send email to django-users

Database router with read replica

2017-08-30 Thread Matt Pegler
/db/transaction.py#L107> a public API, or is there a better way to tell if we're within an atomic block? Thanks, Matt -- 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

Encapsulating Complex Business Logic in a Migraiton

2017-08-29 Thread Matt S
Standard practice is that you do not refer to "current" models (i.e. from app.models import MyModel) in a migration as the migration will break when that models changes. This means copying any model-specific code into the migration. This becomes impractical when the code needed for the

Re: Creation of default site not triggering post_save signal

2016-09-12 Thread Matt Thompson
doesn't exist. Simon, one last question for you -- where should this code live? I currently have it shoved in my model file but that doesn't feel quite right. Thank you again! --Matt On Saturday, September 10, 2016 at 10:42:16 PM UTC-4, Simon Charette wrote: > > Hi Matt, > &

Creation of default site not triggering post_save signal

2016-09-10 Thread Matt Thompson
. If this is a deliberate change, can someone please point me to the specifics? If it's a bug, I'd be more than happy to file a bug. Thanks! --Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Part 5 of creating firat django app

2016-08-29 Thread Matt Maloney
. Thanks in advance, Matt -- 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+unsubscr...@googlegroups.com. To post to this group, send email to dj

Re: Unable to get tests to work

2016-08-19 Thread Matt
there are some pyc files but not all. pytest was an attempt to resolve the issue outside of django's manage.py. It failed as well. Here is the pytest.ini: [pytest] DJANGO_SETTINGS_MODULE=refreshes.settings Thanks, Matt On Friday, August 19, 2016 at 10:37:51 AM UTC-6, Fred Stluka wrote

Re: Unable to get tests to work

2016-08-18 Thread Matt
Gergely > > On Wed, Aug 17, 2016, 23:03 Matt <kicke...@gmail.com > wrote: > >> Ok a step forward. When I spell out the tests it works: >> >> https://dpaste.de/2MXf >> >> But when I run test without arguments, it fails out: >> >> https://dpas

Re: Unable to get tests to work

2016-08-18 Thread Matt
Here you go: https://dpaste.de/OF8j On Wednesday, August 17, 2016 at 11:16:27 PM UTC-6, Gergely Polonkai wrote: > > Hello, > > this “refreshes.backups.tests” thing bothers me a lot. Could you show us > your directory structure, please? > > Best, > Gergely > > On

Re: Unable to get tests to work

2016-08-17 Thread Matt
UTC-6, Fred Stluka wrote: > > Matt, > > Oops! Right. I just noticed that in the dpaste. > > My next guess is you may need to change the name "good_index_text" > to something that starts with "test_" to get it to be recognized as a > test. > > Or

Re: Unable to get tests to work

2016-08-17 Thread Matt
Sorry for the typo, but I have already do that way. I have the output in the the first link. On Wednesday, August 17, 2016 at 2:24:19 PM UTC-6, Fred Stluka wrote: > > Matt, > > Drop the "s" from "tests": > > ./manage.py test backups > > --Fred &g

Unable to get tests to work

2016-08-17 Thread Matt
When I'm trying to get tests to work it simply states that its unable to import .tests. I'm not sure what I'm missing here. Here is some output please let me know if you need more: ./manage.py tests backups https://dpaste.de/4U9C The test file: https://dpaste.de/bBZt -- You received this

Re: Turn off migrations completely in Django 1.7

2016-04-20 Thread Matt Schinckel
On Wednesday, December 2, 2015 at 6:31:31 PM UTC+10:30, john@gmail.com wrote: > > +1 for disabling migrations completely - for several reasons. > > 1. Right now, I'm trying to run tests against a production database with > runserver, in *read-only* mode - but it fails because it can't

pyodbc: Works in Plain Python, Django 1.8 Shell Throws Error

2015-04-27 Thread Matt Woodward
Running into a bit of an odd problem I hope someone can help with. Envrionment: * Ubuntu Server 14.04, 64-bit (Vagrant box) * Python 3.4 * Django 1.8 * pyodbc 3.0.8 pyodbc installs fine. When I do python3 and then import pyodbc, that works fine. When I do python3 manage.py shell and then

Re: "The outermost 'atomic' block cannot use savepoint = False when autocommit is off." error after upgrading to Django 1.8

2015-04-03 Thread Matt Woodward
or your help -- much appreciated! Matt On Thursday, April 2, 2015 at 12:09:59 PM UTC-7, Simon Charette wrote: > > Hi Matt, > > I think it would be preferable to use atomic() here. > > From reading the documentation > <https://docs.djangoproject.com/en/1.8/topics/db/trans

"The outermost 'atomic' block cannot use savepoint = False when autocommit is off." error after upgrading to Django 1.8

2015-04-02 Thread Matt Woodward
Hi all -- I just upgraded one of my projects to Django 1.8 from 1.7.7 and in a view function where we're doing manual transaction management (Postgres) I'm now getting the error in the subject line. Basic gist of the code involved: def foo(request): try: transaction.set_autocommit(False)

django custom timezone middleware causing django.contrib.humanize test to fail

2015-03-31 Thread Matt Ball
Hi -- I'm unable to get all tests to pass with Django 1.5.4 when I have custom timezone-activating middleware enabled. I've posted code here: http://stackoverflow.com/questions/29376612 Is there a way to disable the middleware for that specific test? -- You received this message because you

Re: Authenticate users with both username and email

2015-01-15 Thread Matt Cooper
Your if block in views.py is not well-formed. I haven't tested this but I'd write it more like this: # try username user = auth.authenticate(username=username, password=password) if user is not None: auth.login(request, user) return HttpResponseRedirect('/') #

Re: Desired: Field behavior like AutoField + unique_with

2015-01-14 Thread Matt Cooper
omagically, so your call would look like > something like: > > Tenant.sequence.get_value(tenant, sequence) > > > On Tue, 13 Jan 2015 06:37:21 -0800 (PST) > Matt Cooper <vtbas...@gmail.com > wrote: > > > Thanks Jani, good to hear someone has gone down this road bef

Re: Desired: Field behavior like AutoField + unique_with

2015-01-13 Thread Matt Cooper
I need this pattern. If I could keep all the book-keeping on the model with the constraint, that seems cleaner to me. But, of course, I'm not willing to pay a huge performance or corruption penalty just for vague ideological purity :) Thanks again! ~matt On Tuesday, January 13, 2015 at 5:07

Desired: Field behavior like AutoField + unique_with

2015-01-13 Thread Matt Cooper
y, has anyone done something like this before and have a suggested pattern? Thanks! ~matt -- 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 djang

Re: Alternative to fabric

2014-11-17 Thread Matt Gushee
. or maybe they had a Python 3 development branch ... it was a few weeks ago, so I don't remember exactly). -- Matt Gushee -- 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,

Re: Another Noob questions

2014-09-01 Thread Matt Gushee
Hello again-- Since I don't really understand what you are doing, I can't give you any specific help. But since I have the impression you are new not only to Django but to online technical forums, let me give you a general recommendation: You will get better answers if you ask better questions.

Re: Another Noob questions

2014-09-01 Thread Matt Gushee
see if I can point you to some helpful resources. -- Matt Gushee -- 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+unsubscr...@googlegroups.com.

Re: I have created an app (total noob question)

2014-08-31 Thread Matt Gushee
That's the part I'm not too sure about, but I'm sure others on this list will have good advice. Hope that helps a bit. -- Matt Gushee -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving em

Re: how to call django web page with ordinary html page

2014-08-29 Thread Matt Gushee
should work fine I'm a Django newbie, so I could well be mistaken, but I don't think that will work. The OP said it was plain HTML; that means Django doesn't process it, so Django template tags won't work. But it looks like Flatpages might help: http://www.djangobook.com/en/2.0/chapter16.html. -

Re: Widget for simple (not input) text

2014-08-28 Thread Matt Gushee
What do you want to do with this 'widget'? From your description, it sounds like you could use a normal paragraph element -- which might look something like this in a Django template: {{ some_text }} Does that not meet your needs? -- Matt Gushee On Thu, Aug 28, 2014 at 5:51 PM, Yarick

Re: Looking for a pointer

2014-08-15 Thread Matt Lind
I think I found it. It appears that the form has a name called "fileupload" and submits back to the orginal page. From there the JS fires off. I guess I'll have to see how to modify this. Any other pointers would be appreciated! On Friday, August 15, 2014 8:34:43 AM UTC-4, Collin Anderson

Re: Looking for a pointer

2014-08-15 Thread Matt Lind
What I am wondering is how the Button type "Submit" is calling that JS some where. I don't see any specific script/method calls on the upload_form.html page, which specifically is where the bar "shows up". Thanks On Friday, August 15, 2014 8:34:43 AM UTC-4, Collin Anderson wrote: > > It's

Looking for a pointer

2014-08-15 Thread Matt Lind
I am using this project here: https://github.com/Alem/django-jfu Everything is installed and working properly. The project includes a progress bar logic that I'd like to re-use elsewhere on my site. The progress bar filling appears to happen when the "Start Upload" buttons are clicked.

Re: Please help:ImportError: No module named django

2014-07-24 Thread Matt Gushee
Hi, Liu Xuan-- What result do you get when you do the following? Python 2.7.6 >>> import sys >>> sys.path On Thu, Jul 24, 2014 at 1:23 PM, New Django User wrote: > Hi, I have problems with Django in windows 7. > > I installed Django using Windows Powershell: > > PS

Re: Registration extend nightmare

2014-06-02 Thread Matt Guy
, that surely there must be a quick fix here! I've sought postgres specific fixes to this problem, i've fiddled about in the sql console, i've tried a lot, but it's not seeming that simple. I think I just need a seasoned django warrior to wave a wand. Any other thoughts? Thanks, Matt On Saturday

Registration extend nightmare

2014-05-30 Thread Matt Guy
er = transaction.commit_on_success(create_inactive_user) __ Any thoughts would be much appreciated! Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: Casting a raw query set as a list for pagination

2014-04-26 Thread Matt Buck
I've created a paginator for RawQuerySets. https://github.com/seamusmb/django-paginator-rawqueryset On Tuesday, March 26, 2013 5:51:41 AM UTC-4, chambe...@gmail.com wrote: > > I'm trying to implement Django's built in pagination feature with a raw > query set. I've researched the issue and the

Re: Problems Sending Email From Django SIte

2014-02-01 Thread Matt Schinckel
the inner tuple. Matt. On Saturday, February 1, 2014 3:21:32 PM UTC+10:30, mark wrote: > > Exim4 has two logs - main and reject. > > Message from python prompt and mutt - shows activity in main, but not > reject. > > Message from Server 500 error with django app - no activity in m

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
Disregard. I found my error. I was trying to pass something I shouldn't have. This seems to be working now. Thanks again! On Thursday, December 5, 2013 9:10:13 AM UTC-5, Daniel Roseman wrote: > > On Thursday, 5 December 2013 12:23:52 UTC, Matt Lind wrote: >> >> Ok, I ge

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
work properly either. Thanks again! On Thursday, December 5, 2013 9:10:13 AM UTC-5, Daniel Roseman wrote: > > On Thursday, 5 December 2013 12:23:52 UTC, Matt Lind wrote: >> >> Ok, I get what what you're saying, but I seem to be having a heck of a >> time getting the

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
//docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to > > Regards, > Michael Manfre > > On Saturday, November 23, 2013 10:33:59 AM UTC-5, Matt Lind wrote: >> >> So I am trying to modify django-jfu ( a multi uploader) to send files to &g

Re: Generate a random directory for files to be uploaded

2013-12-05 Thread Matt Lind
with > upload_to that uses the random directory name on the instance to define the > file's target path. > > > https://docs.djangoproject.com/en/dev/ref/models/fields/#django.db.models.FileField.upload_to > > Regards, > Michael Manfre > > On Saturday, November 23, 20

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'django', 'USER': 'matt', 'PASSWORD':'***', 'HOST': '127.0.0.1', 'PORT': '5432', }, 'OPTIONS': { 'autocommit': True, } I forgot to post DB settings

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Django is 1.6 and Python is 2.7.5. On Windows 8.1, no virtual-env, but my actual project will be on a *nix VM. I accidentally download and install a development version, I think removed it before installing 1.6 but no previous django versions were installed on this system. Maybe dropping my db

Re: Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
Commenting out my Postgresql DB and putting back the default options for the sqlite DB fixed the issue. Is there a tests.py variable I could use to create an If..Else that would allow this to be automatic and not force me to edit my settings.py every time I wanted to run a test. -- You

Errors on Django Tests Tutorial 5, how to fix.

2013-12-04 Thread Matt Schloepp
I'm running Django on Windows with PostgreSQL database. I'm in tutorial 5 and have copy/pasted the code after it's initial failure. I've been following the tutorials to this point, with only a little side experimentation, and everything has been working. It looks like it DB related since I'm

Generate a random directory for files to be uploaded

2013-11-23 Thread Matt Lind
So I am trying to modify django-jfu ( a multi uploader) to send files to a unique directory for every unique upload session performed. This is just due to my application's requirements and to prevent file collisions during the operations later down the road in my app. Anyway, here is views.py

Apache won't allow upload but dev server will

2013-08-09 Thread Matt Lind
I am attempting to setup django-bft on my CentOS 6.4 server. When running under the dev server I am able to upload the file and it shows up on my server. However, when running through MOD_WSGI everything about the site works, except for the upload. The file never lands on the server and the

Re: Avoid unbounded memory consumption when running `manage.py test`

2013-07-26 Thread Matt McClure
On Thursday, July 18, 2013 7:30:55 PM UTC-7, Matt McClure wrote: > 1. TestSuite. Here's a minimal hack to release the reference that > TestSuite would otherwise hold after a TestCase runs until the remainder of > the suite had finished. > > +self._tests.remove(test

Re: Avoid unbounded memory consumption when running `manage.py test`

2013-07-18 Thread Matt McClure
On Thursday, July 18, 2013 6:12:16 PM UTC-4, Matt McClure wrote: > AFAICT, TestResult holds references to each TestCase instance. I can start to answer my own question. But I'm interested to know if others run into similar problems and how you solve them. It looks like there are at least

Avoid unbounded memory consumption when running `manage.py test`

2013-07-18 Thread Matt McClure
What's a good way to avoid unbounded memory consumption when running manage.py test? AFAICT, TestResult holds references to each TestCase instance. So attributes of my TestCase subclasses don't get freed by the garbage collector until the last reference to TestResult disappears, which isn't

Re: Having an issue with Minimal File Upload utility

2013-06-26 Thread Matt Lind
Just wanted to update everyone on the solve for this. It turns out that I was overzealous in my pre-planning. In my urls.py at the top of my project I had defined extra applications that I had not fleshed out yet. So they didn't have any urls.py or views.py defined. Even though the error

Re: Having an issue with Minimal File Upload utility

2013-06-22 Thread Matt Lind
Updating with full error: Request Method:GETRequest URL:http:///uploader/list/Django Version:1.3.7Exception Type:TemplateSyntaxErrorException Value: Caught ImportError while rendering: No module named urls Exception Location:/usr/lib/python2.6/site-packages/django/utils/importlib.py in

Re: Having an issue with Minimal File Upload utility

2013-06-19 Thread Matt Lind
My Settings.py: # Django settings for EqlAnalystToolSet project. import os, ldap from django_auth_ldap.config import LDAPSearch, ActiveDirectoryGroupType DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_em...@example.com'), ) MANAGERS = ADMINS DATABASES = {

Having an issue with Minimal File Upload utility

2013-06-19 Thread Matt Lind
I am trying to get this utility to work within my own Django site: https://github.com/doph/minimal-django-file-upload-example/tree/master/src/for_django_1-3/myproject I have copied all the appropriate files to where they need to be. I am on django 1.3.7 on Centos 6.4 64Bit. When I run the

Re: Difficulties displaying correct value in select widget with ModelForm/formset_factory:

2013-05-10 Thread Matt Conrad
() and initial=. Matt On Mon, May 6, 2013 at 4:28 PM, Matt C <matt...@gmail.com> wrote: > I'm resorting to code in __init__ to set my select dropdown properly when > using a ModelForm with formset_factory, and wondering if there is a better > way. > > I have a

Difficulties displaying correct value in select widget with ModelForm/formset_factory:

2013-05-06 Thread Matt C
I'm resorting to code in __init__ to set my select dropdown properly when using a ModelForm with formset_factory, and wondering if there is a better way. I have a model that looks like this: class Choice(models.Model): desc = models.TextField() begin_scene = models.ForeignKey(Scene,

Re: performance of delete

2013-04-24 Thread Matt Long
some intelligent batching of your IN clause, so maybe it does make sense to leave that hairy logic out of the ORM :-) -- Matt Long Sent with Sparrow (http://www.sparrowmailapp.com/?sig) On Wednesday, April 24, 2013 at 18:31, Larry Martell wrote: > I changed it to delete one row at a t

Re: Help interpreting profiler results (or: why is my app so slow?)

2013-04-18 Thread Matt Andrews
mplate tags are taking some time. Is the page >> huge? Are you doing a ton of formatting? Is there something you could maybe >> move to server-side? >> >> Also, this might help with caching bits of your output: >> >> >> On Thu, Apr 18, 2013 at 6:17 AM, Matt Andr

Re: Help interpreting profiler results (or: why is my app so slow?)

2013-04-18 Thread Matt Andrews
On Thursday, 18 April 2013 10:45:40 UTC+1, Tom Evans wrote: > On Wed, Apr 17, 2013 at 11:18 PM, Matt Andrews > <ma...@mattandrews.info> > wrote: > > Hi all. > > > > Having performance problems with my Django app. I've posted here before > > talking

Help interpreting profiler results (or: why is my app so slow?)

2013-04-17 Thread Matt Andrews
Hi all. Having performance problems with my Django app. I've posted here before talking about this: one theory for my slowness woes was that I'm using raw SQL for everything after getting sick of Django doing things weirdly (duplicating queries, adding bizarre things like "LIMIT 3453453" to

Re: m2m symmetry confusion

2013-04-11 Thread Matt Schinckel
Or, you could use the parent m2m with a through table to add the relevant data. birth/adoptive parent, etc. And, the partner m2m could also use a through table to store start and finish times of the relationship. Family relationships are hard... Matt. -- You received this message because you

Re: Django problem:AttributeError:Manage isn't accessible via Link instances

2013-03-21 Thread Matt Woodward
On Thursday, March 21, 2013 12:49:45 AM UTC-7, simon xue wrote: > > When I read to page 31,"To get an object by ID,type the following: > >>>Link.object.get(id=1) Unless this is just a typo that should be objects plural: Link.objects.get(id=1) -- You received this message because you are

Test database not auto-flushing

2013-03-01 Thread Matt
I have a bunch of unit test files, all of which consist of django.test.TestCase classes. Wrote myself a little shell script to uncomment/comment test file imports in my __init__.py file, so I can run tests from certain test files, based off the command line arguments I give it. I am also

Re: Using template fragment caching *inside* a sitewide cache: possible?

2013-02-15 Thread Matt Andrews
the results here: http://www.scenepointblank.com/ (it's the "popular right now" tabbed widget near the bottom right. On Thursday, 14 February 2013 17:19:28 UTC, Matt Andrews wrote: > > Hi Tom, > > Yep, you've got the problem right. Reading it back that way I see the >

Re: Using template fragment caching *inside* a sitewide cache: possible?

2013-02-14 Thread Matt Andrews
:42 PM, Matt Andrews > <ma...@mattandrews.info> > wrote: > > Hi all, > > > > I've been experimenting with an expensive query I need to call > (essentially > > grabbing data from some Google APIs). I tried this experiment: > > > > A sitewide cach

Re: Using template fragment caching *inside* a sitewide cache: possible?

2013-02-14 Thread Matt Andrews
Apologies for bumping this thread, but is there anybody with any insight on this? Really driving me crazy! On Monday, 11 February 2013 13:42:05 UTC, Matt Andrews wrote: > > Hi all, > > I've been experimenting with an expensive query I need to call > (essentially grabbing data f

Using template fragment caching *inside* a sitewide cache: possible?

2013-02-11 Thread Matt Andrews
the Google API and updates my cached fragments - the Google data changes every 15 minutes but the sitewide cache has several hours timeout, normally. Hope this makes sense. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubs

Busting template fragment caches inside a sitewide cache: possible?

2013-02-10 Thread Matt Andrews
'm sure my logic is just a little wrong. thanks Matt -- 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+unsubscr...@googlegroups.com. To post

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Matt Andrews
e > (iow a page might take 1s to load with the toolbar, but the toolbar will > report 500ms, which is accurate for load-time *without* the toolbar). > > _Nik > > On 1/22/2013 9:26 AM, Matt Andrews wrote: > > Hi Nik, > > I see the discrepancy both locally and whe

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Matt Andrews
page requests start to kick in -- maybe this is unrelated to the SQL, though. On Tuesday, 22 January 2013 16:42:19 UTC, Nikolas Stevenson-Molnar wrote: > > Hi Matt, > > It's unlikely the problem lies with dictfetchall. The "small performance > hit" mentioned by the docs

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Matt Andrews
gt; > > [1] > < > https://docs.djangoproject.com/en/1.4/ref/models/querysets/#prefetch-related> > > > > 22.1.2013 13:57, Matt Andrews kirjoitti: > > Hi Jani, > > > > I made a StackOverflow post last year with an example of the ORM stuff I > > tried and the poor

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Matt Andrews
what you had when things were slow? > > 22.1.2013 12:26, Matt Andrews kirjoitti: > > Hi Nik, > > > > Thanks - I do feel like by circumventing the ORM I've just "given up" > > and perhaps I'll reconsider -- none of my queries are particularly > > "special

Re: Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-22 Thread Matt Andrews
blank.com (obviously you won't see the SQL, but the "delay" between pages, even though these pages are all cached for 2hrs+, is partly my concern here). On Tuesday, January 22, 2013 4:24:09 AM UTC, Nikolas Stevenson-Molnar wrote: > > Hi Matt, > > Firstly, I encourage y

Struggling with slow startup / SQL in new app (using raw SQL)

2013-01-21 Thread Matt Andrews
C (this is from running on my local server rather than production but performance is broadly similar). Can anyone help me? I realise I've perhaps gone off-piste by writing raw SQL but I feel it was justified. thanks, Matt -- You received this message because you are subscribed to the Google

Field pre-load hook?

2013-01-13 Thread Matt Barry
(model, self.attname)) ..but it doesn't seem there are any hooks to decrypt the data on the loading side. Am I missing anything, or is there a better way to do this sort of thing? Thanks, Matt -- You received this message because you are subscribed to the Google Groups "Django users&q

Re: Question on Multiple Database Connections

2012-12-14 Thread Matt Woodward
On Thursday, December 13, 2012 8:01:13 AM UTC-8, ke1g wrote: > > > Just a shot in the dark: Maybe if, since you're not using the ORM on the > 'other' database, you shouldn't use django-pyodbc, but rather just pyobdc. > I should have said this earlier but I had the same thought and tried doing

Re: Queries to multiple tables

2012-11-11 Thread Matt Schinckel
Following up: if it affects a single instance of an object, then it belongs as a model method. If it affects any number of them, then it should perhaps go on the manager (or even the queryset: I use django-model-utils PassThroughManager for this a lot). Matt. On Sunday, November 11, 2012 3

Re: Easy way to make all form fields read only?

2012-11-01 Thread Matt Woodward
On Thursday, November 1, 2012 4:33:47 AM UTC-7, Amyth wrote: > I would suggest you adding Boolean field to your UserProfile model like > is_authorized = models.BooleanField(default=False) Cool -- thanks for the suggestion. As I've said I'm new to the Django world but this community rocks! :-)

Re: Easy way to make all form fields read only?

2012-11-01 Thread Matt Woodward
On Wednesday, October 31, 2012 8:40:10 PM UTC-7, elena wrote: > I was also going to suggest using crispy forms -- having used it on a > recent project I'd strongly recommend it (it's great when it's plugged in > to existing stylings such as: uni-form or bootstrap). > > I've used it with

Re: Easy way to make all form fields read only?

2012-10-30 Thread Matt Woodward
On Tuesday, October 30, 2012 5:20:44 AM UTC-7, ke1g wrote: > Another protective hack would be to omit the > CSRF token when the form is read only. > Thanks -- interesting idea! Ultimate goal is for the user to be able to tell they can't edit the form via the fields being read only (which

Re: Easy way to make all form fields read only?

2012-10-30 Thread Matt Woodward
On Tuesday, October 30, 2012 7:09:05 AM UTC-7, JirkaV wrote: > On the UI side, you can set the "readonly" property on form fields. > This will prevent the field from being edited in a browser (I think so > - done that only once on a small internal project). > Thanks -- I probably should have

Re: Easy way to make all form fields read only?

2012-10-30 Thread Matt Woodward
On Tuesday, October 30, 2012 1:36:19 AM UTC-7, elena wrote: > How are you rendering the form? Are you using `forms.Form`? > We're using a ModelForm specifically. > > Do you mean "user's credentials" from `django.contrib.auth`? > Actually this is a custom user object -- users authenticate

Re: Django HTTP Basic Auth

2012-10-18 Thread Matt Schinckel
You may want to look into requests, which wraps http request-response handling in a nicer wrapper. http://pypi.python.org/pypi/requests/ Matt. On Friday, October 19, 2012 1:15:06 PM UTC+10:30, Aaron C. de Bruyn wrote: > > On Thu, Oct 18, 2012 at 6:55 PM, django <mait...@gmail.com

Re: loop user.get_profile displays none in a template

2012-10-18 Thread Matt Schinckel
user.get_profile() returns a model instance, not a dict. Model instances have no .items() method. Matt. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/dj

Re: Missing manage.py

2012-10-04 Thread Matt Schinckel
An even better solution is to always work in a virtualenv: that way you can easily try out new packages, and not worry about conflicts. Matt. On Thursday, October 4, 2012 10:30:06 PM UTC+9:30, Ramiro Morales wrote: > > I think so. The usual reason for the problem you are experi

Re: Newbie Project Setup and Terminology Questions

2012-09-16 Thread Matt Woodward
Thanks to all for the examples and insight! Very helpful. Matt -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/sITNuGB_k54J. To post to this g

Re: Alternatives to CBVs (class based views)

2012-09-12 Thread Matt Schinckel
One really small nitpick: when returning a 405, it is a requirement that you return a header with the acceptable methods: > > > 10.4.6 405 Method Not Allowed > The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an

  1   2   3   4   5   >