Re: design problem..how to store web page's data for later comparison

2010-10-11 Thread Jonathan Barratt
just compress\decompress the files, text compresses very well. It'll add some processing overhead for sure, but there's no magic bullet that's not going to cost you some form of resource or another. Just limit the number of versions that can be kept and remove the old-ones on a

Re: how to avoid error opening a url

2010-10-10 Thread Jonathan Barratt
repend 'http' to every urlstring > before trying to open it using urlopen? Otherwise yes, I'd use something like: if not url.startswith('http://'): url = 'http://' + url I'm a Django newbie myself, however, so someone else may chime in with

Re: trouble creating first project

2010-10-10 Thread Jonathan Barratt
Hi Phil, On Mon, Oct 11, 2010 at 8:47 AM, Phil wrote: > When I run 'django-admin.py startproject myproject' I get back an > error saying 'django-admin.py: command not found'. > Run the following from a shell prompt: ls -l `which django-admin.py` and let us know

Re: Error

2010-10-01 Thread Jonathan Endersby
Hi You have a function or method that is calling itself. Something like this: def foo(): print "fun" bar = foo() print "never going to happen" J. On 01 Oct 2010 9:49 PM, "Tsolmon Narantsogt" wrote: > So how fix it ? > > On Sat, Oct 2, 2010 at 1:37 AM, Brandon Taylor wrote: > >>

Re: Not calling clean() properly

2010-09-14 Thread Christos Jonathan Hayward
Thank you. On Tue, Sep 14, 2010 at 3:01 AM, Daniel Roseman wrote: > On Sep 13, 10:50 pm, Christos Jonathan Hayward > wrote: > > Other attempts to write a clean that would run a print statement and then > > call to_python(), validate(), and run_validators() did not result

Re: Not calling clean() properly

2010-09-13 Thread Christos Jonathan Hayward
alled. On Mon, Sep 13, 2010 at 3:44 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I have a TextURLField defined below, and I am trying to get the clean() to > prepend http:// to all entries that do not contain a ':'. In other words, > if someo

Not calling clean() properly

