Re: Admin site and ModelAdmin

2018-05-03 Thread jt . oldnews
Thanks for the response Mike.

I generally don't like it when a design has to change to fit a framework, 
however, in this case I decided to try your solution. I ran into a couple 
of problems though :-(
 1) The fields that I'm looking up were required fields. Validation failed 
and error messages were displayed until I changed my model to not require 
those fields (which creates other problems I'd need to fix). Is there a way 
to hook in before validation? I over-road the model save function. Would 
the pre-save signal method fix this problem? Or maybe ModelAdmin.save_model?
 2) The desired result of the lookup would be to display the change form so 
that the information could be verified. In other words, if doing the 
lookup, 'SAVE' (and 'Save and add another') should behave as if 'Save and 
continue editing' had been selected.


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/26f88b4c-b2dd-4bce-aea7-d885295aa609%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Admin site and ModelAdmin

2018-05-02 Thread jt . oldnews
I'm new to Django and web development in general (C++ background) and I've 
got amazingly far very quickly, but there's one thing I've been struggling 
with for a couple days now :-(. Forgive me if I screw up the lingo.

I've got a ModelAdmin page for registrants of a conference which has fields 
for Employee ID, Name, email etc. The registrant does not have to be an 
employee, but if they are I could lookup their name, email etc. from an 
external source (already have the Python code for this). I'd like to have a 
button next to the employee id field which would lookup the employee's 
details and fill in the appropriate fields. This seems to me that it 
shouldn't be too hard but I am spinning my wheels here.  Do I need to ditch 
ModelAdmin?  Can someone please point me in the right direction.

Thanks,
JT

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1324e38c-ed15-4f3c-8e1e-cd7df220b96e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: enable admin gives error

2010-11-05 Thread jt
Thank you very much Russ,
the missing comma was indeed the problem.  Having corrected my syntax
it runs fine. :D
jt

On Nov 5, 12:25 am, Russell Keith-Magee <russ...@keith-magee.com>
wrote:
> On Fri, Nov 5, 2010 at 11:59 AM, jt <jim.iro...@gmail.com> wrote:
> > Hi,
> > I'm just starting out.  Things ran fine until I uncomment out:
> > (r'^admin/', include(admin.site.urls))
> > in my urls.py file.  When I access my local site from the development
> > server. I get:
> > * Exception Type: TypeError
> > * Exception Value: 'tuple' object is not callable.
>
> As a general rule, this error means that you've forgotten a comma
> somewhere in a list of tuples. As a result of the missing comma,
> Python thinks the set of brackets after the missing comma indicates a
> function call on the contents of the set of brackets before the
> missing comma, and reports the error that the contents of the first
> set of brackets isn't callable. If we look at your urls.py, we see:
>
> >    (r'^People/$', 'iFriends.People.views.index')
>
> You've missed the comma on the end of this line.
>
> Yours,
> Russ Magee %-)

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



enable admin gives error

2010-11-05 Thread jt
Hi,
I'm just starting out.  Things ran fine until I uncomment out:
(r'^admin/', include(admin.site.urls))
in my urls.py file.  When I access my local site from the development
server. I get:
* Exception Type: TypeError
* Exception Value: 'tuple' object is not callable.
My urls.py file contains:
from django.conf.urls.defaults import *

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
(r'^People/$', 'iFriends.People.views.index')

# Example:
# (r'^iFriends/', include('iFriends.foo.urls')),

# Uncomment the admin/doc line below to enable admin
documentation:
# (r'^admin/doc/', include('django.contrib.admindocs.urls')),

# Uncomment the next line to enable the admin:
(r'^admin/', include(admin.site.urls)),
)
 thanks in advance for any help.
jt

-- 
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.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



admin media configuration

2006-03-07 Thread jt

Hello,

I'm using the Admin and want to change some css/img/js from my projects
directory.
I copy the whole media directory to my projects directory but I am not
able to use it from a webapps.

I added this line to my urls.py:
(r'^media/(?P.*)$', 'django.views.static.serve',
{'document_root': 'media', 'show_indexes': True}),
but the web server still serves media from /usr/lib/...
Apparently it is due to the ADMIN_MEDIA_PREFIX = '/media/' in the
settings.py .

How do I have to alter MEDIA_ROOT, ADMIN_MEDIA_PREFIX and urls.py in
order to have my local admin css/img/js served correctly? (without
hardcoding anything in templates)

my conf:
Django-0.91-py2.4, with builtin http server
pysqlite-2.0.7-py2.4, with sqlite3

-- 
jt


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~--~~~~--~~--~--~---