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

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

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

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.

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

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

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

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

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

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

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

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

Re: Genealogy apps

2008-04-28 Thread Jonathan
I use gramps. I guess it would be cool to port to django. --Jonathan On Mon, Apr 28, 2008 at 10:32 AM, ecrosstexas <[EMAIL PROTECTED]> wrote: > > Does anyone know of any existing apps writtrn in Django for > genealogy? I thought there was one in Google Code awhile back, but I

CacheMiddleware with generation-style caching

2011-10-28 Thread jonathan
weak django to only use CACHE_MIDDLEWARE_SECONDS for the Cache-Control headers? Obviously, I can make this change locally, but I'd like to know if I'm missing something and if this change has any chance of making it upstream. :) Thanks! Jonathan [1] http://assets.en.oreilly.com/1/

Django with Codebase Database

2011-11-02 Thread Jonathan
Does anybody use Django/Python with Codebase? Can it be done? If so, how hard is it? -- 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 t

Re: Database connection closed after each request?

2011-11-20 Thread Jonathan
Does anyone know if this progressed anywhere since '09? -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/0fmsTMQC_tAJ. To post to this group, send email to d

Re: File/Code Structure

2012-12-26 Thread Jonathan
you to maintain the integrity of your 'core' app views while still utilizing data from neighbouring apps, as you've described. https://docs.djangoproject.com/en/dev/howto/custom-template-tags/#inclusion-tags Cheers, Jonathan On 12/26/2012 07:07 AM, Omar Abou Mrad wrote: > Greeti

Re: Stuck

2012-12-26 Thread Jonathan
The stack trace you pasted clearly indicates that you have an indentation error in your polls/models.py module. It appears that you've applied two spaces to the 'votes' field while 'poll' and 'choice' have four. If you'll apply four spaces to all the field, the interpreter won't complain. On 12/26

Re: File/Code Structure

2012-12-27 Thread Jonathan
templatetag at that layer in the cycle. I don't know of another way to accomplish the goal, but if you learn of one be sure and let me know! Cheers, Jonathan On 12/27/2012 01:43 AM, Omar Abou Mrad wrote: > On Wed, Dec 26, 2012 at 6:07 PM, Jonathan > mailto:jonathandavidba...@gmail

Re: Can't set static file directory.

2013-01-08 Thread Jonathan
, { 'document_root': settings.STATIC_ROOT, }), ) Feel free to add a similar pattern for media files as well. Hope this helps, Jonathan On 01/08/2013 04:25 AM, Agnese Camellini wrote: > I'm not using apache now, i'm just using the development se

Re: Python package names

2008-11-03 Thread Jonathan Buchanan
hat this package supports some general > tagging. > > Valts. You can put any directory on your PYTHONPATH - it doesn't necessarily have to be in site-packages. Personally, I have django_apps and django_projects directories on my PYTHONPATH for obvious purposes, which

Re: "Mix and match" model form?

2008-11-04 Thread Jonathan Buchanan
ontext_instance=RequestContext(request)) Template: {{ user_form.as_p }} {{ profile_form.as_p }} Cancel Regards, Jonathan. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: Recommendation system problem

2008-11-09 Thread Jonathan Buchanan
N ( SELECT app_person_likes.person_id FROM app_person_likes INNER JOIN app_kindoftea ON app_person_likes.kindoftea_id = app_kindoftea.id WHERE app_kindoftea.id IN (1, 2) AND app_person_likes.person_id != 1 ) AND app_kindoftea.i

Re: passing css classes in forms

2008-11-11 Thread Jonathan Buchanan
Bobby Roberts wrote: > how can I assign form fields to certain css classes in django? django-html [1] can be used to do this quite easily in your templates (and lets you render form fields using HTML4 if you like, yay!). Jonathan. [1] http://code.google.com/p/django-h

Re: public html?

2008-11-17 Thread Jonathan Lin
By the way, that is the way to get django's development server to serve up you files, and not necessarily the best way to go when you want to deploy your site. Your best bet is some sort of webserver like apache or lighttpd Jonathan Horus Kol wrote: > On Nov 18, 2:24 pm, Horus Kol

