Re: DRY violation using get_or_create with defaults

2012-06-12 Thread Jonathan French
On 12 June 2012 04:44, Jerome Baum wrote: > Drop the "defaults" kwarg to get_or_create as apparently you're not using > it. Also drop the conditional on those set/save statements. Ah, I should have made clear that some of the fields in defaults are NOT NULL, so it's necessary to pass them in de

Re: Adding values to formdata of ModelForm before saving

2012-05-30 Thread Jonathan Baker
e from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jonathan D. Baker Developer http://jonathandbaker.com -- You received this message because you are subsc

Re: How to get News by category? - GET method

2012-05-25 Thread Jonathan D. Baker
The query string parameters in your URL need to be in key=value format, such as http://127.0.0.1:8000/news/?category=music Sent from my iPhone On May 25, 2012, at 6:01 AM, enemybass wrote: > Hi. How to get News by category name? My try: http://dpaste.com/752094/ > If I click category name in t

Re: user.set_password('new password')

2012-05-18 Thread Jonathan D. Baker
Save is a method, so it needs parentheses: user.save() Sent from my iPhone On May 18, 2012, at 10:53 PM, Min Hong Tan wrote: > Hi, > > I 'm trying to change password in views.py in one of my def. > having the below code. > newpassword ="testing123" > user = User.objects.get(username__exact =

Re: Trying to Edit Existing Post; Can't Get Form to Display

2012-05-18 Thread Jonathan Baker
> > > > > > > {% endblock %} > > > This is likely a stupid error but hours of scratching my head led me to > seek some guidance. Any help welcomed and appreciated. T

Re: Good method to require EULA acceptance

2012-05-02 Thread Jonathan D. Baker
You could store the Eula as a boolean field on a user profile model and manage it that way. Sent from my iPhone On May 2, 2012, at 3:34 PM, BGMaster wrote: > Hi, > > I'm trying to implement acceptance of a EULA into my site registration > form. The EULA acceptance is on a separate page from t

Re: @login_required do nothing

2012-04-28 Thread Jonathan Baker
st to test it, I commented the import line, and the > page loads without trouble. I suppose that referencing a symbol not > imported would raise an exception! > > > On 04/28/2012 04:18 PM, Jonathan D. Baker wrote: > >> You have to be sure and import th

Re: @login_required do nothing

2012-04-28 Thread Jonathan D. Baker
You have to be sure and import the module at the top of your script: from django.contrib.auth.decorators import login_required. Otherwise, it's never in scope and thus not available. Sent from my iPhone On Apr 28, 2012, at 1:00 PM, marcelo nicolet wrote: > Hi > Following the on-line docs ( >

Re: outdated django book

2012-04-28 Thread Jonathan Baker
quot; group. > To view this discussion on the web visit > https://groups.google.com/d/msg/django-users/-/6ExeXS4aUn8J. > > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.c

Re: outdated django book

2012-04-27 Thread Jonathan D. Baker
You need to import User from django.contrib.auth.models and login_required from django.contrib.auth.decorators. Hope this helps. Sent from my iPhone On Apr 27, 2012, at 8:09 PM, knowledge_seeker wrote: > My Django book (from the university library) said to add the label > "@login_required" to

Re: Can't get model to show up in admin interface

2012-04-26 Thread Jonathan D. Baker
Perhaps the Coltrane folder needs a blank __init__.py? Sent from my iPhone On Apr 27, 2012, at 12:00 AM, Mika wrote: > I'm working through James Bennet's Practical Django Projects 2nd > edition. I have a folder called "coltrane" which has a models.py file > with the following: > > from django.

Re: Word Cap Form Labels

2012-04-18 Thread Jonathan D. Baker
Not sure about django, but this is easy to do in CSS. Sent from my iPhone On Apr 18, 2012, at 11:21 PM, Lee Hinde wrote: > The default behavior for a form label is to capitalize the first letter - > 'Report name'. I'd like to capitalize the first letter of each word - 'Report > Name'. Short o

Re: Tutorial question regarding def _unicode_

2012-04-11 Thread Jonathan Baker
roup, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Jonathan D. Baker Web Developer http://j

Re: Upgrading django on a mac

