Re: .save() works with no (custom, not 'id') primary key specified?

2011-04-29 Thread Jeff Blaine
"primary_key=True implies null=False and unique=True. Only one primary key is allowed on an object." So that unique=True

Re: .save() works with no (custom, not 'id') primary key specified?

2011-04-29 Thread Jeff Blaine
A specified primary_key should not be auto-incrementing from my understanding. The following shows 2 objects with the same value for a field I specified should be the primary_key: >>> from hostdb.models import Device >>> d = Device() >>> d.propertyno '' >>> d.save() >>> d = Device() >>> d.prope

Re: .save() works with no (custom, not 'id') primary key specified?

2011-04-29 Thread Jeff Blaine
"If Django sees you've explicitly set Field.primary_key, it won't add the automatic id column." http://docs.djangoproject.com/en/1.3/topics/db/models/#automatic-primary-key-fields -- You received this

.save() works with no (custom, not 'id') primary key specified?

2011-04-29 Thread Jeff Blaine
How is this possible based on the model below? d = Device() d.save() # no errors class Device(models.Model): propertyno = models.CharField('Property Number', max_length=10, primary_key=True) -- You received

Admin bug w/ deleting a TabularInline'd object?

2011-04-23 Thread Jeff Blaine
I'd like to vet this through the users here before submitting a bug report. Per the tutorial, all of my models have a defined __unicode__(self) which returns a string. The code is below, but here's the scenario: 1. I add a 'Device' with associated 'Interface'. 2. I edit the 'Device', with th

Re: website path

2011-04-19 Thread Jeff Blaine
How to avoid hardcoding URL paths in your templates: http://docs.djangoproject.com/en/1.3/ref/templates/builtins/#url Maybe that helps some? I don't think I can be of more help. I'm too new. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Why i can reach my media files from my static url?

2011-04-19 Thread Jeff Blaine
Please show your settings: STATIC_ROOT STATICFILES_DIR STATIC_URL MEDIA_ROOT MEDIA_URL -- 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 emai

Re: website path

2011-04-19 Thread Jeff Blaine
I imagine you need to configure your urls.py I suggest going through the whole tutorial, starting at the following page. This is all explained there. http://docs.djangoproject.com/en/1.3/intro/tutorial01/ -- You received this message because you are subscribed to the Google Groups "Django us

Cannot submit tickets - always marked as spam!

2011-04-19 Thread Jeff Blaine
I've tried twice now to interact with the Django trac. Last week and just now. Both resulted in: badip:state/blacklist.d/127.0.0.1 Please tell me what I am doing wrong. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Put an "inline" at the top of admin form instead of bottom?