DjangoCon meetup Friday Sept 5

2008-08-20 Thread Jonathan Nelson
nd some place else. If anyone else can think of a better place to post this information, let me know. Comments and thoughts are always welcome. Jonathan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: newbie urls.py question

2008-08-21 Thread Jonathan Nelson
Look at the import statements on the different urls.py files. This: from myproject.myapp import myview urlpatterns = patterns('', (r'^somepattern/', myview)) Does the same thing as this: urlpatterns = patterns('', (r'^somepattern/', myproject.myapp.myview)) On Aug 21, 8:5

Re: DjangoCon meetup Friday Sept 5

2008-09-04 Thread Jonathan Nelson
I just wanted to let people know that the get-together is still on, if people are interested. There's more information here: http://django.meetup.com/3/ Let me know if you have any questions. Jonathan On Aug 20, 9:22 pm, Jonathan Nelson <[EMAIL PROTECTED]> wrote: > I&#x

Django Comments Bug?

2008-09-15 Thread Jonathan Nelson
Hello. I think I'm up against a bug in the new comments app. I could be wrong. I just deleted my old install and installed 1.0 this morning. I don't know if that has anything to do with it or not. I looked at this thread: http://groups.google.com/group/django-users/browse_thread/thread/2012bd

Re: Django new comments framework error

2008-09-17 Thread Jonathan Nelson
d that I'm going to roll my own comments system in a couple of weeks. I would have to tweak the current comments framework substantially anyway to fit what I need, regardless. Jonathan On Sep 16, 10:31 am, Mark <[EMAIL PROTECTED]> wrote: > Hi, > > Finally - I got commen

Re: mptt + contrib.comments?

2008-10-04 Thread Jonathan Nelson
I'm actually rolling my own threaded comments system using an MPTT algorithm. Contrib.comments and the django-mptt aren't a really good fit for what I need. It's taken me a while to get my head around the concept of traversing the tree using the comment.left and comment.right values, but after y

Re: mptt + contrib.comments?

2008-10-06 Thread Jonathan Nelson
ng my own, then I discovered Django (so have started > "porting" my site to Django), then I discovered the mptt app and thought I > could just drop it in.  Has not been that easy (probably in large part due > to my Django-newbie > status).http://www.sitepoint.com/article/hiera

Re: mptt + contrib.comments?

2008-10-15 Thread Jonathan Nelson
rent.right: node.left += 2 if node.right >= parent.right: node.right += 2 node.save() # a new node is created with correct left/right values Comment.objects.create( text = text, left = parent.right, right = parent.right+1) I'l

Re: How to get a page in Django?

2008-10-16 Thread Jonathan Lin
quire you to code in Python and requires at least passing knowledge in coding your own html/css. Are you comfortable with that? Jonathan Gnarlodious wrote: > Hello. I've spent about 8 hours trying to figure out how to get an > actual page in my browser. Are there any clear instructions o

mod_wsgi problem (python 2.6.1, Apache 2.2.11, Windows XP SP3)

2009-01-25 Thread Jonathan Prater
Hopefully, someone here can help me with this issue. I've got a mod_wsgi.so compiled against Python 2.6.1 and Apache 2.2.11 for use on Windows. It loads perfectly well (no errors during Apache startup), and I've followed the steps given on the Django website and the mod_wsgi site for getting

Question about login_required redirect_field_name

2009-01-27 Thread Jonathan Nelson
I'm trying to decorate a view function with login_required. I want the user to be redirected to the current view after they log in. I'm trying: @login_required(redirect_field_name=request.path) def myview(request, comment_id): return render_to but, I'm getting a "NameError: name 'reque

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

"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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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:

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

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

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

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

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

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

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 <

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

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

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

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

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.

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

2010-10-11 Thread Jonathan Barratt
tp import HttpResponse > > > def current_datetime(request): > > word = request.GET['word'] > > return HttpResponse(word) Needs to be: > def current_datetime(request): > word = request.GET['word'] > return HttpResponse(word) Hth, Jonatha

  1   2   3   4   5   6   >