2012-04-07 Thread Jonathan Baker
Ah, good to know. Apologies, but I glanced over your original code to quickly and thought you renamed the directory. Glad it worked out. On Sat, Apr 7, 2012 at 3:54 PM, Larry Martell wrote: > On Sat, Apr 7, 2012 at 3:46 PM, Jonathan Baker > wrote: > > I'm guessing that your $P

Re: Upgrading django on a mac

2012-04-07 Thread Jonathan Baker
to the Google Groups > "Django users" group. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/

Re: Tutorial

2012-04-06 Thread Jonathan Baker
Glad to help! On Fri, Apr 6, 2012 at 5:58 PM, Gerald Klein wrote: > OK makes a complete sense and worked the first time thanks very much. > > --jerry > > > On Fri, Apr 6, 2012 at 4:42 PM, Jonathan Baker < > jonathandavidba...@gmail.com> wrote: > >> You red

Re: Tutorial

2012-04-06 Thread Jonathan Baker
w() - > datetime.timedelta(days=1) > 21 > 22 class Choice(models.Model): > 23 def __unicode__(self): > 24 return self.choice > > On Fri, Apr 6, 2012 at 1:54 PM, Jonathan Baker < > jonathandavidba...@gmail.com> wrote: > >> Jerry, >> >> You

Re: Tutorial

2012-04-06 Thread Jonathan Baker
Jerry, You'll want to be sure your method is defined as: def __unicode__(self): return self.name # I'm using 'name' as an example field with double underscores on both sides of 'unicode' instead of just in front of it. Hope this helps, Jonathan On Fri, Apr

Re: __unicode__ and return.self

2012-03-25 Thread Jonathan Baker
e.com/d/​msg/django-users/-/​jKgyKR2iRdgJ<https://groups.google.com/d/msg/django-users/-/jKgyKR2iRdgJ> >>> . >>> To post to this group, send email to django-users@googlegroups.com. >>> To unsubscribe from this group, send email to >>> django-users+uns

Re: all(), get(), create(), count(). More info?

2012-03-24 Thread Jonathan Baker
; To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > > -- Jonathan D. Baker Web D

Re: __unicode__ and return.self

2012-03-24 Thread Jonathan Baker
l has 5 fields, why am I only returning one or two? > Shouldn't I return all 5? > > On Mar 24, 9:19 pm, Jonathan Baker > wrote: > > The __unicode__ method allows models to return a more usable > representation > > of a record instead of a unicode object. This is

Re: __unicode__ and return.self

2012-03-24 Thread Jonathan Baker
isit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jonathan D. Baker Web Developer http://jonathandbaker.com 303.257.4144 -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Re: Help with django-paypal anyone?

2012-03-21 Thread Jonathan Baker
email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- Jonathan D. Baker Web Developer http://jonathan

Re: where did I install Django

2012-03-20 Thread Jonathan Baker
eb visit > https://groups.google.com/d/msg/django-users/-/9FZCBitFicMJ. > To post to this group, send email to django-users@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com. > For more options, visit this group at &g

Re: Permission denied when saving a record with an ImageField in the model

2012-03-17 Thread Jonathan Baker
t, Mar 17, 2012 at 11:06 AM, Sithembewena Lloyd Dube wrote: > Thanks Jonathan, > > I actualyl came across that answer but am stupmed. I checked *man chown*in my > terminal and I never understand those manuals. I will try to find my > python process id. > > > On Sat,

Re: Permission denied when saving a record with an ImageField in the model

