Re: Inlines defined before use?

2012-10-05 Thread Bill Freeman
There are a few special cases in which Django works hard to allow you to specify a string that will be looked up later. And you can use names in function and method definitions that will be defined by the time the function is called. But python does not, in general, support forward references. O

Re: Migrating a Django project to new platform

2012-10-05 Thread Bill Freeman
v0.97 of Django is compatible with python 2.4, but, as noted above the version of sorl (which is not part of the Django that makes that promise, but an external add-on) is not. You have a few choices: 1. You can tar (or zip) up the stuff in site-packages/sorl on the old box, to move to the new bo

Re: Disabling CSRF is not working.

2012-10-05 Thread Bill Freeman
I believe that I read somewhere that newer Djangos force the CSRF middleware even if it's not listed in MIDDLEWARE_CLASSES. You could dive into the middleware code to see how this happens, and come up with a stable strategy to circumvent it. Or you could just fix the necessary views and templates

Re: Best practice of subclassing default/3rd part apps?

2012-10-05 Thread Bill Freeman
If your changes are limited to templates, there is an easy standard approach: Set TEMPLATE_DIRS to something reasonable. Include the file system template loader in TEMPLATE_LOADERS *before* the app loader. (This is probably already true.) Copy the templates you need to change to the

Re: Django Admin asks password every operation

2012-10-05 Thread Bill Freeman
All urls match this. The regular expression says "any URL that starts from the beginning, no matter what follows. I suspect that you want 'r^$' Bill On Fri, Oct 5, 2012 at 2:15 PM, Stefano T wrote: > wait i may have spotted out the problem: > if i've an app, is th

Re: Disabling CSRF is not working.

2012-10-05 Thread Bill Freeman
Right you are. On Fri, Oct 5, 2012 at 6:20 PM, Ian Clelland wrote: > > > On Friday, October 5, 2012, Bill Freeman wrote: >> >> I believe that I read somewhere that newer Djangos force the CSRF >> middleware even if it's not listed in MIDDLEWARE_CLASSES. > &g

Re: Disabling CSRF is not working.

2012-10-09 Thread Bill Freeman
If you can't disable the middleware, you could consider marking the view with the csrf_exempt decorator from django.views.decorators.csrf (see https://docs/djangoproject.com/en/1.4/contrib/csrf/#utilities Bill On Sun, Oct 7, 2012 at 3:41 AM, Laxmikant Gurnalkar wrote: > Thanks, for the

Re: Best practice of subclassing default/3rd part apps?

2012-10-09 Thread Bill Freeman
On Sat, Oct 6, 2012 at 12:04 PM, Xun Yang wrote: > Hi ke1g! Thanks a lot for the explanation! I'm currently using both the > second and third approach for the problem, a utility app for a few things > and embedding "registration" app in my project (Seeing it hasn't updated for > years, I suppose i

Re: Email new users account details

