New to DJANGO

2012-06-21 Thread Jeff Silverman
I am new to Django. I am trying to get the Class version of hello_world to work. I cannot find a good full example of the code that works. I have made multiple view.py files and urls.py files trying to get it to work. I cannot seem to come up with the right url to pass the variables name and

[JOBS - NYC] Python / Django developer for WNYC, New York Public Radio

2012-05-04 Thread Jeff Heard
This is not mine, so I can't give *all* the details, but I was asked to forward this along. It's a good gig - great people, offices in SoHo, growing organization within a 100+ year old mainstay of New York City, https://jobs-wnyc.icims.com/jobs/1116/job -- You received this message because you

Re: Confused about GeoDjango and PostGIS

2012-04-25 Thread Jeff Heard
It can. I just usually consider it easier to create a new one On Apr 25, 2012 1:38 PM, "vishy" wrote: > So, the existing database cannot be used as a postgis db? > > On Apr 25, 9:21 pm, Jeff Heard wrote: > > Create a new spatial database and import the data. That&

Re: Confused about GeoDjango and PostGIS

2012-04-25 Thread Jeff Heard
Create a new spatial database and import the data. That's by far your easiest option. You'll need to create a POINT column (look at the PostGIS doc on how to add spatial columns) and then add rows either using the ORM or with a spatial query including something like this as part of the insert: G

Re: PostgreSQL Socket 5432 Error

2012-04-19 Thread Jeff Heard
The other possibility is that you need to build psycopg2 from scratch and set the pg_config option in setup.cfg. I have to do this with the brew build of pg because the socket is elsewhere On Apr 19, 2012, at 7:32 PM, Russell Keith-Magee wrote: > On Friday, 20 April 2012 at 6:04 AM, Zach wr

Re: Dynamically generated models using exec. Is it too custly?

2012-04-16 Thread Jeff Heard
Check https://github.com/JeffHeard/ga_dynamic_models. It may be similar to what you're looking for. Even if you don't want the code, you can see a way of dynamically generating models. On Mon, Apr 16, 2012 at 12:40 PM, Philip Mountifield < pmountifi...@formac.net> wrote: > Did you know that yo

Re: Installation Issue - error: /usr/local/bin/django-admin.py: No such file or directory

2012-04-14 Thread Jeff Hervouet
nevermind, I found the answer: /usr/local/bin/django-admin.py already existed. I removed it and reran a fresh install. On Sat, Apr 14, 2012 at 3:50 PM, BuckRogers wrote: > Hi, > > I am attempting to install Django 1.4 on OS X 10.6.8 > > After running the following command : > sudo python s

Logging works from 'manage.py shell', not from app

2012-04-13 Thread Jeff Blaine
Hi all. I'm stumped on something. Using logging via 'manage.py shell' is working as expected. Using it in the webapp generates zero data and zero errors. NOTE: /var/log/hostdb.log is WORLD WRITABLE (in order to dodge any permissions errors right now while debugging this) My logging settings are a

Re: svm python

2012-03-30 Thread Jeff Heard
Look in Orange. http://orange.biolab.si/ On Mar 30, 2012, at 2:23 AM, dummyman dummyman wrote: > Is any one aware of svm implementation using python ? > Apart from using weka tool ? > > > On Thu, Mar 29, 2012 at 9:21 AM, dummyman dummyman wrote: > Hi, > > I am looking for svm classifier i

Re: ANNOUNCE: Django 1.4 released

2012-03-23 Thread Jeff Heard
Do the PyCharm devs read this list? Will 1.4 work inside pycharm 2.5? On Mar 23, 2012, at 3:58 PM, Mário Neto wrote: > Great! \,,/_ > > 2012/3/23 James Bennett > Django 1.4 is finally here! > > For details, checkout the weblog: > > https://www.djangoproject.com/weblog/2012/mar/23/14/ > >

Re: Weird stacktrace coming from manage.py test

2012-03-23 Thread Jeff Heard
No, it turned out that my django-startproject.py was still the one for 1.3... On Fri, Mar 23, 2012 at 10:47 AM, Reinout van Rees wrote: > On 22-03-12 17:34, Jeff Heard wrote: >> >> Has anyone seen this before?  Am I missing something?  This hasn't even >> gotten to my