2012-03-17 Thread Jonathan Baker
ssion-denied On Sat, Mar 17, 2012 at 10:33 AM, Sithembewena Lloyd Dube wrote: > Hi Jonathan, > > Thanks for the response. How do I do that? I ran *sudo chmod -R a+rwX > Projects/* and I still get the same error. How do I go about making the > folder writable? > > Thanks.

Re: Permission denied when saving a record with an ImageField in the model

2012-03-17 Thread Jonathan D. Baker
You need to make sure your server has write permissions on the home/projects directory. Sent from my iPhone On Mar 17, 2012, at 9:02 AM, Sithembewena Lloyd Dube wrote: > Hi all, > > I have a model with an ImageField and when I try to save a record in the > admin site, I get the following: >

Re: best resources for learning django

2012-03-02 Thread Jonathan Holloway
I sympathise with you. I'm following the 1.3 online docs and hacking a site together at the moment. an up to date book would be awesome !!! I found looking at example projects on Github very useful. Cheers, Jon. -- You received this message because you are subscribed to the Google Groups "Dj

Re: Beginner's question about urls.py

2012-02-22 Thread Jonathan Paugh
What puzzles me is that http://chekonam.info/ claims that uWSGI doesn't know about the project--presumably the one under /admin. Is this relevant? On 02/22/2012 10:45 PM, shartha wrote: > The file I posted above is the actual file on my server. I don't think > I have any conflicts in the urls.py.

Re: Where are the 2+ places user_id is defined?

2012-02-15 Thread Christos Jonathan Hayward
P.S. The source is at http://JonathansCorner.com/project/pim.tgz. On Wed, Feb 15, 2012 at 3:40 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I forgot to specify where. The traceback is on a '''python manage.py > syncdb''

Re: Where are the 2+ places user_id is defined?

2012-02-15 Thread Christos Jonathan Hayward
I forgot to specify where. The traceback is on a '''python manage.py syncdb''', and happens immediately after the password is entered twice. On Wed, Feb 15, 2012 at 3:39 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I'm

Re: Registering a user profile

2012-02-14 Thread Christos Jonathan Hayward
n Tue, Feb 14, 2012 at 12:32 PM, Kevin Anthony wrote: > Did you include the module in your settings.py? > > Kevin > Please excuse brevity, sent from phone > On Feb 14, 2012 1:27 PM, "Christos Jonathan Hayward" < > christos.jonathan.hayw...@gmail.com> wrote: > &g

Re: Registering a user profile

2012-02-14 Thread Christos Jonathan Hayward
ellar/python/2.7/lib/python2.7/site-packages/django/contrib/auth/models.py in get_profile, line 380Python Executable:/usr/local/bin/pythonPython Version:2.7.0Python Path: ['/Users/jonathan/pim', '/usr/local/Cellar/python/2.7/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg&#

Re: django-admin.py startproject doesn't work

2012-02-13 Thread Jonathan Paugh
On 02/13/2012 11:01 AM, Dennis Lee Bieber wrote: > On Sun, 12 Feb 2012 23:02:20 -0800 (PST), raddy > wrote: ... > Can you run ANY python script (.py) file by typing its name on the > command line?... Say something that does nothing more than: > > print "I'm running" > > (test while /in/ th

Re: error

2012-02-13 Thread Jonathan Paugh
On 02/13/2012 06:51 AM, xina towner wrote: > Hi, I get this message when I try to acces to the admin page: > > AlreadyRegistered at /admin > > > The model Location is already registered > > > does anybody know which is the problem? > This is a horrible, horrible problem which I've worked aro

Re: Model field that links to a page ID, or external URL

2012-02-13 Thread Jonathan Paugh
On 02/13/2012 11:09 AM, Diederik van der Boor wrote: > Hi, > > In CMS interfaces I generally encounter a problem with URL fields. > In most situations, the following options need to be supported: > - An URL to an external page (Django's URLField can handle that) > - An URL to an internal page (e.

Re: Adding first_name and last_name to django registration

2012-01-28 Thread Jonathan Paugh
contrib.auth.models.User has a get_profile() hook that allows you to add extra info to a user account from your own model; however, I don't see support for that in django-registration at first glance. I'm looking at the code from https://bitbucket.org/ubernostrum/django-registration/ On 01/28/201

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-28 Thread Jonathan Paugh
Developing on a Linux-based OS will give you indispensable understanding of your production environment. On the other hand, it will probably be very unfamiliar if you haven't worked on Linux before, and easy tasks will become very difficult again, for a while. You should ultimately develop your app

Re: How do you pass dissimilar data from view to template?

2012-01-28 Thread Jonathan Paugh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I think jQuery supports this sort of thing, (as I'm sure other Javascript libs do). Then again, learning Javascript + jQuery together seems at least as hard as learning Python + Django. On 01/27/2012 11:31 AM, BillB1951 wrote: > Thanks for the additio

Re: Handling multiple parameters on URI via GET

2012-01-28 Thread Jonathan Paugh
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Is the request.GET.get() method working properly? Does the test on query work? I suspect one of these places doesn't work as expected. I'd do similar to the following in my code. (It works on Django 1.3.1 for request.POST, anyway.) if 'page' in reque

Re: Moving a file manually

2012-01-27 Thread Jonathan Paugh
On 01/26/2012 03:44 AM, Tor Nordam wrote: Hello, I have a model with a FileField, that I use to store some user uploaded files. After a while, I changed my mind about where to store the files, so I was just wondering if there is a way to manually move a file, and then update the location of the

Re: Determine gender from first name

2012-01-27 Thread Jonathan Paugh
- Original Message - From: Demetrio Girardi Sent: 01/25/12 03:49 AM To: django-users@googlegroups.com Subject: Determine gender from first name This is not a django-specific question, but I couldn't find anything useful on the subject and have no better place to ask. Let's say I want to

Re: I need help with Python Tools for Visual Studio 2010 and Django

2012-01-27 Thread Jonathan Paugh
On 01/23/2012 03:58 PM, JJ Zolper wrote: Yes I knew I was in the Python shell I just never saw anything that described you couldn't make Django commands within the Python interpreter. I mean it is based on Python isn't it? That's where I thought logically you could make Django calls from in Pyt

Re: Database connection closed after each request?

2011-11-20 Thread Jonathan
Does anyone know if this progressed anywhere since '09? -- 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/-/0fmsTMQC_tAJ. To post to this group, send email to d

Django with Codebase Database

2011-11-02 Thread Jonathan
Does anybody use Django/Python with Codebase? Can it be done? If so, how hard is it? -- 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 group, send email t

CacheMiddleware with generation-style caching

2011-10-28 Thread jonathan
weak django to only use CACHE_MIDDLEWARE_SECONDS for the Cache-Control headers? Obviously, I can make this change locally, but I'd like to know if I'm missing something and if this change has any chance of making it upstream. :) Thanks! Jonathan [1] http://assets.en.oreilly.com/1/

Email settings to use localhost's email

2011-09-13 Thread Christos Jonathan Hayward
to my question: *How can I tell Django to use the VPS's regular sendmail to power send_mail, retry_deferred, and emit_notices?* * * Thanks in advance. -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian

Re: Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
f the directories > specified in your TEMPLATE_DIRS variable in settings.py. > They are considered in the order they are written, so the base.html you are > extending is the first you find in this sequence. > > Hope this helps, feel free to reply > > 2011/9/9 Christos J

Where is "base.html" that "templates/site_base.html" extends?

2011-09-09 Thread Christos Jonathan Hayward
te_base.html. -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian author. Author Bio <http://jonathanscorner.com/author/> • Books<http://cjshayward.com/> • *Email * • Facebook<http://www.facebook.com/c

Re: Integrating django-honeypot with Pinax

2011-09-08 Thread Christos Jonathan Hayward
Breadcrumb note: someone on the list pointed out the middleware described at the bottom of django-honeypot's homepage. That was what I wanted. On Thu, Sep 8, 2011 at 1:21 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I would like to incorporate d

Integrating django-honeypot with Pinax

2011-09-08 Thread Christos Jonathan Hayward
views to lessen the load of spam? -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian author. Author Bio <http://jonathanscorner.com/author/> • Books<http://cjshayward.com/> • *Email * • Facebook<http://w

Re: psycopg2 and Binary

2011-09-07 Thread Jonathan S
So, it works if I patch django.contrib.gis.db.backends.postgis.adapter. But that's obviously *not* the way to go... class PostGISAdapter(object): ... def getquoted(self): "Returns a properly quoted string for use in PostgreSQL/ PostGIS." # Want to use WKB, so wrap with psy

psycopg2 and Binary

2011-09-07 Thread Jonathan S
null-termination. Any help? Thanks, Jonathan -- 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 group, send email to django-users+unsubscr...@google

Upload above apache web root? -- Can upload directory depend upon the username currently logged in?

2011-08-08 Thread Jonathan of Cambridge
D_DIR=request.username) Please direct me to any resources that can further me along this journey or suggest how to solve my challenge. Thank you in advance, Jonathan === import json from django.http import H

Re: Django admin upload image to few folders

2011-07-28 Thread Jonathan of Cambridge
tabases in django. Thank you in advance, Jonathan - class UploadModel(models.Model): file = models.FileField(upload_to='uploads/%Y/%m/%d/%H/%M/%S/') class UploadForm(forms.ModelForm): class

Re: Django, Pinax, Dreamhost Project

2011-07-28 Thread Jonathan of Cambridge
work as do others. You probably want to be more specific in telling people what you want your site to do for you and your background to receive more specific help. If you need more assistance, feel free to ask. Jonathan of Cambridge On Jul 26, 12:03 pm, Jeremy wrote: > Hello all, I'm

PyStack and Djangoverflow

2011-05-15 Thread Jonathan Endersby
Hi If you're on Twitter you might want to follow these two feeds of highly rated Python and Django questions from Stack Overflow. http://twitter.com/#!/djangoverflow and http://twitter.com/#!/pystack -- Jonathan -- You received this message because you are subscribed to the Google G

Deploy to stodgy Apache

2011-04-30 Thread Jonathan Hayward
FastCGIExternalServer directive. Is there a way I can leverage the /fcgi-bin/ directory and httpd.conf so that requests for /shop/foo/ are serviced by Django? -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian author. Auth

Re: Missing step to syncdb from models.py?

2011-04-09 Thread Jonathan Hayward
I found the problem. I needed to put 'foo' (and 'django.contrib.admin') in settings.INSTALLED_APPS. On Sat, Apr 9, 2011 at 2:29 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I am missing a step in configuration, I believe, in getting a sync

Missing step to syncdb from models.py?

2011-04-09 Thread Jonathan Hayward
l the tables created for the Django admin interface to work? For another project, I couldn't save objects because an admin interface table didn't exist.) -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian auth

Re: Python Decorators

2011-04-06 Thread Jonathan S
Your code looks perfect. Following does print 'True'. def widget(widget_switch, as_string=False): def decorator(func): def wrapper(*args, **kwargs): # logic in here can access the value of 'widget_switch' but 'as_string' is not defined? print as_string

Attempting to save instance with null ID?

2010-12-30 Thread Jonathan Hayward
86_64/lib/python2.7/lib-tk', '/tools/python/2.7/Linux_x86_64/lib/python2.7/lib-old', '/tools/python/2.7/Linux_x86_64/lib/python2.7/lib-dynload', '/tools/python/2.7/Linux_x86_64/lib/python2.7/site-packages', '/tools/python/2.7/Linux_x86_64/lib/python2.7/site-packag

English translation for error message?

2010-12-21 Thread Jonathan Hayward
hen I go through and comment out the docstring and __str__() and __unicode__() methods. What are the likely causes, and what can I do to fix this? -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian author. Author Bio &

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
me and Firefox. So maybe you're not using a threaded Apache. Sorry for >> jumping to conclusions! >> >> Jonathan >> > > What has that got to do with the price of cheese? You're absolutely right, it's got nothing to do with it at all, HTTP is stateless, even

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
Ben, Yes, that is definitely going to be the quickest way to resolve your issue, and I see no reason not to use them - Django hashes the data in them so it's safe from casual prying... Hth, Jonathan ? 19 ?.?. 2553 21:54 Ben Luedtke ?: > Thanks Jonathan, > > Either w

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ?.?. 2010, at 21:49, Jonathan Barratt wrote: > > On 19 ?.?. 2010, at 21:32, Quiet Light Development wrote: > >> Thank you Masklinn and Jonathan for your responses. I don't know a lot >> about the physical set-up of the system, I can ask the server >&

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
On 19 ต.ค. 2010, at 21:32, Quiet Light Development wrote: > Thank you Masklinn and Jonathan for your responses. I don't know a lot > about the physical set-up of the system, I can ask the server > administrators that question. > > The server is running Apache 2.2.12 on Ubun

Re: Session issues in Internet Explorer

2010-10-19 Thread Jonathan Barratt
ut trying to track sessions > through the database. What web server are you running? Best wishes, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups

Re: how safe is the template engine

2010-10-18 Thread Jonathan S
Be careful, Don't forget that users will be able to execute random templatetags, which may be able to do read/write to the database as well. On 16 oct, 18:06, "Henrik Genssen" wrote: > Hi, > > can I safely use the template engine to produce user configured output? > If I use the template engine

Re: Database Setup

2010-10-16 Thread Jonathan Barratt
e, and am using postgres with Django myself, but I did some digging for you on the project's forums and found this link which looks like it does the trick: http://www.bcspcsonline.com/wiki/index.php?title=MySQL-5.1.34_Python-2.6_Module_Build_Instructions Hope you have visual studio insta

Re: Save Handlers and a newbie to Django

2010-10-15 Thread Jonathan Barratt
On 15 ?.?. 2010, at 21:35, Devin M wrote: > Ok its running in a infinite loop because im calling > self.*photo.save() and that starts this loop all over again. Maybe I > can add a field to the model like booleen resized and if its true dont > do any resizing but if its false then perform some res

Re: Save Handlers and a newbie to Django

2010-10-15 Thread Jonathan Barratt
ods Not sure that it'll let you do what you need, but you'll be able to tell whether that's the case or not quicker than I! :) Good luck! Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: I18n in Django model

2010-10-15 Thread Jonathan Barratt
e see: http://docs.djangoproject.com/en/dev/topics/i18n/internationalization/ Good luck, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group,

Re: duplicate key value violates unique constraint "django_admin_log_pkey"

2010-10-14 Thread Jonathan Barratt
g';" so that the old ids are gone and you can start over from 1 - but then you lose your whole admin history which seems sub-optimal. Haven't run into the problem myself though, so this is just a guess, and from a Django newbie so... Hope it helps! Jonathan -- You received thi

Re: Help with Manager.

2010-10-14 Thread Jonathan Barratt
want to add some checking that cancel_date is not null, or that active_period is not negative but you get the idea) Then where you need to access that queryset use: order.objects.filter(active_period__gt=period_threshold) But others with more Django experience than I may give you better advice..

Re: Delete the FileField record but keep the file?

2010-10-14 Thread Jonathan Barratt
ename instead of copy to save yourself some disk I\O... > > On Oct 13, 2:13 am, Jonathan Barratt > wrote: >> On 12 ต.ค. 2010, at 22:42,Stodgewrote: >> >>> Short of creating my own custom FileField class, is there anyway to >>> pass an optional "delet

Re: CSRF issue in django-forum

2010-10-14 Thread Jonathan Barratt
On 14 ?.?. 2010, at 18:06, Sithembewena Lloyd Dube wrote: > Hi Jonathan, > > Thanks for the tip. The rub with that is, we are using csrf tokens in the > rest of our views. While authentication may still take care of basic > security, removing csrf middleware would surely in

Re: Rich email with attachments

2010-10-14 Thread Jonathan Barratt
in terms of both Django and javascript so I hope > it's not a silly request, I hope someone will at least be able to > point me in the right direction. On the server-side, once you've received the HTTP request with the uploaded file, you'll want to use the Django features desc

Re: CSRF issue in django-forum

2010-10-14 Thread Jonathan Barratt
re I had a similar problem, though admittedly I'm not worried about CSRF due to the two-factor authentication system used for access to the site in question... Hopefully someone with more experience than I can give you an alternative option, but just in case... Jonathan -- You received

Re: Database Setup

2010-10-13 Thread Jonathan Barratt
Error loading MySQLdb > module: No module named MySQLdb > > does that help? It does confirm that the problem is the missing DB bindings... Good luck, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gr

Re: Halting large form-based file uploads

2010-10-13 Thread Jonathan Barratt
based on file size > DURING the upload? Yes, but it would be through your web server software rather than your web application itself. If you're using Apache you could use the LimitRequestBody directive (http://httpd.apache.org/docs/1.3/mod/core.html#limitrequestbody). hth, Jonathan --

Re: How long is a model validation heavy testsuite supposed to run?

2010-10-13 Thread Jonathan Barratt
On 13 ?.?. 2010, at 22:07, Javier Guerra Giraldez wrote: > 2010/10/13 Jonathan Barratt : >> not being an SQLite user myself but knowing the database image is a simple >> single file > > you'd be surprised to learn that a good single-file architecture can > be waa

Re: mtv pattern(diagram)

2010-10-13 Thread Jonathan Barratt
#x27;s view methods, and templates should you use them, are its implementation of the View component in MVC. 0.02, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegrou

Re: What is the best way to implement time-based / cronjob actions in a Django app?

2010-10-13 Thread Jonathan Barratt
es grace past their official two hours... Hope that helps, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-use

Re: How long is a model validation heavy testsuite supposed to run?

2010-10-13 Thread Jonathan Barratt
On 13 ?.?. 2010, at 17:43, Russell Keith-Magee wrote: > 2010/10/13 Jonathan Barratt : >> On 13 ?.?. 2010, at 2:31, Jorge Vargas wrote: > >> A database migration might not be the sort of effort you were looking for, >> but I can only imagine that moving from SQLite to

Re: Editing user profiles via "inlines" breaks password management in admin site

2010-10-13 Thread Jonathan Barratt
go user module, so you do have to create the user first and then create their profile separately, but it avoids the problems you're running into and seems like the simplest solution to your problem to me... Others with more Django experience may have a better answer for you though. Best wi

Re: How long is a model validation heavy testsuite supposed to run?

2010-10-13 Thread Jonathan Barratt
e largest possible performance gains... 0.02, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubsc

Re: How to launch home page from urls.py?

2010-10-13 Thread Jonathan Barratt
something like > "a.b.com/winapp/HomePage.html". > > I have gone through the documentation and a couple of books, but I > cannot figure out how to launch "HomePage.html" by using just > "a.b.com". I believe that the regular expression you're lo

Re: How do I use JQuery UI tabs with Django (or other tab-solution)?

2010-10-13 Thread Jonathan Barratt
On 13 ?.?. 2010, at 14:14, Torbjorn wrote: > > > Or, is it another smoother way to get tabs in a Django app? If you're not completely tied to jQuery, you might consider dojango, which is Django-integrated version of the Dojo ajax toolkit, which does support tabs. Good

Re: HTTP load testing tools?

2010-10-13 Thread Jonathan Barratt
://www.hpl.hp.com/research/linux/httperf/ FYI, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+u

Re: Database Setup

2010-10-12 Thread Jonathan Barratt
have to see the most recent call that threw an exception... Best wishes, Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send em

Re: Delete the FileField record but keep the file?

2010-10-12 Thread Jonathan Barratt
re me, I would just save a copy of the file to a different directory, or rename it without going through Django, and then call delete on the original object. But I Am A Django Noob, so others may have better suggestions for you... Jonathan > > -- > You received this message becau

Re: trouble creating first project

2010-10-12 Thread Jonathan Barratt
ecified by the path /usr/local/bin Thus after running the command you should now have a django-admin.py located in /usr/local/bin which "points" to the actual django-admin.py, thus making django-admin.py available from wherever - assuming /usr/local/bin is in your PATH... Hope that helps e

Re: MySQLdb on Ubuntu 10.10

2010-10-12 Thread Jonathan Barratt
Hi Will, On 12 ?.?. 2010, at 16:52, Will McGugan wrote: > Hi, > > I've just upgraded my development machine from Ubuntu 10.04 to 10.10. > Unfortunately, now my Django apps wont start, I get the following > traceback on runserver: > File "/usr/local/lib/python2.6/dist-packages/django/db/backe

Re: Custom validation in model formset

2010-10-11 Thread Jonathan Barratt
annot be less than x.') > > I get the following error: > > Exception Value: 'list' object has no attribute 'ValidationError' On my mobile so can't check but I suspect forms is a list of form objects, try form.validation error instead... Good luck! Jona

Re: Unicode, utf8, mysql

2010-10-11 Thread Jonathan Barratt
ณ 11 ต.ค. 2553 เวลา 21:34 Mathieu Leduc-Hamel เขียน: > Hi all, > > I'm the main maintainer of a website called l'Agenda Du libre du > Québec. On this website, people can submit events about free/open > software in their local community. > > Yesterday, somebody tried to submit a new event, but

Re: Smaller Than in Django database API

2010-10-11 Thread Jonathan Barratt
Ah, most enlightening and makes perfect sense, thanks Tom! ? 11 ?.?. 2553 21:45 Tom Evans ?: > 2010/10/11 Jonathan Barratt : >> On 11 ?.?. 2010, at 21:05, Sithembewena Lloyd Dube wrote: >> Note also that, AFAIK, multiple where criteria are accomplished by chaining &g

Re: Smaller Than in Django database API

2010-10-11 Thread Jonathan Barratt
omplished by chaining filters rather than providing them as a list to one filter call. But I am new to Django myself, so if anyone corrects this advice - follow their directions not mine! :) Good luck! Jonathan > > Thanks. > > -- > Regards, > Sithembewena Lloyd Dube > http:

Re:

2010-10-11 Thread Jonathan Barratt
ll find the download links and installation instructions... Happy coding! Jonathan > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsu

Re:

2010-10-11 Thread Jonathan Barratt
tp import HttpResponse > > > def current_datetime(request): > > word = request.GET['word'] > > return HttpResponse(word) Needs to be: > def current_datetime(request): > word = request.GET['word'] > return HttpResponse(word) Hth, Jonatha

<    1   2   3   4   5   6   >