2010-09-13 Thread Christos Jonathan Hayward
self.validate(value) self.run_validators(value) return value def get_internal_type(self): return u'TextField' def __init__(self, *arguments, **keywords): models.URLField.__init__(self, *arguments, **keywords) Any suggestions? -- [image: Christos

Gotcha with ?generic foreign keys?

2010-09-13 Thread Christos Jonathan Hayward
= models.TextField(null = True, blank = True) def format_timestamp(self): return directory.functions.format_timestamp(self.timestamp) Any comments on how either I am misunderstanding how to use GenericForeignKeys, or how I might otherwise be clobbering one model type with another?

Re: Filter for non-True NullBooleanField

2010-09-12 Thread Christos Jonathan Hayward
Thanks, and noted for the future. I went with a regular BooleanField defaulting to False. On Sat, Sep 11, 2010 at 7:08 AM, Preston Holmes wrote: > > > On Sep 10, 2:43 pm, Christos Jonathan Hayward > wrote: > > P.S. Setting: > > > > .filter(is_invisible__in

Re: Filter for non-True NullBooleanField

2010-09-10 Thread Christos Jonathan Hayward
P.S. Setting: .filter(is_invisible__in = [False, None]) is not working as intended; I seem to be getting no matches when I should be getting matches. On Fri, Sep 10, 2010 at 4:19 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > How can I filter for instanc

Filter for non-True NullBooleanField

2010-09-10 Thread Christos Jonathan Hayward
How can I filter for instances having a NullBooleanField that is not True (i.e. is either False or a null)? -- [image: Christos Jonathan Hayward] <http://jonathanscorner.com/> Christos Jonathan Hayward, an Orthodox Christian author. Author Bio <http://jonathanscorner.com/author/>

Re: Breaking many-to-many connections

2010-08-31 Thread Christos Jonathan Hayward
I finally pinned down the problem; it was in an unrelated area. Thanks, On Tue, Aug 31, 2010 at 5:59 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I have an Entity which has a many-to-many field "tags" to Tags. I'm trying > to pin down

Breaking many-to-many connections

2010-08-31 Thread Christos Jonathan Hayward
.objects.get(id = int(search.group(2 entity.save() Is the code above, with the .tags.remove() code, enough, or do both the Entity and the Tag need to have a call to break the link? -- [image: Christos Jonathan Hayward] <http://JonathansCorner.com> Christos Jonathan

Re: Error working on many-to-many lookups

2010-08-26 Thread Christos Jonathan Hayward
Thanks. On Thu, Aug 26, 2010 at 9:08 AM, Alex Robbins wrote: > Jonathan, > > Pretty much any time you use __exact='text', you could use > ='text' instead. I think the orm treats those two cases the > same. (It adds __exact if there isn't another lookup sp

Re: Error working on many-to-many lookups

2010-08-25 Thread Christos Jonathan Hayward
I think I found the problem; for the record, I wanted text__exact, not text__equals. On Wed, Aug 25, 2010 at 1:27 PM, Christos Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I am trying to get a many-to-many tagging setup working, and I am getting > an error whic

Error working on many-to-many lookups

2010-08-25 Thread Christos Jonathan Hayward
ere the text field equals a name I am testing against. -- [image: Christos Jonathan Hayward] <http://JonathansCorner.com> Christos Jonathan Hayward, an Orthodox Christian author. Author Bio <http://JonathansCorner.com/author/> • Books<http://CJSHayward.com/> •

Re: gettext on windows - not up to date documentation on django site

2010-08-22 Thread Jonathan
22, 2010 at 10:03:33AM -0700, Jonathan wrote: > > Inhttp://docs.djangoproject.com/en/1.1/topics/i18n/localization/#gettex... > > it says "Extract the contents of the bin\ directories in both files to > > the same folder on your system". > > I downloaded gettext-0.17.

gettext on windows - not up to date documentation on django site

2010-08-22 Thread Jonathan
In http://docs.djangoproject.com/en/1.1/topics/i18n/localization/#gettext-on-windows it says "Extract the contents of the bin\ directories in both files to the same folder on your system". I downloaded gettext-0.17.tar from the link provided and it did not have a bin directory in it. What should

Re: Migration: AlreadyRegistered

2010-08-18 Thread Christos Jonathan Hayward
error looks like an import error in disguise. ( > http://code.djangoproject.com/browser/django/tags/releases/1.2.1/django/utils/importlib.py > ) > > Fire up the python interpreter shell, and trying importing the > django.contrib.admin module manually and see if you get

Re: Migration: AlreadyRegistered

2010-08-17 Thread Christos Jonathan Hayward
thon Executable:/usr/bin/pythonPython Version: 2.6.1Python Path:['/Users/jonathan/directory', '/Library/Python/2.6/site-packages/Django-1.2.1-py2.6.egg', '/Library/Python/2.6/site-packages/tagging-0.2.1-py2.6.egg', '/System/Library/Frameworks/Python.framework/Versions/2.6/

Re: Migration: AlreadyRegistered

2010-08-17 Thread Christos Jonathan Hayward
admin.py file for the app that contains the Entity model. > > On 18 August 2010 10:57, Christos Jonathan Hayward < > christos.jonathan.hayw...@gmail.com> wrote: > >> I am trying to migrate from one server to another: I tarred it up on the >> Linux server, untarred on a M

Migration: AlreadyRegistered

2010-08-17 Thread Christos Jonathan Hayward
ty is already registered Exception Location:/Library/Python/2.6/site-packages/Django-1.2.1-py2.6.egg/django/contrib/admin/sites.py in register, line 78Python Executable:/usr/bin/pythonPython Version:2.6.1Python Path:['/Users/jonathan/directory', '/Library/Python/2.6/site-packages/Dj

Re: Programmatically connecting to a database

2010-08-15 Thread Jonathan Endersby
[quasi-psudo-code] orm = connectToDB('localhost,'user','password') poll = orm.MyPoll() poll.question = 'How are you?' poll.save() [/quasi-psudo-code] I realise it's not very django'y, but for my use case that would be the simplest approach.

Programmatically connecting to a database

2010-08-13 Thread Jonathan Endersby
Hi I have a requirement that I imagine can't be too unique, however I am unable to find examples online of how to achieve what I'm trying to do. In simple terms, I need a setup where each one of my user's data is stored in their own database. (We're using mysql). I have a master database that st

Getting http://http://domain.com/sitemaps.xml on production server using django sitemaps

2010-07-31 Thread Jonathan Nelson
I'm trying to get sitemaps configured properly for http://newsley.com, but I'm having weird issues with the URLs that are being created for the sitemaps.xml on my production server. e.g. http://newsley.com/sitemap.xml When I run the code on my development server, using ./manage.py runserver, the

Re: Many-to-one field in search

2010-07-23 Thread Jonathan Hayward
Thank you! On Fri, Jul 23, 2010 at 1:44 AM, Daniel Roseman wrote: > On Jul 22, 9:55 pm, Jonathan Hayward > wrote: > > Would it make sense to make > > > > A: A TextEmailField which does not have the ForeignKey, and > > > > B: A model which has the foreign k

Re: Many-to-one field in search

2010-07-22 Thread Jonathan Hayward
Would it make sense to make A: A TextEmailField which does not have the ForeignKey, and B: A model which has the foreign key and a TextEmailField as a better and more standard approach? On Thu, Jul 22, 2010 at 3:13 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote:

Many-to-one field in search

2010-07-22 Thread Jonathan Hayward
est URL:http://netbook:8000/profile/1Django Version: 1.2.1Exception Type:AttributeErrorException Value: type object 'TextEmailField' has no attribute 'objects' Exception Location:/home/jonathan/directory/../directory/views.py in profile, line 37Python Executable:/usr/local/bin

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
>> # ...or you could leave off app_label, if there are no conflicting model >> names >> my_ct.get_object_for_this_type(pk=my_pk) >> >> That way you could use get_object_or_404() in your view. >> >> Ben >> >> >> On Thu, Jul 15, 2010 at 10:21 AM, Jonathan Hayward <

Re: How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
Thank you! Let me play with it. On Thu, Jul 15, 2010 at 10:41 AM, Daniel Roseman wrote: > On Jul 15, 4:19 pm, Jonathan Hayward > wrote: > > I'm looking at a problem and see how to solve it, probably badly, with > > eval(), but don't see what the right soluti

How do I translate a naming convention to model/database access?

2010-07-15 Thread Jonathan Hayward
ty" and "description" are effectively replaced by dynamically provided values? -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning collection is available for free reading online: ☩ I

Re: Plain Python traceback (not error page)

2010-07-15 Thread Jonathan Hayward
Thank you; noted; that fixed it. On Thu, Jul 15, 2010 at 5:51 AM, Tom Evans wrote: > On Wed, Jul 14, 2010 at 8:48 PM, Jonathan Hayward > wrote: > > I am working on debugging a basic template, and after correcting some > other > > error, I got: > > > >

Plain Python traceback (not error page)

2010-07-14 Thread Jonathan Hayward
, line 127, in patch_vary_headers if response.has_header('Vary'): AttributeError: 'SafeUnicode' object has no attribute 'has_header' This wasn't the usual format for a Django traceback, and the traceback is only in Django code, no reference to my project.

Re: Look up model instance by id

2010-07-14 Thread Jonathan Hayward
(note id__exact rather than id__equals) > > > > On Jul 14, 3:18 pm, Jonathan Hayward > wrote: > > How do I look up a model instance by id (its primary key)? I have: > > > > entity = directory.models.Entity.objects.filter(id__equals = id)[0] > > > > an

Re: Log errors to file

2010-07-14 Thread Jonathan Hayward
> > If you'd like the code for it, I can ask my company whether they'd be > happy with me publishing it. > > Cheers, Euan > > On Jul 7, 10:35 pm, Jonathan Hayward > wrote: > > I'm working on a view made to output JSON for Ajax use. My log has: > >

Look up model instance by id

2010-07-14 Thread Jonathan Hayward
ther way I should be going about this given the id field beforehand? -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning collection is available for free reading online: ☩ I invite you to visit

Extending Admin to Include URLs for 3rd party ID fields.

2010-07-13 Thread Jonathan Sutcliffe
Hi, I am new to Django and would like to advise on customising admin forms. I have references in my model to ID held in 3rd party systems. e.g. Salesforce, Zendesk etc. What I want to do for these field types is display a URL that links to the object in the respective source system. What would b

Re: Serializing non-queryset data

2010-07-07 Thread Jonathan Hayward
Never mind; I found: import json def view(request): ... my_result = ... return HttpResponse(json.dumps(my_result), mimetype="application/json") On Wed, Jul 7, 2010 at 6:05 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote:

Re: Log errors to file

2010-07-07 Thread Jonathan Hayward
Thank you! On Wed, Jul 7, 2010 at 5:35 PM, elijah rutschman wrote: > You could implement a middleware class with a process_exception > method. See: > http://docs.djangoproject.com/en/dev/topics/http/middleware/#process_exception > > -Elijah > > On Wed, Jul 7, 2010 at 4:35

Serializing non-queryset data

2010-07-07 Thread Jonathan Hayward
easily enough create JSON manually, but is there a preferred way to take dicts, lists, strings, numbers, etc. and render a structure as JSON? -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning collection is

Log errors to file

2010-07-07 Thread Jonathan Hayward
ns to a file or equivalent? The test server has no MTA so I can't really ask it to email me exceptions. TIA, -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning collection is available for free reading onlin

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

2010-07-02 Thread Jonathan Hayward
Thank you! Solved. On Mon, Jun 28, 2010 at 4:14 PM, Jeff Green wrote: > 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.jonat

Re: Looking for unavailable table?

2010-06-28 Thread Jonathan Hayward
P.S. This problem did not resurface after I made other changes discussed elsewhere in the thread; it seems to be secondary damage. On Mon, Jun 28, 2010 at 2:46 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > Thanks for pointing me to South. I've glanced over

Admin interface for model with optional 'self' relationship

2010-06-28 Thread Jonathan Hayward
None: "Entity.department" does not allow null values. Exception Location:/usr/lib/pymodules/python2.6/django/db/models/fields/related.py in __set__, line 269Python Executable:/usr/bin/pythonPython Version:2.6.5Python Path:['/home/jonathan/directory', '/usr/local/lib/py

Re: Looking for unavailable table?

2010-06-28 Thread Jonathan Hayward
ur PYTHONPATH. syncdb scans all modules from > INSTALLED_APPS looking for models.py in them to populate database. So if you > access you Entity model (for example at views.py) as > from directory.models import Entity > then add 'directory' to INSTALLED_APPS. > > > O

Re: Looking for unavailable table?

2010-06-28 Thread Jonathan Hayward
model changes, just > running syncdb will not make the appropriate changes to your tables. You > probably need to look into south migrations. > > On Fri, Jun 25, 2010 at 2:09 PM, Jonathan Hayward < > christos.jonathan.hayw...@gmail.com> wrote: > >> P.S. Re

Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
uldn't tell. On Fri, Jun 25, 2010 at 5:35 PM, Oleg Lomaka wrote: > > Did you add your application to INSTALLED_APPS before running syncdb? > > On Jun 26, 2010, at 12:09 AM, Jonathan Hayward wrote: > > > P.S. Renaming the (SQLite) database file and running syncdb again &g

Re: Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
10 at 3:00 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > I received the error below from the admin interface; I thought it was > because I needed to run a syncdb, but stopping the server, running a syncdb, > and restarting has generated the same error: > > Op

Looking for unavailable table?

2010-06-25 Thread Jonathan Hayward
:['/home/jonathan/directory', '/usr/local/lib/python2.6/dist-packages/pip-0.6.3-py2.6.egg', '/home/jonathan/store/src/satchmo/satchmo/apps', '/usr/local/lib/python2.6/dist-packages/django_threaded_multihost-1.3_3-py2.6.egg', '/usr/local/lib/python2.6/dist

django-tagging registering

2010-06-23 Thread Jonathan Hayward
/Exception Type: AlreadyRegisteredException Value: The model 'Entity' has already been registered. Exception Location:/usr/local/lib/python2.6/dist-packages/django_tagging-0.3.1-py2.6.egg/tagging/__init__.py in register, line 39Python Executable:/usr/bin/pythonPython Version:2.6.5Python Path:['/h

Re: Fields validating as optional

2010-06-22 Thread Jonathan Hayward
Thanks, Dan and Daniel. On Tue, Jun 22, 2010 at 3:45 PM, Daniel Roseman wrote: > On Jun 22, 9:11 pm, Jonathan Hayward > wrote: > > What is the preferred way to make e.g. a TextField that will pass > validation > > if it is left empty? I've seen two approaches appa

Fields validating as optional

2010-06-22 Thread Jonathan Hayward
d run into errors with the first. Does this mean that I should go with the second, or is there another way that is preferred? I'm using 1.2. -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning col

Accessing updated M2M fields in overriden save() in admin

2010-06-18 Thread Jonathan
I'd like to use the values of a ManyToManyField in a model's overriden save() method when I save an instance in admin. It turns out that by design, django does not update the M2M field before calling save(), but only after the save() is complete as part of the *form* save... How can I access the n

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Jonathan Hayward
Alex > > On May 26, 8:24 am, Jonathan Hayward > wrote: > > Thanks! > > > > On Wed, May 26, 2010 at 5:32 AM, Daniel Roseman >wrote: > > > > > > > > > On May 25, 10:49 pm, Jonathan Hayward > > > wrote: > > > > For CharF

Re: EmailField etc. and VARCHAR / TEXT

2010-05-26 Thread Jonathan Hayward
Thanks! On Wed, May 26, 2010 at 5:32 AM, Daniel Roseman wrote: > On May 25, 10:49 pm, Jonathan Hayward > wrote: > > For CharField, EmailField, URLField, etc., is VARCHAR implementation > > (meaning a fixed limit on length) absolutely non-negotiable, or there a > way > &g

EmailField etc. and VARCHAR / TEXT

2010-05-25 Thread Jonathan Hayward
th, or use TEXT instead of VARCHAR so that a field of indefinite length is accommodated, resources permitting?) -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, literature, et cetera. → My award-winning collection is available for free reading o

Re: Static media in development server

2010-04-28 Thread Jonathan Hayward
I found the problem; I was trying to serve static (non-admin) media from a 'media/', and that was apparently being overridden by admin media use of the same URL. On Tue, Apr 27, 2010 at 7:53 PM, Jonathan Hayward < christos.jonathan.hayw...@gmail.com> wrote: > Thank you; right

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
> Use this FILE_UPLOAD_PERMISSIONS = 0600 > and you have to give permissions to apache to read the file upload > directory. > > > > > Jonathan Hayward wrote: > >> The file permissions are right AFAIK; the directory is mode 755 and the >> file 644, owned by the user running

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
s for accessing it with the > user that runs the dev server. > > Regards, > Xavier. > > Le 28 avr. 2010 à 01:00, Jonathan Hayward a écrit : > > Thank you! > > Right now, I have, in settings.py: > > MEDIA_ROOT = os.path.join(os.path.abspath(os.path.dirname(__file__

Re: Static media in development server

2010-04-27 Thread Jonathan Hayward
'^%s(?P.*)$' % (settings.MEDIA_URL[1:],), 'serve', { > 'document_root': > settings.MEDIA_ROOT, > 'show_indexes': True }),) > > > To answer your question, you should > use os.path.abspath(o

Static media in development server

2010-04-27 Thread Jonathan Hayward
It gives a "file not found" error, either this way or if I add a trailing slash. How can I serve up static content from /media/* to a URL of /media/* from the development server? -- → Jonathan Hayward, christos.jonathan.hayw...@gmail.com → An Orthodox Christian author: theology, lite

Re: Problems with first block

2010-04-27 Thread Jonathan Hayward
k dtd }} > > the properly syntax (for last Django version) would be: > > {% block dtd %} ... {% endblock %} > > Notice you should not include 'dtd' in the endblock tag. > > -f > > > > > > > On Apr 27, 3:51 pm, Jonathan Hayward > wrote: &g

Problems with first block

2010-04-27 Thread Jonathan Hayward
ascript }}{{ block footer_javascript_site }}{{ endblock footer_javascript_site }}{{ block footer_javascript_section }}{{ endblock footer_javascript_section }}{{ block footer_javascript_page }}{{ endblock footer_javascript_page }} {{ endblock footer

Re: Working for a startup.

2010-04-22 Thread Jonathan Chen
, Python has more applications than C# does, and django has a mascot. Where is C# mascot? Retired!! Jonathan C. On Apr 22, 8:28 am, Kenneth Loafman wrote: > Joe Goldthwaite wrote: > > I’ve been working for a startup for a month or so.  The main guy is > > enthusiastic about techn

Re: Trouble installing satchmo

2010-03-22 Thread Jonathan Hayward
tionProcess>Hope > it helps > > lzantal > > > > On Mon, Mar 22, 2010 at 12:14 PM, Andrew wrote: > >> Go to: >> http://groups.google.com/group/satchmo-users >> >> On 15 мар, 20:10, Jonathan Hayward >> wrote: >> > I'm trying to g

Trouble installing satchmo

2010-03-15 Thread Jonathan Hayward
e named satchmo_skeleton Do people have suggestions, including going to a Satchmo-specific list if this list is not intended to discuss Django add-ons like Satchmo or Pinax? -- → Jonathan Hayward, a Senior Web Developer who cares deeply about usability → www.linkedin.com/in/jonathanhayward • jon

Seeking opinions for Django for business database project

2010-03-07 Thread Jonathan
from a Rapid Application Development perspective - and of course doing it as a thin client application has all sorts of benefits in terms of deployment. I'm wondering if anybody has built anything like a line of business system with Django, and what your experiences were. Jonathan --

Django and light bulbs

2010-03-01 Thread Jonathan Hayward
Q: How many Django developers does it take to change a light bulb? A: *NONE.* (There's an application for that that comes standard with any Django installation.) -- → Jonathan Hayward, a Senior Web Developer who cares deeply about usability → www.linkedin.com/in/jonathanhayward • jonathan

Admin: 1364, "Field 'id' doesn't have a default value"

2010-02-22 Thread Jonathan Sutcliffe
Hi, I wonder if anyone can help me. I am trying to use the admin to create a new group and assign permisisions. When I try to save the object I see the fllowing error message. OperationalError at /admin/auth/group/add/ (1364, "Field 'id' doesn't have a default value") Request Method: PO

URLs and Regex Question for passing email address?

2010-02-15 Thread Jonathan Sutcliffe
Hi, I am new to Django and Python and have what must be a basic question. I want to pass a URL of the following form, containing an email address that I will later look up contact information from. e.g. http://localhost:8000/contact/ronald.ninnis%40cdu.edu.au/ I don't care about whether this i

Re: Ajax with Django

2010-02-04 Thread Jonathan Orlando
http://code.google.com/p/dojango/ What is dojango Dojango is a reusable django application that helps you to use the client-side framework dojo within your django project. - It provides capabilites to easily switch between several dojo versions and sources (e.g. aol, google, local) - De

Re: Updating a user/profile model object

2010-01-28 Thread Jonathan Roberts
> You're posting your update to a different view from the one that > initially displays the form. The usual way to do this is to have the > form post back to the same view, but have an 'if request.POST' to > branch the execution. The main forms documentation explains the > standard flow. Ah I did

OS X 10.6 Snow Leopard Setup Tutorial

2010-01-15 Thread Jonathan Eatherly
Hi all, Anyone who has ever tried to install a working Django stack on OS X 10.6 knows it can be quite a nuisance. I took the time out of my day to fix this and wrote my own setup tutorial. There are many other tutorials out but frankly they all suck. If you follow my tutorial, you will have my

Re: How to test activation email on windows?

2009-12-29 Thread Jonathan Nelson
I'm using Gmail to manage as my email provider: http://www.mangoorange.com/2008/09/15/sending-email-via-gmail-in-django/ It works with Google apps for your domain, too. So you can use my_n...@my_domain.com if my_domain.com is set up with Google apps. Best, J On Dec 27, 12:50 am, vishy wrote: >

Re: Migrating ForeignField to OneToOneField

2009-12-19 Thread Jonathan
d South folders and egg files from the site-packages directory... Interestingly enough if you don't do that in Python's shell you'll get the new South version, whereas in django's shell you'll get the old south version. Jonathan On Dec 19, 1:34 pm, Jonathan wrote: >

Migrating ForeignField to OneToOneField

2009-12-19 Thread Jonathan
I'm using South to migrate a certain field from ForeignField to OneToOneField. Initial state is that I have model A pointing to model B using a ForeignField. Of course there's only one instance of A pointing to a B instance. I wasn't sure if this would work directly, or that I should do a 3- stage

Django Docs Chrome Extension

2009-12-13 Thread Jonathan Eatherly
Hello everyone, decided to have a little fun today with Google's Chrome browser. Since extensions were just released last week I created a Django Docs extension that uses Google's AJAX search API to search Django's official documentation. It lets you search the Documentation in a popup frame and lo

Re: Many-to-many through multiple tables

2009-11-28 Thread Jonathan
l existing Profile's automatically prompt for the new Package. I've been reading a bit and perhaps model inheritance is what I'm after. A VersionedPackage (renamed from PackageVersion) is really just a Package with an extra field. Does that sound right? Jonathan On Nov 29, 2:31 am, t

Re: Many-to-many through multiple tables

2009-11-28 Thread Jonathan
Hi, I've slimmed it down to the relevant fields. I'm a bit of a noob, but I think I'm basically trying to build a generic framework that can be made specific in a profile. Profile = BusinessVersion + Group + LifecycleStage + Package.Versions Jonathan class Product(models.M

Many-to-many through multiple tables

2009-11-28 Thread Jonathan
ure that I could use? Jonathan -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.c

Re: strange problem with floatformat

2009-09-27 Thread jonathan
Ha no one else seen this problem, or have any idea how it might happen? On Sep 26, 7:44 pm, jonathan wrote: > Hi, I am having a strange problem with floatformat (filter) and I > wonder if anyone else has seen it. > > I am using google app engine and am storing decimal.Decimal obje

strange problem with floatformat

2009-09-26 Thread jonathan
Hi, I am having a strange problem with floatformat (filter) and I wonder if anyone else has seen it. I am using google app engine and am storing decimal.Decimal objects in the datastore that I am displaying in a template as money values so I am doing foo.methodThatReturnsDecimal|floatformat:2. T

Re: Defining subsets of "list" variable at template level

2009-08-30 Thread Jonathan
This explains how to do this using the dictsort and regroup filters. http://blueflavor.com/blog/2008/jul/28/advanced-django-template-tags-and-filters/ On Aug 30, 3:19 pm, Jonathan wrote: > I am looking for the exact same thing. > > On Aug 6, 11:35 pm, bweiss wrote: > > >

Re: Defining subsets of "list" variable at template level

2009-08-30 Thread Jonathan
I am looking for the exact same thing. On Aug 6, 11:35 pm, bweiss wrote: > Is there a simple way to do the following that I'm just not seeing, or > am I looking at trying to write a custom tag?  The functionality I > need is similar to {% regroup %} but not quite the same... > > My app current

Form upload passed to ftp method

2009-08-18 Thread Jonathan
I am trying to write a view that will take a file uploaded via form, pass it to an ftp method and save it on an ftp server. However I am running into problems when with the file object that gets passed to the ftp method. This is my view: def order_prints(request, object_id): p = get_obj

Re: Anybody?? uber-newb question... installing django

2009-08-16 Thread Jonathan Zacsh
please, can anyone help me out?? -- Jon On Sun, Aug 16, 2009 at 10:20 AM, jzacsh wrote: > hello, > > i'm sorry - i just want to get started and I'm trying to figure out > something simple. I installed django last night and am wondering what > setup.py actually did. > > the reason i want to know

Re: Database Model Layout Advice

2009-07-14 Thread Jonathan Buchanan
 author = models.ForeignKey('books.Author') >        illustrator = models.ForeignKey('books.Illustrator') > >        class Meta: >                ordering = ['publication_date'] One option would be to use a generic relation: http://docs.djangoproject.com/en/dev/ref/cont

Re: Manipulating post data before sending?

2009-07-10 Thread Jonathan Buchanan
; argument to the ModelForm's save() method to get a hold of the resulting model instance without saving it, make any changes you want to the instance and then call save() on it yourself. There's an example of this in the docs: http://docs.djangoproject.com/en/dev/topics/forms/modelfor

Re: Automatic slugs

2009-07-09 Thread Jonathan Buchanan
=slugify(...title...)) > > but I have no idea how to pass title field (or at least model > instance) to slugify function. Any idea how to solve? Overriding the save method [1] would be one way to do it: def save(self, **kwargs): self.slug = slugify(self.title) super(Entry

Re: How does admin generate HTML for adding objects?

2009-07-03 Thread Jonathan Buchanan
etty_name [1] is used [2] to generate a label from the field name if a label was not given when the field was instantiated. Jonathan. [1] http://code.djangoproject.com/browser/django/trunk/django/forms/forms.py#L20 [2] http://code.djangoproject.com/br

Re: Global custom tags

2009-07-02 Thread Jonathan Buchanan
t if I want to make it visible to all apps and callable from a > base > template? > > Thanks! If it only needs to be called in the base template, you could just {% load %} and call it there as normal. If it really does need to be available

Re: Building a widget from zero

2009-06-17 Thread Jonathan Buchanan
r than a string representation of them, as you would normally do. Here's an example implementation which I think should do what you want: http://dpaste.com/hold/56364/ Regards, Jonathan. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Two views, Two models, Two forms, one template

2009-06-16 Thread Jonathan
Nevermind, I was missing something terribly basic and just needed to stop looking at it for a bit to realize how to combine it. On May 22, 5:08 pm, Jonathan wrote: > I am sure this is some very easy and simple concept I am just not > grasping.  I have two views which are very similar.

Re: Feedparser problem

2009-06-04 Thread Jonathan Nelson
Thanks, I'll give it a shot. J On Jun 4, 8:06 am, Alex Gaynor wrote: > On Thu, Jun 4, 2009 at 7:37 AM, Jonathan Nelson wrote: > > > > > > > > > I'm trying to add a feedreader element to my django project.  I'm > > using Mark Pilgrim's gr

Re: Newb problem with form wizard

2009-06-04 Thread Jonathan Nelson
I haven't used the form wizard, but it seems like your forms are in ...templates/wha/ Django is looking for your form at ...templates/wha/forms/wizard.html you have them in ...templates/wha/contact/forms/wizard.html try adding ...templates/wha/contact/forms or ...templates/what/contact to your

Feedparser problem

2009-06-04 Thread Jonathan Nelson
I'm trying to add a feedreader element to my django project. I'm using Mark Pilgrim's great feedparser library. I've used it before without any problems. I'm getting a TypeError I can't figure out. I've tried searching google, bing, google groups to no avail. Here's the dpaste of what I'm tryi

Two views, Two models, Two forms, one template

2009-05-22 Thread Jonathan
r make one a template tag, I end up with an error, or only getting one to work and the other fails silently. When I try and make one into a template tag, I end up with the "object_id" is not globally defined error. I'm sure I am missing something really basic. Does anyone have a poin

Dynamic Form Wizard

2009-02-11 Thread Jonathan Lukens
I am trying to dynamically add forms to a form wizard. Initially the form wizard subclass is instantiated with three forms as follows: # from urls.py (r'^add/$', RecipeWizard([HeaderForm, IngredientForm, BodyForm])), The idea is that a user will add any number of ingredients to a recipe, so the

"ImportError: cannot import name SimpleCookie" on access to Django

2009-01-27 Thread Jonathan Prater
I have Django 1.0.2 installed, using mod_python compiled against Python 2.6.1 and Apache 2.2.11. Upon accessing my Django project's configured URL, I get the following errors: [Tue Jan 27 19:33:05 2009] [error] [client 127.0.0.1] Traceback (most recent call last): [Tue Jan 27 19:33:05 2009] [e

Re: Question about login_required redirect_field_name

2009-01-27 Thread Jonathan Nelson
I just figured it out. Instead of using a decorator, I just used this: def myview(request, comment_id): ...if not request.user.is_authenticated(): ..return HttpResponseRedirect('/login/?next=%s') % request.path On Jan 27, 11:57 am, Jonathan Nelson wrote: > I'm trying

<    1   2   3   4   5   6   >