Django-1.4c2 logging issue on Snow Leopard

2012-03-22 Thread Jeff Heard
;filter %r: %s' % (name, e)) ValueError: Unable to configure filter 'require_debug_false': Cannot resolve 'django.utils.log.RequireDebugFalse': No module named RequireDebugFalse I'm using virtualenv and the system python. Regards, -- Jeff -- You received this message because you are subscribed t

Weird stacktrace coming from manage.py test

2012-03-22 Thread Jeff Heard
Has anyone seen this before? Am I missing something? This hasn't even gotten to my code yet. I'm using this in my settings.py: TEST_RUNNER = 'django.contrib.gis.tests.GeoDjangoTestSuiteRunner' I have a template PostGIS database setup properly. And I'm running the stable release of Django 1.3.

Re: Caching and model import question

2012-03-21 Thread Jeff Heard
Well, I was wrong... how *should* this work? I tried a signal handler to reload modules whenever someone added or deleted a model, but that only seems to matter if a particular module that loads "models" hasn't been loaded yet. On Wed, Mar 21, 2012 at 12:59 PM, Jeff Heard wrot

Re: Caching and model import question

2012-03-21 Thread Jeff Heard
r couple of iterations on it may make sense. On Wed, Mar 21, 2012 at 12:52 PM, Tom Evans wrote: > On Wed, Mar 21, 2012 at 4:19 PM, Jeff Heard > wrote: >> Question 1: Would this work with views, or for that matter, anything >> else in Django, assuming you&#x

Caching and model import question

2012-03-21 Thread Jeff Heard
Question 1: Would this work with views, or for that matter, anything else in Django, assuming you're using a WSGI server like gunicorn? http://code.activestate.com/recipes/578078/  Specifically, will it cache across HTTP requests, or not? I guess the one thing I don't understand well in Django is

Caching and module import question

2012-03-19 Thread Jeff Heard
Question 1: Would this work with views, or for that matter, anything else in Django, assuming you're using a WSGI server like gunicorn? http://code.activestate.com/recipes/578078/ Specifically, will it cache across HTTP requests, or not? I guess the one thing I don't understand well in Django is

Re: A little InlineModelAdmin help please?

2012-03-16 Thread Jeff Blaine
Thanks for the reply, Marc. On Thursday, March 15, 2012 4:32:48 PM UTC-4, Jeff Blaine wrote: > > Easier for me to just draw you a picture: > >++ >

A little InlineModelAdmin help please?

2012-03-15 Thread Jeff Blaine
Easier for me to just draw you a picture: ++ | noodle | ++ | | | | +-+ ++ ||

Re: psycopg2, postgres9.1, Mac OS - problem with psycopg2

2012-02-22 Thread Jeff Heard
Just as a followup to this, there are a few problems that have been patched on Django with regards to Postgres 9.1. They're not in the stable release, but if you're using custom binary fields, such as PostGIS geometry, you will need to search for the patch and apply it. You may see '\x00' is not

Re: Need details re: deletion of a referenced model instance

2012-02-15 Thread Jeff Blaine
> > >> Known Facts: > >> > >> 1. Deleting any Topping object (for example, deleting id=1, > >> name="Pepperoni") also removes it from foopizza.toppings. Good. > >> 2. No m2m_changed signal is sent when 1 (above happens). BAD. > > ... > > Check this out ;) > https://docs.djangoproject.com/en/d

Need details re: deletion of a referenced model instance

2012-02-14 Thread Jeff Blaine
Hi all, I'm having trouble detecting changes that happen to a M2M field behind the scenes: as a result of one of the *referenced objects being deleted* I'm using Django 1.3.1 with PostgreSQL 8 Let's say we have the following simple proof of concept models: class Topping(models.Model): name

Re: Newbie django/python with C++ background wants enums