2011-04-15 Thread Jeff Blaine
I'm using the admin functionality for most of my needs (a nice CRUD DB frontend, not a user-facing website). Is there a best way to get one of my inline models presented at the top of the form instead of the bottom? I would greatly prefer not to have to specify all of the fields (via ModelAdm

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-15 Thread Jeff Blaine
On Friday, April 15, 2011 4:21:56 PM UTC-4, Brian Neal wrote: > > You didn't post how you loaded the template in your view function. In > particular, what path string you used. > Ah. The missing piece to bring order to all of this confusion on my part. I was using "myapp/index.html", per

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-15 Thread Jeff Blaine
Thank you all. I will digest the replies when I have the time to properly focus back on the issue (it's obviously small, since I have a workaround in place by shoving base.html into the project root). It still, regardless of solutions, even in light of the words shared in this thread (which I'

Re: base.html (extended by others) has to be in project (not app) root?

2011-04-14 Thread Jeff Blaine
o: TEMPLATE_DIRS = ( '/myproject/myapp', ) Which then results in failure to find even /myproject/myapp/index.html TemplateDoesNotExist at / > > Best of Luck. > > -- > Gladys > http://blog.bixly.com > > > On Apr 15, 3:56 am, Jeff Blaine

base.html (extended by others) has to be in project (not app) root?

2011-04-14 Thread Jeff Blaine
Django 1.3 Hi all, I can't seem to get around this. It appears that, the following "index.html" template in */whatever/myproject/myapp* {% extends "base.html %} Looks for base.html as /whatever/myproject/base.html instead of /whatever/myproject/myapp/base.html My TEMPLATE_DIRS is set as fo

Re: Passing data to javascript

2011-01-13 Thread Jeff Green
That worked! Thanks for your help Jeff On Thu, Jan 13, 2011 at 8:31 AM, Shawn Milochik wrote: > Try using safestring.mark_safe() on the string before dumping it into the > template. > > Shawn > > -- > You received this message because you are subscribed to the Google G

Re: new user having trouble connecting django to postgres with psycopg2

2011-01-08 Thread Jeff Tchang
Can you try logging into the database and running: SELECT * FROM pg_timezone_names; Maybe try picking something from that list? -Jeff On Sat, Jan 8, 2011 at 8:19 PM, Mark Brazil wrote: > Same error > > Traceback (most recent call last): >   File "manage.py", line 11, in

Re: Iterating over dictionaries in template not working in Django 1.2.3

2011-01-06 Thread jeff aigner
    u.save() >  49                     except ValidationError, e: >  50                         unsaved_users.append([u,e.message_dict]) On Jan 6, 11:58 am, jeff aigner wrote: > I'm trying to create a page for mass user creation, and I'm having > troubles iterating over the error dictionari

Iterating over dictionaries in template not working in Django 1.2.3

2011-01-06 Thread jeff aigner
I'm trying to create a page for mass user creation, and I'm having troubles iterating over the error dictionaries in the template. The dictionary I am trying to iterate over looks like this: {'username': [u'User with this Username already exists.']} But rather than iterating over this single item

Re: Pre-filled user info in Django Comments?

2010-12-10 Thread Jeff
My site takes the route of hiding name, email, and URL fields for authenticated users. You can safely serve up a form without the name field for authenticated users since the comments framework will just copy over either the user's full name if it's set or their username if it isn't for the commen

Re: moving from Postgres to MySQL

2010-10-21 Thread Jeff Green
When I was using loaddata I found out that if I did not have a True or False value for any boolean fields, I would have an issue loading the data. Once, I set the value for any records to True or False I was successfully able to use loaddata. Hope that helps On Thu, Oct 21, 2010 at 7:31 AM, Chris

Trying to delete all entries results in an AttributeError

2010-10-17 Thread Jeff
g wrong? Full stacktrace: >>> Comment.objects.all().delete() Traceback (most recent call last): File "", line 1, in File "/home/jeff/.virtualenvs/osl_main-website/lib/python2.6/site- packages/django/db/models/query.py", line 441, in delete obj._collect_sub_objects(seen_

Re: moving from Postgres to MySQL

2010-10-11 Thread Jeff Green
I am in the process of migrating a postgresql database to oracle which has a lot of data. I tried to use the dumpdata command but because of the amount of data I had to scrap the plan. My alternative solution with Django 1.2 is to do a read and write from postgresql to oracle. On Mon, Oct 11,

Re: Multiple authentication sources to one database

2010-09-02 Thread Jeff Bell
y so this is my best shot. Jeff On Thu, Sep 2, 2010 at 4:28 PM, Shawn Milochik wrote: > You can use multiple authentication backends in the same Django > project. All you have to do is write/install a backend that supports > your alternative method, and add it to AUTHENTICATION_BAC

Re: Chat application in Django

2010-08-31 Thread Jeff Bell
Pretty sure fb uses Erlang for chat. On Aug 31, 2010 7:34 AM, "Shamail Tayyab" wrote: > Hi, > > I am working on a chat application in Django, how can I ensure that I > do not have to poll the server for any chat data. > > Possible approaches that I've been to: > > 1. BAD - use polling. > > 2. Use

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jeff Green
s=choicelist, > > required=False) > > > > (and make the same change to the multiple select as well) > > > > Assuming the ConfigurationName has proper capitalization it should > > work. > > > > On Jul

Re: field.label in template converts to lower case in 1.2.1

2010-07-30 Thread Jeff Green
nfig.ConfigurationName != 'Phase': delete_field = config.ConfigurationName + 'DeleteFlag' self.fields[delete_field] = forms.BooleanField( required=False) On Thu, Jul 29, 2010 at 5:31 PM, Jason wrote: >

Re: field.label in template converts to lower case in 1.2.1

2010-07-29 Thread Jeff Green
ing field.html_name > > I've run into some slight problems figuring out the proper id's for > the corresponding labels... Normally it's just > id_{{ field.html_name }} but if you get into auto_id's as well as > labels for more complex things (radio button lists, et

field.label in template converts to lower case in 1.2.1

2010-07-29 Thread Jeff Green
%} {{ field.label_tag}} Thanks, Jeff -- 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+unsubscr...@googlegroups.com. For mo

Re: NotImplementedException when trying to log user in after registration

2010-07-23 Thread Jeff
xception > > (code > =http://code.djangoproject.com/browser/django/trunk/django/contrib/aut... > ) > > On 22 July 2010 23:33, Jeff wrote: > > > > > Hi, > > > I get a NotImplementedException when I try to log a user in right > > after they register. &g

NotImplementedException when trying to log user in after registration

2010-07-22 Thread Jeff
te_account.html', { 'form': form, }, context_instance=RequestContext(request)) And here is the stack trace: File "/home/jeff/.virtualenvs/osl_main-website/lib/python2.6/site- packages/django/core/handlers/base.py" in get_response 100. res

Re: doctests not running

2010-07-10 Thread Jeff
4 """ self.content = markdown.markdown(self.markdown_content) super(Flatpage, self).save(force_insert, force_update) and here is the new test output: Installed 6 object(s) from 1 fixture(s) Doctest: osl_flatpages.models.Flatpage ... ok Doctest: osl_flatpages.mod

Re: doctests not running

2010-07-10 Thread Jeff
n 7 items. 4 passed and 0 failed. Test passed. TestResults(failed=0, attempted=4) So the problem appears to be with the Django test runner not adding the doctests to the test suite it runs. I'm still not sure how to fix this issue unfortunately. On Jul 10, 9:50 pm, Jeff wrote: > Hi, &g

doctests not running

2010-07-10 Thread Jeff
Hi, I have a rather complicated get_absolute_url method in a models.py file that I wanted to use two doctests to check. Unfortunately the doctests do not appear to run when I run python manage.py test according to the verbose output. Here is the method: def get_absolute_url(self): ""

Re: Queryset composition query

2010-07-07 Thread Jeff Green
When I combine two query sets I use the chain command. You might want to try it. Here is my code snippet from itertools import chain # Get current station configuration records stationlist = StationConfig.objects.filter(StationId=result.StationId, StartDate__lte= result.Ex

Re: QuerySet Behaviour Question (Django 1.1)

2010-06-28 Thread Jeff
Yes I am using PostgreSQL and I didn't add an order by clause. Adding the order by clause fixed the problem. Thank you very much Karen! Jeff On Jun 28, 10:46 am, Karen Tracey wrote: > On Mon, Jun 28, 2010 at 10:37 AM, Jeff wrote: > > Hi, > > > I have a question c

Re: Admin interface for model with optional 'self' relationship

2010-06-28 Thread Jeff Green
You need to also state that null=True. Also, you want to have ensure that the field defined in your db allows null values. On Mon, Jun 28, 2010 at 3:19 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I have a model with two foreign keys to itself: > > department = models.

QuerySet Behaviour Question (Django 1.1)

2010-06-28 Thread Jeff
Hi, I have a question concerning some queryset behaviour in Django 1.1. In this example, I have an article model that can contain 1 or more authors who are users registered through Django's auth system. I get the following output when playing around with an article in a shell where I have three

Re: Setting initial on multi select widget

2010-06-18 Thread Jeff Green
Can you clarify what you mean by sequence. It would be appreciated if you can provide me of an example which might help me to understand how to implement it. Thanks, Jeff On Fri, Jun 18, 2010 at 8:44 AM, bruno desthuilliers < bruno.desthuilli...@gmail.com> wrote: > > > On 18 ju

Setting initial on multi select widget

2010-06-18 Thread Jeff Green
'), ('choice764', u'PD0003362'), ('choice723', u'PD0003381'), ('choice889' , u'PD0007345'), ('choice892', u'PD0007351'), ('choice751', u'PDO003371')] Any help would be greatly appreciated. Thanks

Re: Admin error with large charField

2010-06-14 Thread Jeff Green
the text with more than 200 characters and I was able to delete the record successfully. I have put in the details for my scenario in ticket #10523 Jeff On Mon, Jun 14, 2010 at 11:50 AM, Karen Tracey wrote: > On Mon, Jun 14, 2010 at 11:39 AM, Jeff Green wrote: > >> In one of my mode

Admin error with large charField

2010-06-14 Thread Jeff Green
change_message field is defined as a TextField which has a limit of 200 characters. Any suggestions on how to get around this issue. Thanks, Jeff -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Dumping large database

2010-06-14 Thread Jeff Green
Actually, upgrading to 1.2 and doing a copy from one db to the other seems like the best option. Thanks for the info Jeff On Mon, Jun 14, 2010 at 5:34 AM, David De La Harpe Golden < david.delaharpe.gol...@ichec.ie> wrote: > On 14/06/10 04:15, Jeff Green wrote: > >> I was wo

Dumping large database

2010-06-13 Thread Jeff Green
suggestions on the best way to migrate a large database. Thanks, Jeff -- 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 dj

QuerySet for view from RawQuerySet (lacks _clone), or select_related with M2M?

2010-05-25 Thread Jeff Kowalczyk
x27;d much rather use that method, but I wasn't able to make it work. Thanks, Jeff # models.py: class Catalog(models.Model): title = models.CharField(max_length=50) slug = models.SlugField() users = models.ManyToManyField(User, blank=True, re

Re: Form Validation question

2010-05-13 Thread Jeff Green
I have used sessions to store the initial db record so that when I go into my form I retrieve the value such as stationrec = request.session['stationrec'] On Thu, May 13, 2010 at 9:36 AM, zweb wrote: > I am using a model form to edit (change) an exisiting row in db. > > in clean_xxx() method I

difficulty with 1.2 CSFR processing

2010-04-26 Thread jeff
so i have some views and forms done without using the CsrfViewMiddleware. now i am converting to a 1.2 project using this middleware. read the doc, looked for examples, still can't process the POST function from my form. the example i have is very simple. hoping for someone who knows this to take

form object has no attribute 'cleaned_data'

2010-03-31 Thread jeff
so i've searched high and low on this error. lots of answers about having used old versions of django. i did this: j...@earth:/home/samba/raymour/v1/rrsite$ django-admin.py --version 1.1.1 then a lot of stuff about python path having been done with an easy installer and having an 'egg' in it. doe

Re: Can't get Uploaded File into DictReader

2010-02-27 Thread jeff
Thanks for the feedback. The bit about it being iterable put me on the right track and it turned out to be pretty simple. For the benefit of others, here's the basic code to select a CSV file on the local machine and process it on the server using DictReader to manage the columns: FORM: class I

Re: csrf migration

2010-02-10 Thread Jeff Bauer
these changes immediately upon upgrading, you'll see nothing but 403 Forbidden messages saying you're using Django's CSRF features incorrectly. (Never mind that you're running everything over SSL on a corporate intranet.) On Feb 10, 2:47 pm, Jeff Bauer wrote: > It

csrf migration

2010-02-10 Thread Jeff Bauer
It looks to be a long week of working out backwards incompatible stuff in Django-1.2 (beta-1). http://docs.djangoproject.com/en/dev/ref/contrib/csrf/ But I wish there were a gentler upgrade path. My main question: Is there a way to re-code my applications so the same codebase can run on both

Can't get Uploaded File into DictReader

2010-02-09 Thread jeff
ame" except Exception, e: print e else: form = ImportFileForm() return render_to_response('admin_import_from_excel.html', {'form': form,}, RequestContext(request) ) Thanks in advance for any assistance. Jeff -- You received this messa

Re: Admin interface not working in Oracle

2010-01-26 Thread Jeff Green
admin.site.root instead of admin.site.urls? Thanks, Jeff On Tue, Jan 26, 2010 at 9:29 AM, Jeff Green wrote: > I am in the process of migrating my web site from postgresql to > oracle. > It seems that in oracle when I get into the admin site and click on > any of the tables it does not displa

Admin interface not working in Oracle

2010-01-26 Thread Jeff Green
SVN-12117 Has anyone experienced this issue? Thanks, Jeff -- 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-user

Re: Calendaring

2010-01-20 Thread Jeff Bell
This is a pretty cool implementation http://github.com/justinlilly/django-gencal On Wed, Jan 20, 2010 at 3:40 PM, Shane Graber wrote: > Is there a calendaring app that people really like to use with Django? > What's the most popular one at the moment? > > Shane > > -- > You received this mess

Re: Bad Marshal Data error

2009-11-01 Thread Jeff
That did the trick, thank you! On Nov 1, 6:52 am, Karen Tracey wrote: > Try deleting all your .pyc files and it might go away. > > Karen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Bad Marshal Data error

2009-10-31 Thread Jeff
Hi, I'm getting the following error when I run "python manage.py", "python manage.py runserver", or "python manage.py shell" in my project's directory: Traceback (most recent call last): File "manage.py", line 11, in execute_manager(settings) File "/usr/lib/python2.6/site-packages/djang

Re: How to get multiple test cases to work with manage.py test?

2009-10-18 Thread Jeff
I did not realize that was the case with the xUnit APIs. Thank you so much for your help. On Oct 18, 9:47 am, Russell Keith-Magee wrote: > On Sun, Oct 18, 2009 at 11:49 AM, Jeff wrote: > > > Hi, > > > I'm fairly new to Django and unittest and I seem to be having a >

How to get multiple test cases to work with manage.py test?

2009-10-17 Thread Jeff
Hi, I'm fairly new to Django and unittest and I seem to be having a problem getting manage.py to execute all of my tests. I can only get it to execute one test at a time by specifying the test method. When I just specify the TestCase class expecting it to execute all of the test methods, it won't

Multi-db support

2009-10-14 Thread Jeff Bell
Hi all, Am I wasting my time trying to figure out multi-db functionality. I know that Alex Gaynor is working on a GSOC project that is slatted for Django 1.2 release that deals with this, but I can't imagine that being released anytime soon. I've been able to configure a MultiDBManager for my t

session intermittently disappears just after login

2009-10-01 Thread Jeff Gentry
Hi there ... (this is also posted to stackoverflow: http://stackoverflow.com/questions/1504537/django-session-intermittently-disappears-just-after-login) In my django app, I handle login in the following manner. Users go to a gateway page (index.html) - if they are not currently logged in, the

Efficiently searching a tree of FKs

2009-09-22 Thread Jeff Gentry
Hello ... I have a tree like structure created out of models using ForeignKey linkages. As an example: Model Person: name = CharField Model Book: name = CharField author = FK(Person) Model Movie: name = CharField director = FK(Person) Model Album: name = CharField direct

Re: readonly forms

2009-09-14 Thread Jeff Green
It would be nice to get something like this into django. I have used something similar for my readonly fields. On Mon, Sep 14, 2009 at 6:14 AM, Thomas Guettler wrote: > > hi, > > I develop intranet apps with a lot of forms. Sometimes I need > to render them as readonly. I use snippet 1682 (see b

Re: login required

2009-09-09 Thread Jeff Green
I would think you could just extend the User model to store the registered users and then check if the user is registered which would then redirect to the survey page. On Tue, Sep 8, 2009 at 11:30 PM, putih wrote: > > hii, > > need your help on this matter :- > > 1. how to restrict user for cert

Re: Editors of choice

2009-09-08 Thread Jeff Gentry
On Mon, Sep 7, 2009 at 2:55 PM, Samuel Hopkins wrote: > Anyhow, the purpose of this email was just to ask the community what > editor(s) they preferred to use with Django. Emacs --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Goo

Re: Problems trying to use jinja2

2009-08-31 Thread Jeff
Alright, I found this: http://code.djangoproject.com/ticket/10216 which explains the cryptic error message. The fix is to disable TEMPLATE_DEBUG. On Aug 31, 2:44 pm, Jeff wrote: > Hi, > > I seem to have run into a problem trying to use the jinja2 template > language. I&#x

Problems trying to use jinja2

2009-08-31 Thread Jeff
Hi, I seem to have run into a problem trying to use the jinja2 template language. I've tried using Mitsuhiko's snippet (http://bitbucket.org/ mitsuhiko/jinja2-main/src/c07588cf115f/ext/djangojinja2.py) and this other one by Joe Vasquez (http://jobscry.net/downloads/jinja_r2r.txt) where I had to c

Re: Django searching for admin template in admindocs directory

2009-08-30 Thread Jeff
Thank you very much, adding it did the trick. Not sure how I missed that. On Aug 30, 4:39 pm, Alex Gaynor wrote: > On Sun, Aug 30, 2009 at 4:33 PM, Jeff wrote: > > > Hi, > > > I'm a Django newbie and have run into a Template Not Found error when > > setting up t

Django searching for admin template in admindocs directory

2009-08-30 Thread Jeff
ts.middleware.RedirectFallbackMiddleware', 'django.middleware.http.ConditionalGetMiddleware') Template Loader Error: Django tried loading these templates, in this order: Using loader django.template.loaders.filesystem.load_template_source: /home/jeff/projects/osl/oslaurier/templates/adm

Re: IE problems w. admin save

2009-08-10 Thread Jeff Green
I am having similar problems with IE using formsets and the admin functionality. I tend to believe it is an issue with IE but I haven't been able to determine what the issue is. On Mon, Aug 10, 2009 at 10:42 AM, Jesper Rasmussen wrote: > > Hi there, > > I'm developing a simple Django system (Sqli

formsets with internet explorer

2009-08-06 Thread Jeff Green
suggestions on resolving this issue Thanks, Jeff --~--~-~--~~~---~--~~ 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 g

Practical Django Projects Chp. 3: TinyMCE won't appear in admin

2009-08-05 Thread Jeff
I have installed TinyMCE to my machine but I cant get it to appear in my admin screen. I am working through "Practical Django Projects" by James Bennett chapter 3. I am using windows not Linux so sometimes my errors are simply forward vs. backwards slashes but it doesn't appear to be the issue thi

Re: Change default queryset in admin for a model

2009-07-19 Thread jeff
/docs.djangoproject.com/en/dev/topics/db/models/#id6. If you really need to restrict the queryset for the model admin's list page, then yes, you can override the default queryset method defined in ModelAdmin just as the link describes. jeff On Jul 19, 12:40 pm, Some Guy wrote

Re: sorting different in postgres than in sqlite

2009-06-30 Thread Jeff FW
Any reason not to make the total 0 instead of None? Null in database (or None in Python) has a special meaning, and it doesn't always make sense to sort a list of (mostly) integers with some null values. -Jeff On Jun 30, 2:01 am, J wrote: > Hello, > > I developed an app for an

Re: Trying to understand Django and Python from a C++ perspective

2009-06-30 Thread Jeff FW
d this less useful in practice. -Jeff On Jun 29, 6:25 pm, Mark Jones wrote: > Yea, I'm not wanting to use stuff.objects, but I'm wanting to pull > some of the same voodoo, probably not safe for a python novice like > myself :-) > > On Jun 29, 5:24 pm, Alex Gaynor wrote: &

Re: Not displaying the data after space

2009-06-11 Thread Jeff FW
place. Without more information on what you're doing, that's the best I can give you. Check on that, and reply. -Jeff On Jun 11, 10:29 am, Nalini wrote: > Hi, > > I am using jvascript, python and django for my web page with Sqllite3 > at database. > > When i enter some

Re: Can a form have select box and be filled in at the same time?

2009-05-29 Thread Jeff FW
Have a choice of "Other", and provide a separate field for the user to type in their own data. That's a pretty standard way to handle that. If you wanted to make it fancier, you could even have javascript to only show the "other" text box if they've chosen the &qu

Re: IOError: request data read error (revisited)

2009-05-26 Thread Jeff FW
r that they did something wrong,) then I'm not too worried about it. I guess I won't know what they see until it happens to me, though :-) Thanks for your help, Jeff On May 25, 6:59 am, Graham Dumpleton wrote: > On May 25, 4:53 am, Jeff FW wrote: > > > Thanks for your response.

Re: IOError: request data read error (revisited)

2009-05-24 Thread Jeff FW
'SERVER_ADMIN': '[no address given]', 'SERVER_NAME': 'domain.com', 'SERVER_PORT': '80', 'SERVER_PROTOCOL': 'HTTP/1.1', 'SERVER_SIGNATURE': 'Apache/2.2.9 (Ubuntu) mod_ssl/2.2.9 OpenSSL/0.9.8g mod_wsgi/2.3 Python

Re: IOError: request data read error (revisited)

2009-05-21 Thread Jeff FW
rs from getting 500 errors: wrap the contents of that function in a try block, and *don't* raise the exception. Otherwise, I'd have to wrap every view that uses POST in that, which would be very annoying. Or maybe write middleware that just peeks at POST before anything else gets it, s

Re: login decorator losing POST data

2009-05-15 Thread Jeff FW
Sure--those are totally reasonable in most cases. However, the OP just said that all that's in the form is a single button, meaning most of those won't be an issue in this case. -Jeff On May 15, 10:03 am, Tim Chase wrote: > > If the form is just a single button, why not use

Re: login decorator losing POST data

2009-05-15 Thread Jeff FW
If the form is just a single button, why not use GET and not have to deal with POST at all? -Jeff On May 14, 11:28 am, aa56280 wrote: > Tim, > > Thanks for the fantastic insight into the browser issues with 307 > redirects. I'll explore this a bit further and see which route

Comments redirect after posting is not honoured if comment contains errors or is previewed

2009-05-12 Thread Jeff Winters
user is not redirected to the "next" value desired by the developer. Is this a bug that should be reported within the bug tracker, or should I attempt to work around the problem by subclassing CommentForm and adding fields to it? Thanks, Jeff --~--~-~--~~~

Re: offline population of django auth user table

2009-05-04 Thread Jeff
Thanks to both of you, both of these answers were very helpful. Jeff On May 2, 10:26 am, Malcolm Tredinnick wrote: > There are a couple of different solutions to this problem. Ultimately, > it comes down to providing the necessary information so that Django can > use your settings to

offline population of django auth user table

2009-05-02 Thread Jeff
I'm using Django's authentication. I would like to add several users through a command-line script (not through code executed via the website). Something like manage.py createsuperuser but for normal users and not interactive. I want to be able to put code like this in a script I can run offlin

ManyToMany query on all()?

2009-04-30 Thread jeff
hors for a single entry. Thanks Jeff --~--~-~--~~~---~--~~ 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 em

Re: View method + template

2009-04-28 Thread jeff
solution is simply to take out the second condition in that statement, so it reads "if 'q' in request.GET:" ... then the next if statement ("if not q:") takes care of testing whether you entered an empty string. Hope it helps jeff On Apr 28, 1:32 am, 83nini <83n...

Using a base for multiple settings files

2009-04-28 Thread jeff
I'm trying to get multiple sites to play nice side by side. It makes sense to me to have a base_settings.py file or something of the sort that defines sensible defaults for all the sites I'll be working with (they'll all share the same database and e-mail settings, for example). Then each of the s

Re: Basic RSS in Django

2009-04-15 Thread Jeff FW
It looks like you're missing (or at least, didn't mention) the templates. In documentation: http://docs.djangoproject.com/en/dev/ref/contrib/syndication/#ref-contrib-syndication make sure to read the paragraph starting with "One thing's left to do" under "A simple

Re: mod_python: "No module named django"

2009-04-02 Thread Jeff Gentry
Err, sorry, I meant to cancel and sent this instead. I believe I found my problem while preparing to email about this (wasn't looking close enough at the error message, and it looks like apache was looking in the wrong python's site-packages) On Thu, 2 Apr 2009, Jeff Gentry wrote: &

mod_python: "No module named django"

2009-04-02 Thread Jeff Gentry
Ok, so I've managed to get django running using mod_python on some other machines, but today I'm being stymied: --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send ema

Re: How to handle the Browser Close ?

2009-04-01 Thread Jeff FW
http://docs.djangoproject.com/en/dev/topics/http/sessions/#session-expire-at-browser-close On Apr 1, 2:26 am, veeravendhan wrote: > Say a user is logged in to the system,  If he closes the browser how > will I handle the Logout for that user ? Any idea ?? --~--~-~--~~~---

Re: Modifu request.user

2009-03-31 Thread Jeff FW
at seems like a very bad idea, and it won't (I think) change it in the session. What are you trying to accomplish? -Jeff On Mar 31, 2:35 am, Masarliev wrote: > I have a application but i have error in base logic and I need to > change request.user.id. > Is it posible to do t

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-18 Thread Jeff FW
hy it wouldn't work. Also, to back up Malcom, Jacob, and everyone else that's been trying to help you--you *have* been a bit difficult, and the wording you use *is* very important. You attract more flies with honey--not that anyone here is a fly. -Jeff On Mar 18, 12:13 am, "huu...@gma

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Jeff FW
n at least wait a little while--run a cron job (every minute, if you'd like) that finds all of the sessions that are past their expiration date. You can log them as you'd like, and then clear them out. -Jeff On Mar 16, 8:56 pm, Huuuze wrote: > Jeff (and Jacob)... > > I apprecia

Re: Django bug that should be addressed: Idle timeouts do not clear session information

2009-03-16 Thread Jeff FW
is kind of a nasty thing to do that 100th person. -Jeff On Mar 16, 6:38 pm, Jacob Kaplan-Moss wrote: > On Mon, Mar 16, 2009 at 4:46 PM, Huuuze wrote: > > Does anyone else agree with my viewpoints on this matter?  If so, > > please post your comments in the ticket. > > Actual

ModelForm for User allowing username with non-alpha characters

2009-03-14 Thread jeff
I have the ModelForm below to let the user edit some of their basic User fields like username, first/last name and email. During testing, I discovered that I could edit and save a username that included non- alpha characters. When I log into the admin system, the username is set to the new value

Re: how to create bigint ?

2009-03-13 Thread Jeff FW
Especially since international phone numbers can start with 0--try storing that in an integer field, and you'll immediately run into problems. On Mar 13, 8:43 am, Ozan Onay wrote: > As Karen pointed out, you should consider a phone number to be a > string, not an integer. Integers are there to d

Re: Users suddenly becoming inactive?

2009-03-07 Thread jeff
Figured it out. I had a model form that included is_active as a field, but that field was not being displayed in the form for regular users. It was evidently unsetting the value. On Mar 7, 5:08 pm, Malcolm Tredinnick wrote: > On Sat, 2009-03-07 at 10:12 -0800, jeff wrote: > > I&

Users suddenly becoming inactive?

2009-03-07 Thread jeff
ntication views that come with Django, but I am using the standard user class functions. Is there something subtle about users and authentication that not aware of that might explain this? I'm explicitly setting a new user to active when they are created: new_user.is_active = True new_user

Re: Optimizing my ORM query

2009-03-06 Thread Jeff Gentry
Sorry for the self-followup, but I got the right bits of extra. My actual case was a bit more complicated than my example below (it involved a fourth model), but it's working now - and much quicker than w/ the IN directive. Thanks. On Fri, 6 Mar 2009, Jeff Gentry wrote: > On Fri, 6

<    1   2   3   4   5   6   7   >