Need help using ExtJS in Django

2010-11-18 Thread codingJoe
Newbie question here... I know the basics of Django and nothing of
ExtJS.  I am running a simple web framework and I want to integrate
ExtJS Grid into it.

My first step was to run the example grid from extjs.  "Yay!!  It
works"

Then I wanted to render that same working example inside my django
app.  here's what I did.
   1.  Put the extjs3.0.0 directory structure under my 'app/static'
directory
   2.  Made sure that each of these loads based on the same calls in
extjs package (No 404's)
   3.  Render the grid.  This part simply won't work and I'm not sure
what to do next?

The point of confusion is in array-grid.html: 
I see where array-grid.js is supposed to render that.  But it just
isn't happening and I'm strugging to figure out why.

Any advice to help me work through this problem?

Thanks!  T

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



Can Admin Widgets be used in non-admin templates?

2010-11-11 Thread codingJoe
Hi all,

Django newbie question here.  I am building some pages to let my users
manage lists of data.  I really like the look, feel, and behavior, of
the admin pages.  But I can't give my users that much control.  Is
there a way to reuse the admin widgets in non-admin pages?   I want to
give them limited filter, find, and editing capabilities for only a
few tables.  Are there any examples how to do this?

Thanks!

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



How can I pre-filter the content that goes into the ModelAdmin.filter_horizontal

2010-11-01 Thread codingJoe
Tricky little problem here.  I am using horizontal_filter to assign a
massive amount of students to their advisors.
The horizontal filter works, but I see students from the entire
district.How can I pre-filter the data going into the
filter_horizontal widget to only show students at the Advisor's
school?

Any advice on this and the model is helpful.

class Student(models.Model):
  student_id = models.CharField(max_length=20, primary_key=True)
#school assigned student id
  gender = models.CharField(max_length=1, choices=GENDER_CHOICES)
  last_name = models.CharField(max_length=30)
  first_name = models.CharField(max_length=30)
  grade = models.IntegerField()
  school = models.ForeignKey(School)

#Advisors have a primary school, but can also support many schools.
class Advisor(models.Model):
  last_name = models.CharField(max_length=20)
  first_name= models.CharField(max_length=20)
  primary_school = models.ForeignKey(School)
  school = models.ManyToManyField(School,
related_name='school_advisor')
  student = models.ManyToManyField(Student,
related_name='student_advisor')
  email = models.EmailField()

class School(models.Model):
  school_name = models.CharField(max_length=200)
  school_num = models.IntegerField()


class AdvisorAdmin(admin.ModelAdmin):
  # How can I prefilter this set of students to only show students
  # where student.school = teacher.primary_school
  # currently I see all the students in the district
  filter_horizontal = ['student']

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



Need help with django url errors

2010-10-17 Thread codingJoe
All,

I am working through the django tutorial on the bitnami stack and am
having difficulty getting my urls to work properly.  The following
references the tutorial part 3 - Poll details.I suspect the
problem may be that the bitnami stack uses apache.  But I have no idea
how to configure apache and django to run the tutorial properly.

1.  I enter the following into my browser:  http://192.168.1.6:8080/polls/

   Response is a 404 error:

   Using the URLconf defined in mysite.urls, Django tried these URL
patterns, in this order:
  1. ^polls/
  2. ^admin/doc/
  3. ^admin/
   The current URL, , didn't match any of these.

Question:  Clearly 'polls' is in both the url and the files below.
How do I configure this?

begin mysite/urls.py 
# Uncomment the next two lines to enable the admin:
4 from django.contrib import admin
5 admin.autodiscover()
6
7 urlpatterns = patterns('',
8   # Example:
9   # (r'^mysite/', include('mysite.foo.urls')),
   10   (r'^polls/', include('polls.urls')),
   11   (r'^admin/doc/',
include('django.contrib.admindocs.urls')),
   12   (r'^admin/', include(admin.site.urls)),
   13 )

end mysite/urls.py 


begin mysite/polls/urls.py 
 1 from django.conf.urls.defaults import *
2 from django.contrib import admin
3
4 admin.autodiscover()
5
6 urlpatterns = patterns('',
7   (r'^polls/$', 'polls.views.index'),
8   (r'^polls/(?P\d+)/$', 'detail'),
9   (r'^polls/(?P\d+)/results/$', 'results'),
   10   (r'^polls/(?P\d+)/vote/$', 'vote'),
   11   (r'^admin/doc/',
include('django.contrib.admindocs.urls')),
   12   (r'^admin/', include(admin.site.urls)),
   13 )

begin django.conf 
# Note:  Tried adding polls to line 3 but that didn't help.
1
2 WSGIScriptAlias /mysite "/Applications/djangostack-1.2.3-0/apps/
django/conf/django.wsgi"
3 WSGIScriptAlias /polls "/Applications/djangostack-1.2.3-0/apps/
django/conf/django.wsgi"
4
5 
6 Order deny,allow
7 Allow from all
8 

end django.conf 

begin django.wsgi 
 import os, sys
2 sys.path.append('/Applications/djangostack-1.2.3-0/projects')
3 sys.path.append('/Applications/djangostack-1.2.3-0/projects/
mysite')
4 os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
5
6 import django.core.handlers.wsgi
7
8 application = django.core.handlers.wsgi.WSGIHandler()

end django.wsgi 

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



Need Example/Tutorial - building a datagrid into a django app built on Google AppEngine

2010-04-12 Thread codingJoe
Rookie programmer here, so please excuse if this is the wrong forum.

I have a simple app on Google Appengine that uses the built in django
template system.   This displays the data great, the forms, work etc.

What I really want is a way to edit the data within a table interface,
like a datagrid.  I have no idea how to do this, or where to begin.
The key is that it needs to display and modify objects in Google's
db.Model.

Advice?  Can someone point me to an example/or tutorial on how to do
this?

Thanks!

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



Can a django form render a javascript (interactive) calendar?

2009-12-15 Thread codingJoe
I'm specifically using Google AppEngine, but this seems like this is
more a django question.

I need an my template to render an interactive Table that someone can
click a date, or "Today".  The typical javascript calendar will do.  I
can do this without django, but I would like my form to automatically
render this.  Below is the current code I am using.

When the template is rendered a simple textbox is provided, with no
formatting guidance.  I would like the javascript calendar to assist
in picking the date and formatting the field.

Is it possible for django to render a javascript calendar?  How so?
If this is possible, a code snippet would be very helpful.

Note:  The only relevant documentation I can find is here:
http://docs.djangoproject.com/en/dev/ref/models/fields/#datefield
Which states:  The admin represents this as an 
with a JavaScript calendar, and a shortcut for "Today". The JavaScript
calendar will always start the week on a Sunday.

But, I don't see any javascript calendar, nor do I know how to
integrate one.

Thanks for any assistance or advice!

Joe


<-begin code>

# for illustrative purposes
class Registration(db.Model):
  courseName = db.StringProperty(required=True)
  startDate = db.DateProperty(required=True)


class RegistrationForm(djangoforms.ModelForm):
  class Meta:
model = Registration

... Template...

 
  {{ RegistrationForm }} 
 
  

< end code>

--

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.




Django Template Question

2009-04-05 Thread codingJoe

Up front, I'm not the most elegant coder, so please forgive.

  I have a page that is produced using django templates.   I used the
templates to do the header and footer, but now I'm down into the body
of the page.   Using the data from my template, I am able to fill the
first cell.

Is is possible to have the template do a request/response for other
data?  Or do I have to pass it all in when I build the page.   Analogy
would be an , but I don't want an image just
some text-based table data.   Or, a SharePoint WebPart that fits in a
table, but does its own thing.

{% block body %}
I am well within my body block...


  
 {{MyModel.A}}, {{MyModel.B}}   
   May Exist, May Not... Would like to pull data from another
request/response 
   May Exist, May Not... Would like to pull data from another
request/response  

{% end block %}

1.  If this is possible, how do I do it?   Simple example please.

2.  If this is poor coding, how is what I'm trying to do best
accomplished?
--~--~-~--~~~---~--~~
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.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



including text files with django tags?

2009-03-17 Thread codingJoe

My fist GAE app and I'm having problems importing a text file.   What
is the equivalent of the following include line in django?   If
nothing exists, how do I make that work?


   


I have a text file that I want the user to see in a scrolling text
area?

Thanks!

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