2012-02-01 Thread Jeff Heard
*slightly* better would be: class X(models.Model): YES='Y' NO='N' DEFAULT='D' TO_USE = ((X.YES, "Yes"), (X.NO, "No"), (X.DEFAULT, "Default")) txt= models.CharField(db_index=True,null=True, blank=True,max_length=30) use_txt= models.CharField(blank=False,max_length=1,default

Re: ANN: OGC Web Feature Service for GeoDjango

2012-02-01 Thread Jeff Heard
Great. There's more coming down the pipe. WFS was the first thing I had reasonably finished... On Tue, Jan 31, 2012 at 10:16 AM, George Silva wrote: > Wow! Congratulations on this release. > > I'm looking at it right now. > > :D > > On Tue, Jan 31, 2012

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
). -- Jeff On Tue, Jan 31, 2012 at 9:07 PM, Alex Kopp wrote: > Yes Jeff, this is what I want to do. I wasn't sure if there was an easier > way. What units does the distance function return? I tried this and it > seems to return the distance in units of 10km, is this correct? > > Th

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
correctly... -- Jeff On Tue, Jan 31, 2012 at 8:45 PM, Alex Kopp wrote: > Here's a more concrete example, say I am storing shapes of all > countries. Now, the US can't be stored in one polygon (we have hawaii and > alaska), therefore I have to store the many polygons in one &

Re: GIS Distance from Point to Geometry Collection

2012-01-31 Thread Jeff Heard
You should be able to create a geometrycollection object from a queryset (you may have to use a list comprehension for this), then calculate the centroid and take the distance from that. Taking the distance from the edge should only be a little more Complicated. Check the django GEOS API docs F

ANN: OGC Web Feature Service for GeoDjango

2012-01-31 Thread Jeff Heard
orted for output but will be soon. Also, you can adapt WFS to any python object (including other ORMs) by deriving from WFSAdapter. -- Jeff -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Tutorial for dev version not working (Polls app): admin

2012-01-29 Thread Jeff Heard
syncdb will not remake tables that are already made. For that you will have to pipe the output of: $ python manage.py resetsql through your database backend. Then try restarting the server and looking at your admin. On Sat, Jan 28, 2012 at 10:15 PM, Alec Taylor wrote: > Going through the tut

Re: Problem in Geodjango

2012-01-27 Thread Jeff Heard
Check that you are actually using the django.contrib.gis.db.backends.postgis (or other) database backend in your settings.py. It sounds like the SQL to create geometry columns is never getting called. On Thu, Jan 12, 2012 at 4:38 AM, Vicky .. wrote: > Hi Everyone .. > > I am following the steps g

Re: GeoDjango - Error while importing data

2012-01-27 Thread Jeff Heard
you are using Postgres 9.1 There is a bug in the adapter for 9.1. It is addressed and fixed with this patch: https://code.djangoproject.com/ticket/16778 On Mon, Jan 16, 2012 at 2:52 AM, Serge RABEVOHITRA < serge.rabevohi...@gmail.com> wrote: > Hi, > > I've just begun to learn GeoDjango. So I f

Re: A problem with a solution, but is it the right one?

2012-01-20 Thread Jeff Heard
Yeah, I started doing that after I posted... Thanks for the advice. I'll be posting this code up on GitHub in a few days, as it's part of a reasonably complete implementation for Django of ISO 19142, Open Geospatial Consortium's Web Feature Service. -- Jeff On Fri, Jan 20,

Re: pre_remove and post_remove "actions" not sent via m2m_changed signalling?

2012-01-18 Thread Jeff Blaine
Answering my own question: https://code.djangoproject.com/ticket/16073 :( Thanks to IRC #django-users : carljm and domguard -- 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/

A problem with a solution, but is it the right one?

2012-01-18 Thread Jeff Heard
h() method. The code for my proposed solution is here: http://dpaste.com/hold/689872/ Does this make sense to people? Sorry to kind of flood the list with this problem all day in different forms, but i think I'm close to having something I like. -- Jeff -- You received this message bec

Re: Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
hen I pull form_instance.count, it should be 1, even if nothing was specified in the GET dictionary. It's not my standard... -- Jeff On Wed, Jan 18, 2012 at 11:06 AM, Tom Evans wrote: > That would probably do it. You may also need to give it a different > widget, I'd guess that a

pre_remove and post_remove "actions" not sent via m2m_changed signalling?