2012-10-09 Thread Bill Freeman
Perhaps what you want to do is generate a password reset email for them. We know that you've set their email (or you couldn't mail them) and username (since that's required for an account?). There is no need to set a password. The reset email contains a link with a magic number in the urlpath, a

Re: Django Redirection Help

2012-10-17 Thread Bill Freeman
x27;. The trouble with that is that that the initial request for the page, without the form having been submitted, is also a 'GET'. The form submission can be something else, if you specify it in the method attribute of the form, but it defaults to 'GET'. (Often we use 'POS

Re: Recommend a way to add my own class into DjanGo

2012-10-17 Thread Bill Freeman
This is a python question, not specifically a Django question. I suggest that you work through the following tutorial: http://docs.python.org/tutorial/index.html On Wed, Oct 17, 2012 at 8:16 AM, Django Newbie wrote: > Hey guys, > > I want to create a custom class with methods I will be able

Re: Better feedback for admin users

2012-10-17 Thread Bill Freeman
more elegant way of doing this exist, either in Django's core already, > or using some package that makes it easier? > > Thanks, > > Daniele I'm a curmudgeon. I have to wonder how much work it is worth doing to make the admin interface something that it is not before i

Re: Does pagination has to load all objects before showing the pages?

2012-10-17 Thread Bill Freeman
Look for somewhere that you're evaluating the queryset. Pagination doesn't need to evaluate it, since it can slice it, which turns into a start and a limit on the database side. Beware of using len() on a queryset (evaluates, IIRC), use qs.count() instead (done on the DB). On Wed, Oct 17, 2012 a

Re: View for getting field based on value from another field

2012-10-18 Thread Bill Freeman
This may or may not be the cause, but spelling the variable in your loop exactly the same as the name of your model class feels hazzardous. Common practice would be to at least lowercase the name to use it as a variable referring to an instance. Bill On Thu, Oct 18, 2012 at 6:03 AM, Tomas

Re: xml dom (minidom) and python UPDATE

2012-10-23 Thread Bill Freeman
Have you tried simplified code on a simplified XML file, playing with it in the shell to get a feel for what you can and can't do? And built up from there. I'm sorry that I can't be more direct. I always reach for lxml and its elementTree emulation when I have XML to parse. Bi

Re: django registration custom backend

2012-10-27 Thread Bill Freeman
that attempts to create a new auth.User with that information and an unusable password (validation failing, for example, if the username already exists). If the form succeeds, the view triggers a password reset email for that user. All the hard parts are already in there, best to use them. Bill On

Re: Custom Admin Panel

2012-10-30 Thread Bill Freeman
vantage of the native autodiscover (though that registry of apps may not be a public interface, and if not, not guaranteed to have a painless upgrade path). In this case you are free to use some of the native views and replace others, if desired. Bill -- You received this message because you ar

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

2012-10-30 Thread Bill Freeman
ing with that class. You should still, of course, protect in the view against a disallowed user submitting the form -- we all know that bad guys can use firebug to modify the DOM, right? Another protective hack would be to omit the CSRF token when the form is read only. Bill -- You received this

Re: Joining querysets?

2012-10-30 Thread Bill Freeman
"join" (just in case you need it again in the future). If you mean concatenate, you might try '+'. If you mean something fancier, you may find help in the Q and F queryset operations documentation. Bill -- You received this message because you are subscribed to the Google Groups

Re: Template Inheriting in Apache server

2012-10-30 Thread Bill Freeman
It's a different style, and less capable, but look for documentation on server side includes (SSI). And it's not inheritance, but more like django's include template tag. Bill -- You received this message because you are subscribed to the Google Groups "Django users" g

Re: compiler

2012-11-02 Thread Bill Freeman
Surely the error message included a line number? Also, probably not related, but check that there is no whitespace after your line ending back-slashes. (Hint it is safer to put the opening triple quote before the backslash, and safer yet to put the triple quoted string in a pare of parentheses, t

Re: compiler

2012-11-05 Thread Bill Freeman
So the error printout doesn't give the line number of the offending return statement? On Mon, Nov 5, 2012 at 4:26 AM, Markus Christen wrote: > I have tryed your input, but i have always the same problem... i cant fix > it. it doesent work and i dont know why. (i have it in pycharm and there > are

Re: Django reloader fails to watch all the project files

2011-08-19 Thread Bill Freeman
Does your urls.py in the app in question import the view, or are you just referring to the view functions with strings? I'm not sure whether views.py is imported before the first time one of the urls is triggered in this case, but it would be a cheap check to add the import. On Thu, Aug 18, 2011

Re: Delete after specific date

2011-08-29 Thread Bill Freeman
Presuming deleted sometime on the day is close enough, write a management command that queries for items beyond their expiration and deletes them. Run this script nightly using cron, or you O/S's equivalent. Bill On Sun, Aug 28, 2011 at 3:09 PM, Goran wrote: > I have model with DateT

Re: Delete after specific date

2011-08-29 Thread Bill Freeman
You could always write your own cron equivalent functionality into your management command. But why keep an extra process just hanging out until the next delete event? If your on an O/S that has cron, then it's already running. Bill On Mon, Aug 29, 2011 at 1:56 PM, Goran wrote: > Tha

Re: django-admin.py not found

2011-08-30 Thread Bill Freeman
Not all methods of installing Django on all systems manage to make that file work as a command. You can use whatever file search tool your system provides to find the file. For example, almost everywhere but windows you can type, at a bash prompt. find / -name django-admin.py 2>& /dev/null A

Re: django setup.py access denies

2011-08-31 Thread Bill Freeman
So far today I've gotten two useless messages from you, and no spams. On Wed, Aug 31, 2011 at 4:24 PM, Elie Obeid wrote: > I know how to unsubscribe i don't need your link, I don't trust any of you, > i don't know why this is the official group, this is the official spammers > group > > -- > You

Re: Integrating django-honeypot with Pinax

2011-09-08 Thread Bill Freeman
ns (I believe that pinax creates an "apps" sub-folder that is suitably set up to be on the path, I don't remember if it managed to come before the pinax included apps, but if not, you can fiddle sys.path in settings.py). You can then put your version under your own revision control s

Re: How do I render a template variable inside a for loop, when the var is a dict and the key is forloop.counter

2011-09-08 Thread Bill Freeman
You might try a with tag to get the loop counter into a variable. On Thu, Sep 8, 2011 at 5:18 PM, Rami wrote: > Thanks. > But note that I'm not looking for the dict value in MyList, rather: I > loop on MyList and (trying to) retrieve the dict value from (another > var) BOOK_PHONE with key=loop.co

Re: Is Satchmo a good framework?

2011-09-22 Thread Bill Freeman
es the card number while displaying an item list and price summary, then contacts you on a back channel to say that the order has been paid, and redirects the customer to your designated thank you page. Keeping the credit card numbers off of the site makes PCI (payment card industry) compliance

Re: Calling Jython from python script

2011-10-05 Thread Bill Freeman
t you want the server waiting around until this script finishes? Bill On Wed, Oct 5, 2011 at 2:13 AM, Rohini Damle wrote: > Hello, > I am using python, mod-wsgi, django, apache combination. My views.py > script calls a set of python scripts. I also want to call some jython > scripts. F

Re: Easy question (I hope)

2011-10-07 Thread Bill Freeman
I think that you want: from poll import * in dummy/models/__init__.py On Fri, Oct 7, 2011 at 11:30 AM, bcrem wrote: > The separate models/ directory bit didn't work for me; maybe I'm not > understanding what you mean exactly?  Here's what I did... > > $ django-admin.py startproject dummy > $

Re: Doing a relationship lookup from within a model.

2011-10-20 Thread Bill Freeman
, I'd have status in the Orders model (and I'd be calling it Order, not Orders) ALSO. That's not denormalization. status in History is the state when the history event happended. status in Orders is the current status. Bill On Tue, Oct 18, 2011 at 10:52 AM, Jack Morgan wrote: >

Re: sprintf in python (not strictly django, but used all the time in django webapps)

2011-10-20 Thread Bill Freeman
On Thu, Oct 20, 2011 at 2:21 PM, Tim Chase wrote: > On 10/20/11 13:17, Cal Leeming [Simplicity Media Ltd] wrote: >> >> So, just out of curiosity, how many other people didn't realise you >> could do this: >> > print '%(language)s has %(number)03d quote types.' % \ >> >> ...       {"language":

Re: variables in a dict in a template

2011-10-31 Thread Bill Freeman
th it. > -- > regards > Kenneth Gonsalves When the going gets complicated, my simple mind reaches for python. Maybe a custom template filter? Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this gro

Re: Django Standalone Template

2011-10-31 Thread Bill Freeman
I think that you have too many "admin"s. Try: TEMPLATE_DIRS=('C:/Python26/Lib/site-packages/django/contrib/admin/templates') On Mon, Oct 31, 2011 at 3:30 PM, Stefan Lisowski wrote: > I appreciate the reply SmileyChris - > > On 10/30/2011 12:41 PM, SmileyChris wrote: >> >> Take a read throu

Re: Django Standalone Template

2011-10-31 Thread Bill Freeman
t using the app directories loader? On Mon, Oct 31, 2011 at 3:58 PM, Stefan Lisowski wrote: > On 10/31/2011 2:49 PM, Bill Freeman wrote: >> I think that you have too many "admin"s.  Try: >> >> >> TEMPLATE_DIRS=('C:/Python26/Lib/site-packages/django/contrib/adm

Re: Django Standalone Template

2011-10-31 Thread Bill Freeman
include a "templates" directory in your project root. On Mon, Oct 31, 2011 at 5:17 PM, Stefan Lisowski wrote: > On 10/31/2011 3:51 PM, Bill Freeman wrote: >> >> Try putting a comma at the end of the TEMPLATE_DIRS line. > > Hurrah, that did it. Thanks Mr. Freeman. &g

Re: initial data to Formset causing problem

2011-11-10 Thread Bill Freeman
Have you called form.is_valid() somewhere that you're not showing? On Wed, Nov 9, 2011 at 7:15 AM, Asif Jamadar wrote: > I’m assigning initial data to the field of each formset dynamically. But > when I’m trying to save that initial data it’s throwing “Key Error” in > cleaned data. Any solution?

Re: Serializing a model with a pickefield field

2011-11-10 Thread Bill Freeman
Since I don't see PickleField in the 1.3 Model Field docs, you probably have to supply more information in order to get an answer. If it has to do with python's pickle serialization, note that they are not generally promised to be compatible from on python version to the next, so you need to have

Re: Gut User Name Automatically

2011-11-14 Thread Bill Freeman
request.user.username (or probably better, use a foreign key reference to User in the record you are saving and say something like: product.created_by = request.user Only the id of the user record will be saved, but you can access any user information anytime you look at the record, e.g.; p

Re: How to specify a tuple in django models?

2011-11-17 Thread Bill Freeman
See unique_together in https://docs.djangoproject.com/en/1.3/ref/models/options/ On Thu, Nov 17, 2011 at 1:09 PM, Han Qi wrote: > Hi Djangoers: > > I am new to Django and I wonder how specify a tuple as unique key( or > primary key) > For example I have a table with rows (id, name, last_name) and

Re: How to trace the raw executed sql in Django

2011-11-18 Thread Bill Freeman
Have you tried pdb? On Fri, Nov 18, 2011 at 9:32 AM, Tom Evans wrote: > On Fri, Nov 18, 2011 at 1:25 PM, Kayode Odeyemi wrote: >> On Fri, Nov 18, 2011 at 12:04 PM, Tom Evans >> wrote: >>> >>> On Fri, Nov 18, 2011 at 8:20 AM, Kayode Odeyemi wrote: >>> > Hello friends, >>> > >>> > I'm having a d

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

Re: new tables missing from admin page

2011-12-20 Thread Bill Beal
Thanks. I don't remember doing this when I created the first set of tables. Does it happen automatically once? Or maybe I was mindlessly working from an example in a book. I'm a sorcerer's apprentice without a sorcerer. (There's a spell-checker pun in there somewhere.) B

Re: Coloring some particular lines in log files

2011-12-21 Thread Bill Freeman
So what is the nature of your problem? 1. That you don't know about regular expressions for detecting keywords in lines? (You might be able to just use the" in" operator on strings.) 2. That file (like object)s have a readline() method for processing a line at a time? 3. That you can't decide amon

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: Using STATIC_URL in CSS/JS files?

2012-01-03 Thread Bill Freeman
substitutions applied, and which places them in the folder from which your front end apache or ngniz will really serve them, which should probably be where runserver will look for them as well. You would have to remember to run this when you changed something. Bill On Tue, Jan 3, 2012 at 4:10 AM

Re: raw query placeholder "%(key)s" supported in django?

2012-01-03 Thread Bill Freeman
I have used this in a raw query. But it depends on the DB backend of Django. If I'm remembering correctly, it worked with PostgreSQL/psycopg2, but not with SQLite/whatever_back_end when I was using it. Bill On Sun, Dec 25, 2011 at 3:58 AM, ali alizadeh wrote: > hi. > > in psycop

Re: Using STATIC_URL in CSS/JS files?

2012-01-04 Thread Bill Freeman
Good point. But you can run into double braces in JS. On Tue, Jan 3, 2012 at 3:29 PM, Christophe Pettus wrote: > > On Jan 3, 2012, at 11:18 AM, Bill Freeman wrote: > >> This will be even morepainful if you use Django templates as the >> templating engine, since you will ha

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: not sure how to unpack a list within a tuple within another list inside the template

2012-01-12 Thread Bill Freeman
logic in python, and makes the template code more transparent. Bill -- 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 dj

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

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: 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

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: pseudo one-to-one

2012-01-16 Thread Bill Freeman
. 2. Have a many to many on self in the child (set) or a one to one (or just foreign key on self (list) so that the current child allows access to the history children. Or am I misunderstanding the problem. Bill On 1/16/12, Mike Dewhirst wrote: > On 16/01/2012 5:19pm, Bill Beal wrote: >&g

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: 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

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

2012-01-20 Thread Bill Beal
x27;m getting a Name Error: name 'scac_choicelist' is not defined at the marked line in my form: from django import forms from django.forms.fields import ChoiceField from myapp.models import * BOL_CODE_QUALIFIERS = ( ('OB', 'Ocean Bill of Lading (OB)'), ('B

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

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-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: get_FOO_display() for generic/variable choice fields

2012-01-24 Thread Bill Freeman
Maybe try: val = getattr(obj, 'get_%s_display' % field.name)() On 1/24/12, katstevens wrote: > I have a model ContactDetail with two choice fields, > ContactDetail.dialing_code and ContactDetail.country. These use the > standard tuples ('AU', 'Australia') and so on. > > I know I can use get_cou

Re: Django (or other) templates for untrusted users?

2012-01-26 Thread Bill Freeman
the available methods are limited so you can review them for safety. You could also automate checking of any tag libraries loaded against a list of those you have deemed safe. Of course, there could be additional vulnerabilities that aren't coming to mind. Bill On 1/26/12, graeme wrote:

Re: A problem about get_absolute_url()

2012-11-12 Thread Bill Freeman
ng city = bbbs[0].city In summary, something like: def get_absolute_url(self): if self.aaa.bbb_set.count() < 1: return 'some_fixed_url_for_when_a_Ccc_has_no_bbbs' # Or raise a 404 or whatever return '/%s/%d' % (self.aaa.bbb_set.all()[0].city.name, self.id) Bill -- You rec

Re: Form wizard step back

2012-11-13 Thread Bill Freeman
rhaps via the lack of a validated email address) whether registration has been completed. Then periodically run a daemon that queries for account creation attempts that are taking too long to complete, and delete them. Bill -- You received this message because you are subscribed to the Google Groups

Re: Form wizard step back

2012-11-13 Thread Bill Freeman
ccount. You can fill in any required fields with place holder values, and leave login disabled until you get your real minimum. Bill -- 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@g

Re: django - adding a counter for every ManyToMany field added

2012-11-14 Thread Bill Freeman
ps.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. >> >> >> -- >> You received this message because you a

Re: Whats the point of having dicts in templates if one cannot access them by key?

2012-11-14 Thread Bill Freeman
er that filters the dict, and takes the key as a quoted fight hand argument. You then cascade this for nested dictionaries. But if it were me, I'd probably see if I couldn't do it in the view, producing lists or tuples with the stuff in the order you need them. Bill -- You receiv

Re: need help with postgres installation and set-up for doing tutorials

2012-11-20 Thread Bill Freeman
On Mon, Nov 19, 2012 at 6:40 PM, Luisa Beck wrote: > Hi, I'm new to web development and I'm trying to get my mac set up for > doing the tutorials. > I installed postgres and pgAdmin III and set it up on the default port > (5433). I created a test database. Now when I try to open it on the local >

Re: Building an API to facilitate a mobile app

2012-11-20 Thread Bill Freeman
On Mon, Nov 19, 2012 at 7:08 PM, Amrutha Rajiv wrote: > Hey All, > I posted this on the django-tastypie group and I haven't got a response > yet. I hope there's someone here who can help me with this: > > I have a django project that is currently accessible through a web client. > What I need to d

Re: need help with postgres installation and set-up for doing tutorials

2012-11-22 Thread Bill Freeman
On Wed, Nov 21, 2012 at 8:58 AM, Luisa Beck wrote: > Thank you for your thoughts! I have a few follow-up questions: > > *The reason that I’m trying to figure out postgres is that I’m helping > some folks with a development project and they’re using postgres. I’m > trying to do the tutorial with t

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

Re: Questions about unicode

2012-11-26 Thread Bill Freeman
automatically being encoded based on the Encoding of the > request? Or I should take care of it explicitly? > > It should be automatic. At least I've never had to hand encode anything (except where the client, a SOAP encapsulated XML file, was untruthrul). Bill -- You received thi

Re: mod_wsgi using a subpath in combination with a middleware that calls django.core.urlresolvers.resolve is not working

2012-11-26 Thread Bill Freeman
27;re doing this to views that are outside of your control, so that you couldn't decorate them, maybe I see why you want to put the data on the user. If so, do check that the anonymous user accepts attribute setting. And I believe that request.user is a lazy object, so try referencing, say, reque

Re: Seeking pattern for building URLs with all query parameters intact

2012-11-26 Thread Bill Freeman
params, > }, context_instance=RequestContext(request)) > > What are better ways to handle this? > > > See: http://docs.python.org/2/library/urllib.html#utility-functions Particularly urlencode. You should be able to initialize a dictionary from request.GET, so long as none of t

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,

Re: admin foreign key issues

2012-11-29 Thread Bill Freeman
nally, how can I get it to display 'Categories' instead of > 'Categorys' > > Start by creating a __unicode__() method on each of your models that returns a string giving a better description of your object, say by using its 'name' field. If you are using p

Re: _set.all in template should be simple, wood and trees maybe?

2012-11-29 Thread Bill Freeman
You have specified related_name to the foreign key in HotTopic. Try either taking that out, or using newsletter_instance.letter_set.all . -- 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@googlegr

Re: admin foreign key issues

2012-11-29 Thread Bill Freeman
On Thu, Nov 29, 2012 at 12:30 PM, Larry Martell wrote: > On Thu, Nov 29, 2012 at 10:43 AM, Bill Freeman wrote: > > > > > > On Thu, Nov 29, 2012 at 9:10 AM, Larry Martell > > wrote: > >> > >> This is probably very simple, but I've never run i

Re: Internal Error after chaning SITE domain name and modifying html file...?

2012-12-07 Thread Bill Freeman
Or, is there still a Site object in the database whose Id matches the one specified in settings.py? (It depends on how you changed the site object.) On Fri, Dec 7, 2012 at 7:42 AM, Paul Backhouse wrote: > Is it a Site cache issue? > > > https://docs.djangoproject.com/en/1.4/ref/contrib/sites/#ca

Re: background task without celery

2012-12-10 Thread Bill Freeman
On Mon, Dec 10, 2012 at 12:44 PM, leonardo wrote: > Hi, > > I'm deploying a project to validation purpose in Heroku and not worth > paying for a worker to execute background task. > Is there a way to execute background task without celery + rabbitmq ? > > Thanks, > Another way to do this is with

Re: Implementing a monitoring system with django.

2012-12-11 Thread Bill Freeman
h works even if the user has javascript disabled, but loads the server a bit. You would probably want to encode a timestamp or generation sequence into the generated image path name, so that you wouldn't have to worry about cacheing, including in the browser, keeping you from showing a fresh

Re: Project path

2012-12-11 Thread Bill Freeman
and edit any front end proxy configuration that has absolute paths, such as for mod_wsgi.] I had put this stuff into a package that I could install in site-packages, and which had a singleton instance of a class initialized by passing it your __file__, but never got around to releasing it. Bill --

Re: Question on Multiple Database Connections

2012-12-13 Thread Bill Freeman
management stuff itself. You don't need transaction control on the database that you only read, I presume. Errors on that would still occur within a request and roll back the ORM transaction, so all should be good. As I say, a seat of the pants guess from someone who has never done two d

Re: Weird problem in common_settings include

2012-12-14 Thread Bill Freeman
"import pdb; pdb.set_trace()" at/near the top of one or the other file and single step your way along to explore how execution differs from your plan. Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this grou

Re: Weird problem in common_settings include

2012-12-14 Thread Bill Freeman
an put "import pdb; pdb.set_trace()" at/near the top of one >> or the other file and single step your way along to explore how execution >> differs from your plan. >> > > I'll try this > > thanks > > > Bill -- You received this message because you

Re: error message on runserver locally

2012-12-15 Thread Bill Freeman
py) and running "python manage.py runserver 8080", for example. The cd part is important, because python adds the current directory to sys.path (if it's not already there), and it needs to be there to import settings, among other things. (Running under WSGI, for example, you will ne

Re: Django back button issue after log-out

2012-12-17 Thread Bill Freeman
On Mon, Dec 17, 2012 at 5:14 AM, Ashish Sable wrote: > > I have written simple registration(login,logout) Django apps. > when i click on logout and then back button from browser > it shows me previous page. it should redirect me to login page. please help > > The back button in your browser just

Re: A question about the Middleware module "djangodblog" and its "DBLogMiddleware" class

2012-12-17 Thread Bill Freeman
I don't have djangodblog handy, but, at a guess try changing settings to use: *'djangodblog.middleware.DBLogMiddleware'* instead of: *'djangodblog.DBLogMiddleware'* -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: A question about the Middleware module "djangodblog" and its "DBLogMiddleware" class

2012-12-17 Thread Bill Freeman
On Mon, Dec 17, 2012 at 12:41 PM, dariyoosh wrote: > Hello there, > > > Thank you very much for your time and your attention to my question. > Your solution solved the problem ! > > It works pretty well now. :) > > Just one question, initially I had written > *'djangodblog.DBLogMiddleware'* > sim

Re: LDAP search results "disappear"

2012-12-17 Thread Bill Freeman
On Mon, Dec 17, 2012 at 1:03 PM, Kevin Cole wrote: > Also asked on StackOverflow > > > http://stackoverflow.com/questions/13918785/django-ldap-search-results-disappear > > Why in the code below, does the global *direktorie* return the correct > data in the *login()* debug template, yet when I try

Re: LDAP search results "disappear"

2012-12-17 Thread Bill Freeman
On Mon, Dec 17, 2012 at 1:58 PM, Kevin Cole wrote: > On Mon, Dec 17, 2012 at 1:57 PM, Kevin Cole wrote: > > > And here I'll display my ignorance about threading. I've done nothing > > specific to ask for threading. I wouldn't know how to thread even if I > > had a sewing machine. ;-) I'm using

Re: A question about the Middleware module "djangodblog" and its "DBLogMiddleware" class

2012-12-17 Thread Bill Freeman
On Mon, Dec 17, 2012 at 3:02 PM, dariyoosh wrote: > *Yes, I suspect so. Try the following: >> >> python manage.py shell >> import djangodblog >> djangodblog.__file__ >> >> (That's two underscores on each side of the word file). This will print >> a string that I expect will end with

Re: invalid syntax inside urls.py

2012-12-19 Thread Bill Freeman
', 'publication'}) >>> (url (r '^ admin /', include (admin.site.urls)), >>> ) >>> >>> []`s >>> >>> Maiquel Knechtel >>> >> >> And no spaces inside your regular expressions. (Though that&#x

Re: how to use jquery onclick event and django inclusion_tag/assignment_tag?

2012-12-19 Thread Bill Freeman
certainly different) url (but probably on the same server/django). Your urlconf must route this to a view that recognizes the AJAX request, and returns data (xml, json, ...) needed to define the content that you want to show, and returns it as a response. When this arrives back at the browser, a J

Re: Django community, is it active?

2012-12-19 Thread Bill Freeman
Particularly if it mellows them. Bill On Wed, Dec 19, 2012 at 1:56 PM, Nikolas Stevenson-Molnar < nik.mol...@consbio.org> wrote: > I think the bears should be free to drink the beer ;) > > _Nik > > > On 12/19/2012 6:25 AM, Cal Leeming [Simplicity Media Ltd] wrote: >

Re: A new kind of blocktrans that works with an unknown format string and a dictionary containing substitutes.

2012-12-21 Thread Bill Freeman
swering of the meat of your question to someone who has actually performed internationalization (other than to say that support must be enabled in settings, and that there is a collection of mappings that must be produced, as you surmise, in a per app sub directory structure, IIUC). However, presu

Re: Code guidance please review.

2012-12-26 Thread Bill Freeman
more than one place, then the separate manager methods are to be preferred. And note that you can use a queryset multiple times without having to recreate it. @login_required def history(request): thisPoints = Transaction.objects.filter(user=request.user) totalPoints = thisP

<    1   2   3   4   5   6   7   8   9   10   >