Re: Double arrays in models django

2010-04-09 Thread Bill Freeman
7;ll leave the three (or two, if matrices are numbered) table scheme as an exercise for you. Bill On Fri, Apr 9, 2010 at 3:50 AM, zimberlman wrote: > create table Rows > ( >  Id int primary key, >  Name text(255) not null > ) > create table Cols > ( >  Id int primary key, >

Re: CMS based Website using Django

2010-04-09 Thread Bill Freeman
The django-pages-cms app works pretty well. On Fri, Apr 9, 2010 at 11:34 AM, Pankaj Singh wrote: > Hi, I am a student. I have designed CMS websites using PHP and MySQL . I > want to complete my new project using Django ( excited about it). > I wanted to know the basic steps that I should follow.

Re: CMS based Website using Django

2010-04-09 Thread Bill Freeman
Yeah, I don't think that they're quite set up to just easy_install. It took a bit of reading, but there was enough information on their home page to know what else you had to install, If I recall correctly (it's been a while). You may want to also include django-tinymce so that your client can ha

How do you rollback a transaction outside the context of a request?

2010-04-14 Thread Bill Freeman
n.rollback() doesn't work, and neither do several other guesses. I presume that the view decorators won't do it since this isn't a request coming through the middleware to a view function. Can someone tell me the appropriate incantations? Bill -- You received this message becau

Re: how I can get the proper get_absolute_url?

2007-06-30 Thread Bill Fenner
ay).zfill(2) > > s = str(self.Slug) > > return ('entry_detail', None, {'username': User.username, 'id': > > self.id}) > > get_absolute_url = permalink(get_absolute_url) > >

Re: Building forms by hands

2007-07-07 Thread Bill Fenner
See http://fenron.blogspot.com/2007/06/custom-radio-field-rendering-with.html . 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@

Re: queryset cache

2007-08-23 Thread Bill Fenner
ase_fields['somefield'].widget.choices = form.base_fields['somefield'].choices after modifying the queryset of a ModelChoiceField. The widget has a copy of the original QuerySetIterator that points to the old QuerySet, so you have to give it an updated copy. http://fenron.blo

EARN$1000-$25000 per week

2008-06-04 Thread bill gates
EARN$1000-$25000 per week SIMPLE ONLINE SURVEY WORK AT JUST 2 HOURS ONLY I EARN DAILY AROUND $350 CREATE FREE ACCOUNT START YOUR EARNINGS *** http://www.AWSurveys.com/HomeMain.cfm?RefID=souravudaya http://www.AWSurveys.com/

Re: How do you get at a RadioFieldRenderer object from a template? (newforms)

2007-05-07 Thread Bill Fenner
case of having other form elements that go with each radio button (e.g., "modify" has a ChoiceField of things to modify next to it). Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Re: Something like an "all in" for filter of related set

2007-10-04 Thread Bill Dawson
On Thu, 2007-10-04 at 16:38 -0400, Malcolm Tredinnick wrote: > On Thu, 2007-10-04 at 20:08 +0000, bill wrote: > > Hi folks, > > I've reviewed the db api documentation page, and I'm pretty sure it > > didn't have an example that would help me with this request.

Re: Regstration module "lost password"

2007-10-08 Thread Bill Fenner
by preemptively changing their pasword (and emailing them the new one). This operation should really email a challenge URL which, if visited, leads to a "set new password" page. Bill --~--~-~--~~~---~--~~ You received this message because you are subscr

Re: Regstration module "lost password"

2007-10-09 Thread Bill Fenner
security problems. He alternative is to exchange a handshake before changing the password. Don't jump immediately to "must store plain text passwords". Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Handling legacy single-row tables

2007-10-24 Thread Bill Fenner
id column. I'm just wondering if anyone can think of a trick that doesn't require modifying the database structure. Thanks, Bill --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

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: Django setup on Win7 - can't import some things

2012-02-13 Thread Bill Freeman
Are you sure that you don't have something like: ... urlpatterns = patterns('polls.views', ... instead of the empty string first argument to patterns that you show? On 2/13/12, Bob Carlson wrote: > I'm now on the 1.2 tutorial, but a similar error message is coming up. The > urls.py file is > >

Re: Problem loading integer data into database using fixture

2012-02-16 Thread Bill Freeman
Well, I don't know yaml, but if you are in a place where you don't have to quote: Arron then I'd expect everything to be strings. Is there a yaml.dump that you can apply to a model with strings and integers to see how it thinks they are distinguished? On 2/16/12, Gchorn wrote: > Hello All,

Re: Problem loading integer data into database using fixture

2012-02-16 Thread Bill Freeman
ames at once can I? Do I just need to give write-access to > the database username as well? If so how do I do that (I know we're > veering away from Django here, sorry)? > > On Feb 17, 1:13 am, Bill Freeman wrote: >> Well, I don't know yaml, but if you are in a place wh

Re: Problem loading integer data into database using fixture

2012-02-17 Thread Bill Freeman
Also, see pg_hba.conf in the postgres documentation. There can be rules as to who can connect at all, let alone who needs a password. On 2/17/12, Sebastian Goll wrote: > On Thu, 16 Feb 2012 22:18:03 -0800 (PST) > Gchorn wrote: > >> Unfortunately, that doesn't seem to be the case. I have the d

Re: passing multiple query sets into a url pattern

2012-02-19 Thread Bill Freeman
view, so don't expect it to work with the generic views, since they don't expect such an argument. If you are writing your own view function (or class), you could arrange to accept such an argument. If the view is only used with that one url pattern, however, why not just specify the qu

Re: Division within django templates

2012-02-19 Thread Bill Freeman
Yes. Use a model method. Don't do serious calculation in templates. On Sun, Feb 19, 2012 at 11:03 AM, Jason <1jason.whatf...@gmail.com> wrote: > Hi there, > > i'm currently using the widthratio tag for division within a django template > as detailed > here: http://slacy.com/blog/2010/07/using-dj

Re: template tag that iterates over list with for loop

2012-02-20 Thread Bill Freeman
Perhaps a filter rather than a tag. You will need to provide input for the filter, but it can ignore it. So: {% for a in random_variable|list_print %} Bill On 2/19/12, brian wrote: > Is it possible to create a template tag that will create a list that a > for loop can loop over? I

Re: Production server on windows

2012-02-21 Thread Bill Freeman
Sorry, but I have to ask the obligatory question: why Windows? But apart from that, I suggest that even on Windows you should use Apache and mod_wsgi. It'f fast, effective, free (as in beer and as in speech), widely used (meaning it's easier to get help for this configuration on the w

Re: Calling "manage.py shell" from the Python Shell in Tutorial Part 1

2012-02-22 Thread Bill Freeman
1. There is more information in that traceback (that you didn't include) that could help you find your indentation error. 2. It is quite useful, presuming that you are also a python beginner, to do the tutorial at: http://docs.python.org/tutorial/index.html Bill On Tue, Feb 21, 2012

Re: How do i view json data returned from django

2012-03-01 Thread Bill Freeman
On Thu, Mar 1, 2012 at 8:29 AM, Shawn Milochik wrote: > On 03/01/2012 07:48 AM, Stanwin Siow wrote: >> >> Hello, >> >> I want to view the actual json data from django view, is there anyway i >> can do that before i parse it into jQuery? >> > > > Assuming that you have a dictionary named "return_da

Re: Problem with my view or template (DRIVES ME NUTS)

2012-03-05 Thread Bill Freeman
If that's your complete view, you've forgotten to return an HTTPResponse object. Since action='.', it appears that you are using the same view to get the form and to post (which is fine), but each case must return a response for the prowser, presumably rendered from the same template. The render_

Re: built-in-views trouble

2012-03-10 Thread Bill Freeman
I would expect ViewDoesNotExist to not be sensitive to the template. It sounds like the urlconf is specifying a view function that does not exist (at least in the way and in the place that it is specified). On Sat, Mar 10, 2012 at 3:07 PM, Scott Macri wrote: > Even explicitly setting the templat

Re: built-in-views trouble

2012-03-10 Thread Bill Freeman
recognizes the pdb print outs and puts up the corresponding file with a pointer on the current line. Perhaps your favorite IDE has a similar capability. It makes single stepping along and knowing the context (and thus what variables are interesting) a lot more pleasant than just looking at the pdb o

Re: how to use Django ORM in standalone script

2012-03-12 Thread Bill Freeman
elevant apps, and it will typically be easier to pull the whole thing than to tease out just enough. If your project is in a suitable VCS, that is a good way to make the copy. Bill On 3/12/12, H.T. Wei wrote: > Hi, > > If anyone can suggest what is the best way to use Django ORM in standalo

Re: response and post in django

2012-03-12 Thread Bill Freeman
stener (to indicate that the payor's payment method is valid), or that it would be in your response to that POST to tell paypal that this looks like a valid payment (the payment amount or item quantities haven't been hacked, etc.). But you could be right. Bill On 3/12/12, hack wrote:

Re: response and post in django

2012-03-12 Thread Bill Freeman
nding the API correctly? I would expect the >> "VERIFIED" to either be in their POST to your listener (to indicate >> that the payor's payment method is valid), or that it would be in your >> response to that POST to tell paypal that this looks like a valid >

Re: response and post in django

2012-03-12 Thread Bill Freeman
cate >> that the payor's payment method is valid), or that it would be in your >> response to that POST to tell paypal that this looks like a valid >> payment (the payment amount or item quantities haven't been hacked, >> etc.). >> >> But you could be r

Re: newbie django hosting question

2012-03-13 Thread Bill Freeman
re also more restricted than you would be in a VPS. Bill On 3/13/12, NENAD CIKIC wrote: > I now need to put on web the small project i have developed. To test > and to skill me on linux, I have created virtualbox ubuntu VM and > deployed the project and used nginx to serve it (all fro

Re: urllib2

2012-03-15 Thread Bill Freeman
Are you using the development server? If so, how about sticking a pdb.set_trace() at line 510 of /System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/urllib2.py to see what you're really getting? On 3/13/12, hack wrote: > Yes, I added @csrf_exempt and not I get a 500 error inst

Field lookup for "field has at least two characters"?

2012-03-20 Thread Bill Freeman
I'm planning on using: xxx__regex='..' But is there a better way to select only instances where xxx (a CharField, not null) has at least two characters? Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: [1.4c2] The storage backend of the staticfiles finder doesn't have a valid location.

2012-03-22 Thread Bill Freeman
On Thu, Mar 22, 2012 at 2:22 AM, Micky Hulse wrote: > I must be overlooking something obvious. My error: > > > > The static files collect just fine (currently, I just have admin files > to collect); the above error just shows up every time I run > collectstatic. > > Set

Re: Doing something silly, I'm sure

2012-03-30 Thread Bill Freeman
Are you in debug mode so that the stack trace is displayed (on the development server)? Have you looked at the local variables in the trace to see what template it is trying to find? Are the permissions on the template such that django can read it? On the development server, pdb.set_trace() is y

Re: Questions about UnicodeDecodeError

2012-04-01 Thread Bill Freeman
If you can, switch to UTF-8 in the db. Web traffic can arrive in a variety of encodings, and while the headers tell the server how to make unicode out of it, but by having the db set for ASCII, you limit what you can store (since not all unicode characters can be converted to ASCII. On Fri, Mar 3

Re: Questions about UnicodeDecodeError

2012-04-02 Thread Bill Freeman
9818 > Email: ali.mes...@fireeye.com > > > Next Generation Threat Protection > http://www.FireEye.com <http://www.fireeye.com/> > > > > > > > > On 4/1/12 3:04 PM, "Bill Freeman" wrote: > >>If you can, switch to UTF-8 in the db. Web traffic

Re: Reloading a project without restarting Python

2012-04-08 Thread Bill Freeman
On Sat, Apr 7, 2012 at 2:32 PM, Tobia Conforto wrote: > Hi all > > I'm developing a portlet bridge in Jython, to enable developing J2EE > portlets in Django, and I need to include a reload-on-code-change > feature, to aid in development. > > Unfortunately, the way django.utils.autoreload works, by

Re: Python Library for Audio Files - Clipping mp3/ogg formats

2012-04-12 Thread Bill Freeman
There is pysox. I haven't used it, but bindings for libsox shouldn't be rocket engineering (rockets haven't been science in a long time). On 4/11/12, BGMaster wrote: > Hi, > > I know this isn't a django specific question, but does anyone know of > a good python library or module for clipping/cut

Re: Help - ImportError: No module named django.core.management

2012-04-17 Thread Bill Freeman
stacktrace): import sys from pprint import pprint pprint(sys.path) If this doesn't include the site-packages or dist-packages directory where Django is installed, figure out why. (Are you playing with the PYTHONPATH or PYTHONHOME environment variables?) Bill On 4/17/12, Michael Lewis wrote:

Re: restarting a django development server

2012-04-23 Thread Bill Freeman
You can "touch" one of the .py files. That is, cause its last modified date to become newer than that of its .pyc file by making it the current time. I suspect that you can do this (assuming that you don't want to run the *nix "touch" command as a sub process, or don't have it because you are on

Re: (List objects(Recently Added - Most Common

2012-04-26 Thread Bill Freeman
On 4/25/12, mohamed wagdy wrote: > please i want a help > > I have some object stored in a databaseand i want to > make List of this object (Recently Added object - > and > Most Common) And I want a better description of what you are trying to do. For recentl

Re: Django UnicodeEncodeError in errorlist

2012-04-26 Thread Bill Freeman
On 4/26/12, Andrei wrote: > Hi, > > I am having an issue with rendering Django's ErrorList if one of my error > list items is unicode. When Django renders my errorlist > > {{ form.non_field_errors }} > > it runs the following > code

Re: (List objects(Recently Added - Most Common

2012-04-26 Thread Bill Freeman
the database to django. On 4/26/12, mohamed wagdy wrote: > recently mean Nadded > > and > > most common it meanthe N object that the personused > > say .i makean event system and i want to know > most common event in my

Re: 'ascii' codec can't encode characters in position 36-38: ordinal not in range(128)

2012-05-03 Thread Bill Freeman
pg' You might try reaching in and encoding the filename yourself, to utf-8, or maybe url encoding it. If this is happening in the admin, then the easiest approaches may be to use a customized field, or a field with a customized widget (you can probably sub-class, rather than going from scratc

Re: jquery form post without refresh the page

2012-05-03 Thread Bill Freeman
AJAX You may require a separate view, but maybe not. If you search for jQuery and AJAX there should be samples. On 5/3/12, Min Hong Tan wrote: > is there any sample that i can refer to do the ajax style form post > without refresh the whole page? > or backend form.save validation without refres

Re: How to get caller function from a function

2012-05-04 Thread Bill Freeman
about all the clickable elements in those fine stactraces that Django prints in debug mode error messages? (Many folks don't realize that you can click on the code line in order to see it in context.) Also, if you stick: import pdb;pdb.set_trace() at the interesting point in your code

Re: template logic vs AJAX newbie seeks advice

2012-05-04 Thread Bill Freeman
tarting to ebb), or curmudgeons like me who have to be persuaded to unblock JavaScript for your site. 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 unsubscr

Re: How to

2012-05-15 Thread Bill Freeman
ualenv Actually makeing a virtualenv once you have the tool is a separate question, which you did not ask. Bill On 5/15/12, Sanjay M wrote: > I want to create a virtualenv pip, but I don't know how to Install > virtualenv by running pip install virtualenv? Can anyone explain

Re: Django virtualenv, pythonpath issues

2012-05-15 Thread Bill Freeman
wsgi how to set the PYTHONHOME environment variable for its pythons, which should identify your virtual environment (set it to the directory containing your ve's lib and bin directories). This allows for the best match between the paths seen under modwsgi and those seen under the development ser

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

A signal, or equivalent, for when all apps are loaded?

2012-05-29 Thread Bill Freeman
e docs, and there is no evidence of sending one in django.db.models.loading.AppCache. Is there a right way to get something called after all the models have been imported? (Django 1.3) Bill -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Python IDLE

2012-05-30 Thread Bill Freeman
have to add plugins to make it really Python friendly (emacs comes with a python mode). At a minimum, you should configure vim to always insert spaces when you hit the TAB key. Without further information, Python will interpret tab characters as going to the next every 8 column tab stop, while many

Re: A signal, or equivalent, for when all apps are loaded?

2012-05-30 Thread Bill Freeman
On Tue, May 29, 2012 at 7:35 PM, Russell Keith-Magee wrote: > On Wed, May 30, 2012 at 4:42 AM, Bill Freeman wrote: >> I continue to struggle with occasional circular import problems >> (caused by a combination of haystack, filebrowser, and a model which >> both has a se

Re: How to generate secure passwords

2012-05-30 Thread Bill Freeman
permit him to change these fields. Instead they are set by you payment system. The user then identifies himself with a standard django username and passowrd, and the controlled page views check the (appropriate to the section) expiration date. This seems better to me than changing the password at r

Re: Python IDLE

2012-05-30 Thread Bill Freeman
e PyCharm a go. It's everything IDE should be >>> and loves django. >>> >>> On 30 May 2012 23:40, Bill Freeman wrote: >>>> >>>> On Mon, May 28, 2012 at 12:25 PM, Dennis Lee Bieber >>>> wrote: >>>> > On Mon, 28

Re: Python IDLE

2012-05-30 Thread Bill Freeman
> >> >> Am Mittwoch, 30. Mai 2012 15:59:13 UTC+2 schrieb somecallitblues: >> >>> >> >>> You seriously have to give PyCharm a go. It's everything IDE should be >> >>> and loves django. >> >>> >> >>> On 30 May 2012 23:40, Bi

Re: Python IDLE

2012-05-30 Thread Bill Freeman
is the stuff. > > Also have python open python files; the easy way: > > Right click any pyton file->Left Click->Open > With->Browse->c:\pythonX\bin\python.exe, for example->make sure you tick > "always use the selected program to open this kind of file"

Re: Django/Python Circular model reference

2012-06-01 Thread Bill Freeman
want to allow multiple answers to a question, and multiple follow-up questions to an answer, just skip the count() check (or constraint). Bill On 6/1/12, Simone Federici wrote: > class Question(models.Model): >title = models.CharField(max_length = 50) >response = models.

Re: PyPm / Django 1.4?

2012-06-02 Thread Bill Freeman
Have you considered running under a virtualenv and pip installing exactly what you need? On Fri, Jun 1, 2012 at 5:28 PM, Aaron C. de Bruyn wrote: > I am not a Windows developer--but I was recently asked to port a very small > Django app (so it could be run locally using the dev server) on Windows

Re: Is this requirement feasible with django

2012-06-03 Thread Bill Freeman
w creating a form-like object.) So, what do you consider simple. Someone else may have better suggestions. 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

runserver and the tty echo flag

2012-06-05 Thread Bill Freeman
uot;echoed" the text into the window long before it is sent to the pseudo tty.) I would expect most programs that fiddle with the tty configuration to restore it on exit. So, is this intentional, or a regression that I should try to help find and fix? Bill -- You received this message becaus

Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-22 Thread Bill Torcaso
it__.py", line 105, in get_default_username default_username = get_system_username() File "/Library/Python/2.7/site-packages/django/contrib/auth/management/__init__.py", line 85, in get_system_username return getpass.getuser().decode(locale.getdefaultlocale()[1]) TypeError: decod

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-24 Thread Bill Torcaso
On Friday, June 22, 2012 3:46:42 PM UTC-4, Bill Torcaso wrote: > > > Hi, > I'm working through the tutorail. Part 1 was fine, and part 2 shows me > the site with the light blue background. I proceed to make my first app, > 'djangotest'. > >1.

Re: Installing via Tutorial Part 2 / MacOSX / Can't create a superuser due to locale() problem.

2012-06-24 Thread Bill Torcaso
eated problem on Macs. Whoever maintains the tutorial might consider mentioning this, if only in a footnote. Cheers, -- Bill On Friday, June 22, 2012 4:22:22 PM UTC-4, Kurtis wrote: > > Did you get an opportunity to type anything after "yes"? Or did it > just blow up at that

Re: javascript in django template not executed when request is sent via ajax

2012-06-30 Thread Bill Freeman
curl (or its windows equivalents) will tell you exactly what django sent, as would poking around from a suitably placed pdb.set_trace() On Fri, Jun 29, 2012 at 8:42 PM, Larry Martell wrote: > On Fri, Jun 29, 2012 at 4:54 PM, Jani Tiainen wrote: >> I meant that if for some reason Django sends inc

Re: settings and constants on a reusable app

2012-06-30 Thread Bill Freeman
Support an additional variable MY_APP_USE_OTHER_CONSTANT (MY and MY_APP, are, I hope, not the prefixes you are actually using), which defaults to False and which the project settings file can override to True. On Fri, Jun 29, 2012 at 9:06 AM, Marc Aymerich wrote: > On Fri, Jun 29, 2012 at 11:08 A

Re: Conditionals in Templates

2012-07-03 Thread Bill Freeman
The obvious ways are: 1. Provide a model method that returns a string representing the type of the instance, compare against that 2. Decorate the instance with an attribute giving the name of the type as a string... Can't change the instance (I really think you can still decorate it in the view,

Re: Raise 404

2012-07-03 Thread Bill Freeman
We can't answer, since we don't know what page you're seeing. We can't access your localhost:8000 to check. On Tue, Jul 3, 2012 at 3:38 PM, Smaran Harihar wrote: > Hey Djangoers, > > I am on my tutorial 3 and I was on this topic. > > And now if I try to access http://localhost:8000/polls/1/ it g

Re: values() and order_by()

2012-07-03 Thread Bill Freeman
is two database queries, but unless you are seeing a performance issue that you've traced to the fact that this is more than one query, this code is a heck of a lot more maintainable than trying to make it happen in one. Bill On Tue, Jul 3, 2012 at 6:51 AM, J. Javier Maestro wrote: &g

Re: Dumpdata and serialization issues

2012-07-03 Thread Bill Freeman
I think that you have to dumdata one or both of the models at the ends of the many to many, and the join table will come along for free. On Tue, Jul 3, 2012 at 3:21 PM, natasha.ba...@utoronto.ca wrote: > Hi All, > > I'm trying to dump the contents of a table which is the mapping for a > many-to-m

Re: Dumpdata and serialization issues

2012-07-03 Thread Bill Freeman
In fact, I think dumpdata takes an app name, not a table or model name. On Tue, Jul 3, 2012 at 5:54 PM, Bill Freeman wrote: > I think that you have to dumdata one or both of the models at the ends > of the many to many, > and the join table will come along for free. > > On Tue, J

Re: values() and order_by()

2012-07-08 Thread Bill Freeman
ave tried, so I have to guess at what you are passing to value() or even which model (User or Visit) you begin from. (I also don't understand why you have two foreign keys from Visit to User, but that is probably not important.) Bill On Wed, Jul 4, 2012 at 8:15 AM, J. Javier Maestro wrote: &

Is Tutorial / Part 4 wrong? (or is it me?)

2012-07-16 Thread Bill Torcaso
Django is great, and the tutorial is great. I'm having a problem at the very end of tutorial-4. I try to use generic views, and I get an error when I Redirect from the POST request in vote() to the Results page. Details below. The tutorial code says to put this in my urls.py: url(r'^(?P

Re: Android app that can post to a django server

2012-07-20 Thread Bill Freeman
e corresponding cookies? If the APP isn't doing simple HTTP, then, as the other gentleman suggested, some purpose built API, like a REST scheme (tastypie, djangorestframework, or the ;pmg om the tooth and apparently no longer supported piston), or even SOAP (not for the faint of heart) woul

Re: Newbie question about accesing my development Django instance from other computers in my LAN

2012-07-27 Thread Bill Freeman
particular OS to help check for that. Bill On 7/27/12, Miguel Lavalle wrote: > Thanks. It didn't work, though. In the development laptop I started the > server with python manage.py runserver > 192.168.1.116:8000<http://192.168.1.116:8000/myapp/> > > > In the lapto

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

2012-08-01 Thread Bill Freeman
I'm going to assume that we're talking about a single checkbox (an "I agree to the terms" checkbox). First, remember that unchecked is not the same as "blank", it is "false", so "blank=False" is subject to interpretation. There are two places where you might insist that the box be checked: in the

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

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

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: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-22 Thread Bill Freeman
f so, then you may want to add such to the views you want to leave uncached. An alternative is to add a middleware that does this, which will incur the lookup costs for all views. Bill On Tue, Aug 21, 2012 at 1:27 PM, Alexis Bellido wrote: > Hello, > > I am working on a Django 1.4 proj

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: CACHE_MIDDLEWARE_ANONYMOUS_ONLY does not work if user is not printed by view or template

2012-08-24 Thread Bill Freeman
created on >> demand >> (is a python "property"). The intent, I presume, is to not bother >> fetching the session, >> etc., unless it is used, as an optimization. >> >> You should find that simply referring to request.user in the view >> helps. If

Re: Using the CSRF token with two views

2012-09-04 Thread Bill Freeman
Of course, JavaScript will be involved. You can probably get the token from the cookies, but you could also add code to your (first) template to set a JS variable to the token. Then, when you (on the client side) get the form to display, you can insert the appropriate hidden element. Bill On

Re: 'str' object is not callable in base.py

2012-09-04 Thread Bill Freeman
My best guess is that, for whatever reason, 'timetable_view' in your url conf has not been converted into the view function. Try actually importing the view in urls.py and putting it as the target of the pattern *without* the quotes. If this works, then figuring out whether you needed 'app_name.ti

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Bill Freeman
Are you certain that you don't have an absolute path lurking somewhere in your code? On Fri, Sep 7, 2012 at 3:36 PM, William Hart wrote: > Hi all, > I've made a post on stack overflow, but I'm not sure if this is some kind of > weird bug or just something silly I'm doing. (see > http://stackover

Re: Virtualenv changes url reverse behaviour

2012-09-07 Thread Bill Freeman
Have you tried it without the quotes? None of the examples in the docs (https://docs.djangoproject.com/en/1.4/ref/templates/builtins/#url) use quotes. (Which, in turn, probably means that you can't use a variable there.) On Fri, Sep 7, 2012 at 7:46 PM, William Hart wrote: > Hi, > Thanks for the

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

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: questions about generating static web page.

2012-09-25 Thread Bill Freeman
It sounds a bit like you want a profile app. It's model holds those things beyond what is already in auth User, which could include one or more text fields, perhaps using TinyMCE or markdown. There is plumbing in Django whereby if you specify such a model in settings.py it will get attached OneTo

Re: sqlite datetime issue with django

2012-09-25 Thread Bill Freeman
When django reads the data back, does it reconvert it to your timezone? If so, why is it a problem that it is stored as UTC in the database? On Tue, Sep 25, 2012 at 2:19 PM, puneet loya wrote: > Hi, > > I m having problems with sqlite insertion. > > When i enter datetime object using django into

Re: questions about generating static web page.

2012-09-25 Thread Bill Freeman
I, and probably others, would need a more detailed description of these tables and how they are to be used, before we could offer help on them. On Tue, Sep 25, 2012 at 3:22 PM, bruce wrote: > Thanks!! > Yes. This is exact what I did. > Actually, I finish this in the admin template. > But my quest

Re: model field not null

2012-09-30 Thread Bill Freeman
l NOT prevent storing an empty string. Assuming that your database supports it, you could write a "trigger" or "constraint" that checks for non blank and fails the transaction otherwise. But, in so far as I know, Django provides no help in creating this constraint. Bill On

Re: Migrating a Django project to new platform

2012-10-03 Thread Bill Freeman
stall stuff in the python that mod_wsgi is using be default, and to arrange for any manage.py actions you need to run with that python. Bill On Wed, Oct 3, 2012 at 7:51 AM, Elliot wrote: > Hi all, > > I would like some help or advice migrating an old Django project to a > different pl

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