2012-01-18 Thread Jeff Blaine
Hi all, http://dpaste.org/1vhf6/ With the following models.py, and the output seen further down, can anyone explain why pre_remove and post_remove "actions" are not happening when I remove an item from a M2M relation? class Interface(models.Model): name = models.CharField('Interface',

Re: Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
Sadly these strings are arbitrary, yes... I suppose I could subclass MultipleChoiceField and kill the validator. On Wed, Jan 18, 2012 at 10:54 AM, Tom Evans wrote: > On Wed, Jan 18, 2012 at 3:51 PM, Andre Terra wrote: > > https://docs.djangoproject.com/en/dev/ref/forms/fields/#choicefield > > >

Case insensitive query dictionaries

2012-01-18 Thread Jeff Heard
urns a case normalized version? -- Jeff -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups

Missing something obvious? Question about forms

2012-01-18 Thread Jeff Heard
foo', '1')) bar = request.getlist(bar) I can't figure out the corresponding Form class. What I would *want* is something like this: class MyForm(Form): foo = IntegerField() bar = ListField(CharField) but there is no "ListField" How is this normally handled? -

Re: pseudo one-to-one

2012-01-16 Thread Jeff Heard
You might modify the manager to store historical entries in a different table with the same structure. On Jan 16, 2012, at 2:18 AM, Mike Dewhirst wrote: > On 16/01/2012 5:19pm, Bill Beal wrote: >> Why not have a child model that differs from the one-to-one child model >> in that the parent k

Re: Need to examine and act on old vs. new at .save() time

2012-01-13 Thread Jeff
ciated properly. If I just click 'save' then it reports what it should have reported when I made the new netgroup all along: DEBUG LOG: Existing netgroup in LDAP: mynewnetgroup saving interfaces as ['(agilent,,)', '(agilent.our.org,,)', '(ape,,)', '

Re: Does anyone know any blogs that write about how to quickly install and deploy a django application on Amazon EC2?

2012-01-12 Thread Jeff Heard
http://kencochrane.net/blog/2011/06/django-gunicorn-nginx-supervisord-fabric-centos55/ I would go there. It's not Amazon EC2 specific, but Amazon's distribution by default is a Centos-based one, so everything should be in the same place. Plus, he very helpfully gives you code you can use to get

Re: Need to examine and act on old vs. new at .save() time

2012-01-12 Thread Jeff
On Jan 11, 9:23 pm, Dennis Lee Bieber wrote: > On Wed, 11 Jan 2012 17:26:44 +, Tom Evans > wrote: > > >On Wed, Jan 11, 2012 at 5:22 PM, Jeff wrote: > >> When Device.netgroups (a M2M field) changes, we need to perform > >> some python-ldap operations. >

Re: Need to examine and act on old vs. new at .save() time

2012-01-11 Thread Jeff
I've just found that the problem is related to my desired field being M2M. Anyone know what is going on here? :( My approach (and Matt's) works fine on a simple CharField field. class Device(models.Model): # ... floor = models.CharField('Floor', max_length=10, blank=True) # ... Devi

Re: Need to examine and act on old vs. new at .save() time

2012-01-11 Thread Jeff
On Jan 11, 11:59 am, Andre Terra wrote: > The important question here is, what are you trying to achieve, outside of > the functionality itself? Are you trying to log changes to provide an audit > trail? If so, there are tools for that. I wish that's all I was doing. Then again, I also wish Goog

Re: Need to examine and act on old vs. new at .save() time

2012-01-11 Thread Jeff
On Jan 11, 10:03 am, "hanks...@gmail.com" wrote: > I go about this a different way, which is to monkeypatch the object > with the relevant initial values at __init__: > > https://gist.github.com/1595055 > > Saves you a database call. But is costly when the field in question is foreign, no? Mine'

Re: Need to examine and act on old vs. new at .save() time

