Re: Javascript in external file not working

2012-11-26 Thread Bill Beal
I think {{STATIC_URL}} should have spaces, like {{ STATIC_URL }}. On Mon, Nov 26, 2012 at 6:04 PM, Loai Ghoraba wrote: > Hi all > > When I have a script like this: > window.onload=function f(){} it is working fine. but > when I create an external js file and put it within the static directory,

set_expiry() auto logout on browser close

2012-11-24 Thread Bill Beal
Hi All, I'm trying to log the user out automatically when the browser closes. I call 'request.session.set_expiry(0)' on login and I'm using 'SESSION_EXPIRE_AT_BROWSER_CLOSE = True' in my settings. It's not happening. The 'How to use sessions' doc (1.4) says this call makes the session cookie ex

Using email instead of username for registration and login

2012-09-24 Thread Bill Beal
Hi all, I want to use the email address as the username for registration and login. I'm using django-registration for 2-stage registration. I'm looking for an easier way than what I've come up with so far. I can modify registration and activation, but then django.contrib.auth.views.login has

Re: How to separate data having the same model but belonging to different users?

2012-09-22 Thread Bill Beal
UTC-4, Rohit Banga wrote: > > Thats interesting Bill. > Are you talking about something like this? > > http://stackoverflow.com/questions/3276700/django-model-subclass-without-changing-database-name > > Thanks > Rohit Banga > http://iamrohitbanga.com/ > &g

Re: How to separate data having the same model but belonging to different users?

2012-09-22 Thread Bill Beal
Question for an expert from a newbie: Could you decorate each model that has data that needs to be separated by departments? If so, you wouldn't have to remember to code the department filter on each retrieval. On Friday, September 21, 2012 10:06:35 PM UTC-4, Rohit Banga wrote: > > Hi Dennis >

Re: runserver error: "No module named app3"

2012-08-24 Thread Bill Beal
7;, > ) > > If you are not using virtualenv and pip yet you should, it helps a lot. > > Notice you don't need to include use proj (such as in 'proj.app1') and > this is the way to go if you want to reuse your apps in other projects. > > Good luck! > > On

Re: runserver error: "No module named app3"

2012-08-22 Thread Bill Beal
Sorry, MELVYN. On Wednesday, August 22, 2012 11:53:44 PM UTC-4, Bill Beal wrote: > > Thanks, Melvin! That did it. On to the next error! > > > On Wednesday, August 22, 2012 5:16:15 PM UTC-4, Bill Beal wrote: >> >> Hi all, >> >> I have a Django project with

Re: runserver error: "No module named app3"

2012-08-22 Thread Bill Beal
Thanks, Melvin! That did it. On to the next error! On Wednesday, August 22, 2012 5:16:15 PM UTC-4, Bill Beal wrote: > > Hi all, > > I have a Django project with apps that works OK on a Mac with Django 1.3 > and Python 2.6, and I'm trying to move it to a Linux box with Djan

runserver error: "No module named app3"

2012-08-22 Thread Bill Beal
Hi all, I have a Django project with apps that works OK on a Mac with Django 1.3 and Python 2.6, and I'm trying to move it to a Linux box with Django 1.4 and Python 2.7. I created an empty project 'proj' with apps 'app1', 'app2', 'app3' on the Linux system and carefully merged settings.py, ur

Re: django.shortcuts redirect doesn't pass argument

2012-08-05 Thread Bill Beal
I see that I had mixed the second and third ways of using 'redirect' in the doc. It seems to be working OK this way: def upload1(request): . . . fout = 'tempfile.csv' return redirect('/isf/upload2/' + fout + '/') def upload2(request, filename=None): . . . with the following in u

Re: django.shortcuts redirect doesn't pass argument

2012-08-05 Thread Bill Beal
My example is wrong, because filepath turns out to be an 'InMemoryUploadedFile' object. But the problem remains the same because I had a dummy filename string that I was trying to pass. Actually the file would be uploaded to the server to a local file in upload1, then the filepath of the local fi

Re: Read from an uploaded file and put data in a form for automatic Django validation

2012-07-30 Thread Bill Beal
This works: In forms.py: class UploadForm(forms.Form): name = forms.CharField(label='name') addr1 = forms.CharField(label='addr1') Interactive: >>> from django import * >>> from app.forms import * >>> d = {'name': 'Fibber McGee', 'addr1': '79 Wistful Vista'} >>> form = UploadForm(d) >>> for

Re: REMOVE ME

2012-07-30 Thread Bill Beal
Andrew didn't ask the question, I did. He apparently responded to my post with his request to be removed. Maybe I need to start over. On Mon, Jul 30, 2012 at 1:33 AM, kenneth gonsalves wrote: > On Sun, 2012-07-29 at 14:32 +0800, Russell Keith-Magee wrote: > > On Sun, Jul 29, 2012 at 1:56 PM, Da

Re: How to call RegexValidator explicitly?