2012-01-11 Thread Jeff
Matt, On Jan 10, 5:57 pm, Matt Schinckel wrote: > The way I generally do this type of thing > is:https://gist.github.com/1591723 Thanks for the reply! This looked awfully similar to my logic (although yours is 10x more clean), but I was excited to implement it this morning. After doing so, I a

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
Sigh. I hate Google Groups via web. Here is a readable version of the .save() method below. https://gist.github.com/1591028 On Jan 10, 3:15 pm, Jeff wrote: > For example, altering 'pana.our.org''s netgroups field, the following > save() method results in this debug line

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
For example, altering 'pana.our.org''s netgroups field, the following save() method results in this debug line which makes no sense to me: CHANGED: Device pana.our.org had old netgroups [{'name': u'testnetgroup', 'desc': u''}] and now has new netgroups [{'name': u'testnetgroup', 'desc': u''}]

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
On Jan 10, 10:42 am, Kelly Nicholes wrote: > Isn't there a form.changed_data ? See 1st post below indicating we manipulate Django data from various Django codebases, not just a web form. > > I need to.. ... How > > can I do this, > > beari

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
On Jan 10, 10:09 am, Nahuel Defossé wrote: > I think you should see at the forms's cleaned_data attribute and > compare it against the model current state, before saving. As I indicated in the 1st post: > >> > I need to ... ... > >> > How c

Re: Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
.save()), ... I need to know how to, in my custom .save() for a model: a) determine what fields changed (if any) (HOW?) b) and take certain actions if field X was one of the changed fields. (I know how) > On Mon, Jan 9, 2012 at 11:39 PM, Jeff wrote: > > Hi all, > > > I need to

Need to examine and act on old vs. new at .save() time

2012-01-10 Thread Jeff
Hi all, I need to be able to determine, at .save() time (before I call the parent class' .save()), if a certain field on my model object was changed, and act on that via some custom code. How can I do this, bearing in mind that we call .save() from non-web code, etc? We use Django's ORM from var

Re: collectstatic missing on Linux

2012-01-09 Thread Jeff Heard
Make sure the staticfiles app is in your INSTALLED_APPS setting. That'd be my first guess. If it is, do a manage.py console and try importing it to make sure that the django environment can see it. -- Jeff On Tue, Jan 10, 2012 at 1:22 AM, Mike Dewhirst wrote: > The manage.py colle

ModelForms and ProcessFormViews w models containing BooleanFields

2011-12-20 Thread Jeff Heard
ur and make the fields editable? I know in a regular form, you specify a BooleanField(required=False) for all your boolean fields, but since the ModelForms and in particular the ProcessFormViews are automatically generated from the model, I can't seem to do that. -- Jeff -- You received this

Re: Confused by STATICFILES_DIRS not working

2011-12-16 Thread Jeff Blaine
On Friday, December 16, 2011 11:18:09 AM UTC-5, Tom Evans wrote: > > On Fri, Dec 16, 2011 at 4:17 PM, Tom Evans wrote: > > > > 1) Is staticfiles in INSTALLED_APPS ? > Yes, django.contrib.staticfiles is in INSTALLED_APPS > > 2) Is DEBUG=True? > Yes > > 3) What is the output of: > > python

Confused by STATICFILES_DIRS not working

2011-12-16 Thread Jeff Blaine
I'm having a heck of a time getting STATICFILES_DIRS working. If anyone could shed some light on this or just point me to the "All of your Django STATIC* Settings Clarified Completely Once and For All" blog post or somesuch, I would really appreciate it. STATIC_ROOT = '' # DEFAULT STATIC_URL =

Re: Error in syncdb

2011-12-03 Thread Jeff Heard
Never mind. My error was elsewhere. A little putzing around led me to realize that you can't put db_index=True into a geometry field of any sort in PostGIS backend. On Sat, Dec 3, 2011 at 11:25 AM, Jeff Heard wrote: > I have a custom field type that I defined, and now I can'

Error in syncdb

2011-12-03 Thread Jeff Heard
when I do reset or syncdb on an app with a model that uses that field type. Any clue? Traceback (most recent call last): File "manage.py", line 14, in execute_manager(settings) File "/opt/data/ga/jeff/lib/python2.7/site-packages/django/core/management/__init__.py&

Re: Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
overwritten all of django, because when I type python manage.py shell I get "no module named core.management" -- Jeff On Wed, Nov 23, 2011 at 2:15 PM, DrBloodmoney wrote: > On Wed, Nov 23, 2011 at 2:01 PM, Jeff Heard > wrote: > > I have several django apps. all of which

Perhaps more of a general Python question, but..

2011-11-23 Thread Jeff Heard
never seem to show up. My project structure looks like this: GA pyramid project: /home/jeff/ga/ga_pyramid/ ga/ __init__.py# contains "import pyramid" pyramid/ models.py views.py tasks.py tests.py urls.py static/ templates/ GA dat

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
You have multiple licensing options. One of those licenses is the GPL. How that translates to "open source" is the source of an eternal flamewar that we'll quietly skip. If your organization permits GPL then you're fine. -- Jeff On Mon, Nov 21, 2011 at 11:43 PM, V

Re: Editable datagrid

2011-11-21 Thread Jeff Heard
o the grid, but I'm not 100% certain about that. -- jeff On Mon, Nov 21, 2011 at 11:46 AM, Vikas Rawal < vikasli...@agrarianresearch.org> wrote: > I am new to django and to web programming. I am trying to build a > database application for entering/querying/viewing data from a

Re: Question on cleaning ModelForms

2011-10-18 Thread Jeff Heard
ne from Django that > the location field cannot be NULL (which is true, it can't). > > Can anyone tell me how I'm supposed to be doing this? I want them to > enter an address on the form, not a latitude/longitude pair. > > -- Jeff > > > The point is, you

Question on cleaning ModelForms

2011-10-17 Thread Jeff Heard
tion field cannot be NULL (which is true, it can't). Can anyone tell me how I'm supposed to be doing this? I want them to enter an address on the form, not a latitude/longitude pair. -- Jeff -- You received this message because you are subscribed to the Google Groups "Djang

Re: Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
Thanks. That works! -- Jeff On Tue, Sep 13, 2011 at 11:13 AM, Shawn Milochik wrote: > You can use the post_delete signal in Django's signals. Then, assuming your > MongoDB collection name is derived from your model in a consistent manner > then you're all set. > &g

Is there a way to provide a delete-hook on a custom field?

2011-09-13 Thread Jeff Heard
instance's delete() function is called. Perhaps the best thing is just to have a class HybridModel(Model) and have all models that use both databases inherit from that? -- Jeff -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Problem with file upload!

2011-09-03 Thread Jeff Tchang
Can you verify that your request method is indeed a POST? Print it out if necessary. -Jeff On Fri, Sep 2, 2011 at 10:39 AM, Ludvig wrote: > Hello, > > Usually only read these posts so i hope i'm doing this right! > > Recently my file upload just stopped working, and i&#x

Re: Setting up a PostGIS DB

2011-09-03 Thread Jeff Tchang
Have you ran: psql -d yourdatabase -f postgis.sql After you do this you should see 1 or 2 tables in your Postgres database as well as a slew of sql functions. Make sure you've done this and verify it. -Jeff On Thu, Sep 1, 2011 at 2:18 PM, Reinout van Rees wrote: > > On 01-09-11 1

Re: ManyRelatedManager.add() acting funny?

2011-08-13 Thread Jeff Blaine
Nevermind. I get it. 'tags' has another field, description, which is what the extra u'' is for. -- 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/-/jnvlX18nW

ManyRelatedManager.add() acting funny?

2011-08-13 Thread Jeff Blaine
What happened here? Do I not understand .add()? I would have expected to see [(u'rcf_clients',)] not [(u'rcf_clients', u'')] >>> print d.tags.values_list() [] >>> d.tags.add('rcf_clients') >>> d.save() >>> print d.tags.values_list() [(u'rcf_clients', u'')] >>> -- You received this message bec

Re: REMOTE_USER authentication to 'Admin'?

2011-06-28 Thread Jeff Blaine
It's all right here: https://docs.djangoproject.com/en/1.3/howto/auth-remote-user/ and other details in the mailing list thread you are reading/posting to (this one!) -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on

Re: REMOTE_USER authentication to 'Admin'?

2011-06-27 Thread Jeff Blaine
Sorry, I have no knowledge of Oracle SSO, what it allows, how it works, etc. -- 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/-/kFeKEvDSqZYJ. To post to this g

Re: Making command-line clients to Django data

2011-06-24 Thread Jeff Blaine
Just a follow-up: Well, I took your advice and did it via manage command(s) with wrapper scripts for the users. It's working well so far. I do wish I had a clearer understanding of what the downside to the "standalone" method is, but I suspect I will never know unless I go out of my way and t

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Jeff Blaine
> > But why do you need to get that value via the *field* object? The usual way > to do it is simply to access the attribute directly on the model instance: > > unicode(dev.distro) > > or, if you have the field name as a string as you imply originally, use > `getattr`: > > unicode(getatt

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Jeff Blaine
On Tuesday, June 21, 2011 11:00:37 AM UTC-4, Tom Evans wrote: > > On Tue, Jun 21, 2011 at 3:47 PM, Jeff Blaine wrote: > > Any ideas? I really want (concept) > > "myfield.unicode_representation_of_object(myobject)" > > > > unicode(myobject.myfield) // unic

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Jeff Blaine
Okay, here's the problem. >>> f = dev._meta.get_field('distro') >>> f.value_from_object(dev) 2L value_from_object is defined as: def value_from_object(self, obj): "Returns the value of this field in the given model instance."

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-21 Thread Jeff Blaine
Yes, seems that way, Malcom, but *why* class Device(models.Model): # ... status = models.ForeignKey(Status, blank=True, null=True, verbose_name="Status",

Re: Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-20 Thread Jeff Blaine
PS: Django 1.3 -- 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/-/Moc8-Pa5qJ4J. To post to this group, send email to django-users@googlegroups.com. To unsubscr

Strange value_from_object() return value (2L returned instead of unicode string)

2011-06-20 Thread Jeff Blaine
I can't seem to figure out what is causing this: According to the following 2 models and the 'python manage.py shell' session shown after them, I am getting 2L as a return value from a certain call when I would expect u'redhat 5.6' or similar. If anyone has any ideas, please let me know. I am

Re: How do I access a field's verbose_name?

2011-06-20 Thread Jeff Blaine
Here's what I came up with, in case someone else finds this useful. I'm quite proud, actually. from django.core.management.base import BaseCommand, CommandError from hostdb.models import Device, Interface def sanitized_value(v): if v == None: return "" return v class Command(Bas

Re: How do I access a field's verbose_name?

2011-06-20 Thread Jeff Blaine
Thanks all. For anyone coming across this later, some enlightening noodling. All sorts of good stuff in there, as Shawn indicated! >>> from hostdb.models import Device >>> dir(Device._meta) ['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__ini

Re: How do I access a field's verbose_name?

2011-06-20 Thread Jeff Blaine
On Monday, June 20, 2011 11:56:00 AM UTC-4, Shawn Milochik wrote: > > On 06/20/2011 11:54 AM, Jeff Blaine wrote: > > I'd like to make use of a field's verbose_name in some code instead of > > duplicating that sort of info. Can someone show me how? > > > >

How do I access a field's verbose_name?

2011-06-20 Thread Jeff Blaine
I'd like to make use of a field's verbose_name in some code instead of duplicating that sort of info. Can someone show me how? -- 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

Re: Making command-line clients to Django data

2011-06-13 Thread Jeff Blaine
> > Why not? To want a decent CLI integrated with your app, but without using > management commands, is a pretty dumb idea. > It's not how we want the end-users to interface with it. Why is it a dumb idea? -- You received this message because you are subscribed to the Google Groups "Django

Making command-line clients to Django data

2011-06-13 Thread Jeff Blaine
We've got our Django site complete for now. It consists entirely of just a customized default "admin" setup. We'd like to develop some command-line interfaces to the data. Is there a good/best approach to doing this? Can I (recommended?) use templates for formatting text to the terminal? Any

Re: REMOTE_USER authentication to 'Admin'?

2011-05-19 Thread Jeff Blaine
Thanks Jacob and Ramiro. I finally figured it out, and unfortunately it was, of course, something stupid :( I had changed the directory name holding my WSGI app and had not changed the Apache config's path reference in *both* places (ScriptAlias and Directory). SIGH. That was causing the stati

Re: REMOTE_USER authentication to 'Admin'?

2011-05-19 Thread Jeff Blaine
I'm kind of at the point where I consider this a bug in some fashion, regardless of my specific problem (which persists). AUTHENTICATION_BACKENDS = ( 'mybackends.MyRemoteUserBackend', ) If I define AUTHENTICATION_BACKENDS in settings, no default fallen back on. If my hand-specified stuff do

Re: REMOTE_USER authentication to 'Admin'?

2011-05-18 Thread Jeff Blaine
I'm failing so far. I copied backends.py to my project root as mybackends.py I edited it and renamed ModelBackend to MyModelBackend I changed RemoteUserBackend(ModelBackend) to MyRemoteUserBackend(MyModelBackend) I changed settings.py to: AUTHENTICATION_BACKENDS = ( 'mybackends.MyRemoteUse

Re: REMOTE_USER authentication to 'Admin'?

2011-05-17 Thread Jeff Blaine
Also, FWIW, the REMOTE_USER is definitely getting set to 'jblaine' 1xx.xx.xx.231 - jblaine [17/May/2011:16:12:41 -0400] "GET /static/admin/img/admin/nav-bg.gif HTTP/1.1" 200 273 "http://rcf-hostdb.our.org/admin/"; "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/4.0; SLCC2; .N

Re: REMOTE_USER authentication to 'Admin'?

2011-05-17 Thread Jeff Blaine
On Tuesday, May 17, 2011 3:10:03 PM UTC-4, Jacob Kaplan-Moss wrote: > > On Tue, May 17, 2011 at 2:00 PM, Jeff Blaine wrote: > > That gets us somewhere, because authenticating to Apache/LDAP as jblaine > > did NOT make a Django user jblaine. > > That's interesting

Re: REMOTE_USER authentication to 'Admin'?

2011-05-17 Thread Jeff Blaine
[ *sigh* - I wish the web UI to google groups had an 80-column marker. ] [ Sorry for the formatting in the previous message. I'm used to hitting ] [ enter. ] Thanks for the reply, Jacob. That gets us somewhere, because authenticating to Apache/LDAP as jblaine did NOT make a Django user jblaine.

REMOTE_USER authentication to 'Admin'?

2011-05-17 Thread Jeff Blaine
Hi folks, I'm successfully using Apache with mod_authnz_ldap, WSGI, Django 1.3. If I hit '/admin', I get asked to authenticate (BasicAuth done through LDAP). I succeed. However, this just results in me then seeing the Django admin login screen instead of logging me in to Admin. What am I mis

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 6:33:20 PM UTC-4, Jacob Kaplan-Moss wrote: > > On Tue, May 3, 2011 at 5:07 PM, Jeff Blaine wrote: > > Thanks Jacob -- does the site entry in the database have to be anything > > specific? We don't really use that. Just put any old thing in the

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 4:42:25 PM UTC-4, Jacob Kaplan-Moss wrote: > > Hi Jeff -- > > To make the admin work w/r/t sites, you'll need three things: > > * An entry in the sites table. > * A setting SITE_ID set to the ID of the Site entry you'd

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
I'd certainly like to hear more about this, but I got it all working fine by commenting out 'django.contrib.sites' from INSTALLED_APPS That's obviously not the right solution... -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this g

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
Also, adding an example.com site (via /admin via dev server) doesn't change the behavior. Same error. I'm not sure if that's what you were suggesting to do or not. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send e

Re: Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
On Tuesday, May 3, 2011 2:03:14 PM UTC-4, Daniel Roseman wrote: > > I don't know why you think this is a WSGI error. As you say, Apache is > finding your WSGI app with no problem, and the error you get is a Django one > - you simply don't seem to have any data in your Site table, whereas the > D

Stuck at integration step w/ WSGI

2011-05-03 Thread Jeff Blaine
I've read the following and am still stuck and wondering what piece of this puzzle I am missing. If anyone has any ideas, please do comment! http://docs.djangoproject.com/en/1.3/howto/deployment/modwsgi/ http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango Using the Django 1.3 developme

Re: .save() works with no (custom, not 'id') primary key specified?

2011-04-29 Thread Jeff Blaine
Thank you both. That's a great explanation, Jacob. I'll consider your message more closely and play around on Monday a bit. PS: I said it *seems* broken to me, as in "Maybe I just don't understand the reason.", which I clearly didn't :) -- You received this message because you are subscribed

<    1   2   3   4   5   6   7   >