2012-05-26 Thread Bill Beal
Thanks! I put it in today and it worked fine. On May 24, 2012, at 9:10 AM, bruno desthuilliers wrote: > On May 24, 4:30 am, forthfan wrote: >> >> from django import forms >> from django.core.validators import * >> >> class IdentForm(forms.Form): >> ident = forms.CharField() >> ident_type

Re: Generating a list of available templates

2012-02-10 Thread Bill Beal
I know nothing, but here's what I did: python manage.py shell import os from settings import TEMPLATE_DIRS for x in TEMPLATE_DIRS: print x os.listdir(x) It gave me a list of the files in the (each) template directory. It looks like you already have a list of template directories in settings.

Re: How to use a DB table for choices=tuples in ChoiceField?

2012-01-21 Thread Bill Beal
27;, and it was more readable. Regards On Fri, Jan 20, 2012 at 11:22 PM, Dennis Lee Bieber wrote: > On Fri, 20 Jan 2012 19:44:16 -0800 (PST), Bill Beal > wrote: > >Caveat: I've only looked at Django, but not in enough detail to be > "expert"; my comment

Re: How to use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
16 -0800 (PST), Bill Beal > wrote: > >Caveat: I've only looked at Django, but not in enough detail to be > "expert"; my comments are based upon basic Python syntax/semantics (my > apologies to the developers, but I work better with printed > documentation and

Re: How to use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
;Bill of Lading #', max_length=50) - bol_type = forms.ChoiceField( - label=u'Type of B/L', choices=BOL_CODE_QUALIFIERS) It worked. But is there a better way? On Fri, Jan 20, 2012 at 10:44 PM, Bill Beal wrote: > Hi All, > > When I looked in the docs for how to f

How to use a DB table for choices=tuples in ChoiceField?

2012-01-20 Thread Bill Beal
Hi All, When I looked in the docs for how to fill in the "choices=" attribute for a ChoiceField in a form, I could only find static sets of tuples for examples. I need to use a table from the DB for the tuples. I thought I could make up the choice list myself from the table, but I'm getting a Name

Re: Please help with complex aggregation/annotation issue

2012-01-19 Thread Bill Beal
Each user nominates just one Messier number/image pair? Do you need to keep track of the users to verify that each one votes only once? On Wed, Jan 18, 2012 at 4:03 AM, Salvatore Iovene < salvatore.iov...@gmail.com> wrote: > Hi, > I apologize for the lousy title, but I really didn't know how to

Re: pseudo one-to-one

2012-01-16 Thread Bill Beal
n > in different tables. > > This problem isn't quite the same and I'm reluctant to keep the same > information in two places. There has to be a better way than multiple > tables. > > Thanks Jeff > > Mike > > > >> >> >> On Jan 16, 2012,

Re: Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread Bill Beal
t;edit_item"), > > in your template you can do this: > > {% for item in item_query %} > >Edit > > {% endfor %} > > Hope that helps! Named urls are the preferred DRY method too and so > easy to use! > > > On Jan 16, 8:04 am, Bill Beal wrote: >

Re: Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread Bill Beal
sz...@lexisnexis.at > Tel.: 00431 534521573 > Fax: +43 1 534 52 146 > > > -Ursprüngliche Nachricht- > > Von: django-users@googlegroups.com [mailto:django-users@googlegroups.com] > Im Auftrag von Bill Beal > Gesendet: Montag, 16. Jänner 2012 14:55 > An: Django users > Betr

Need "edit" and "delete" buttons on each line of a rendered table

2012-01-16 Thread Bill Beal
let me add. Is there a simpler way to know which line the submit came from, that works? Or even a complicated way that works? Bill Beal -- 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@

Re: pseudo one-to-one

2012-01-15 Thread Bill Beal
the parent, then modify the one-to-one child record. If necessary, duplicate the current one-to-one record in the many-to-one table. Does this make sense? Bill Beal On Mon, Jan 16, 2012 at 12:55 AM, Mike Dewhirst wrote: > I need a one-to-many to behave like a one-to-one. > > The parent

How many Django web pages does it take . . .

2012-01-06 Thread Bill Beal
build a particular kind of website using Django. Thanks for any help you can lend! Bill Beal -- 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 fro

Re: model for legacy table without primary key

2011-12-30 Thread Bill Beal
But it can't be a primary key if the values are not unique, right? The four fields are unique together, but not necessarily individually. Bill Beal On Fri, Dec 30, 2011 at 12:49 PM, akaariai wrote: > You could just define some arbitrary column as primary key. Primary > key doesn

Re: new tables missing from admin page

2011-12-20 Thread Bill Beal
___ > Life is short, Live it hard. > > > > > On 20 December 2011 23:32, Bill Beal wrote: > >> Hi all, >> >> I added some tables to models.py but they didn't show up >> when I logged in as admin. I knew already from harsh >> experience tha

new tables missing from admin page

2011-12-20 Thread Bill Beal
ngo 1.3, SQLite 3.7.2. What's the missing link? How can there be any file left that only has the old tables? Bill Beal -- 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