I am trying to create my own Dojo-aware Django widgets. I have defined
the following
class DojoDateWidget(forms.widgets.DateTimeInput):
format = '%Y-%m-%d'
def __init__(self, *args, **kwargs):
kwargs.setdefault('attrs', {}).update({'dojoType':
"dijit.form.DateTextBox",
I have several views which generate some JSON data. They all end
something like this:
response = HttpResponse(pie_data, mimetype='application/json')
response['Content-Disposition'] = 'attachment;
filename=my_pie_chart.json'
Where "pie_data" is holding some generated JSON data that I wish to
send
I know of the "standard" way of serving static files in Django for
development purposes, but I want to create my own function which reads
the contents of a file then serves it to the user (I want to put some
security around the downloading of the file).
What is the best way to accomplish this?
--
I am planning to create a series of widgets for Dojo. I just need a
little help getting started:
First, I need to know how to set custom attributes in a widget. The
most important thing to set is "dojoType." For most widgets, I plan to
use the TextInput widget as my base.
Secondly, I would like
Worked like a charm. It was the ModelChoice field. It was trigging the
errors because of the initial value I was setting.
On Feb 20, 7:48 pm, Malcolm Tredinnick
wrote:
> On Fri, 2009-02-20 at 19:32 -0800, mediumgrade wrote:
> > So, I have a form like this:
> >
> > class A
So, I have a form like this:
class AddUserForm(forms.Form):
username = forms.CharField(label='Username', required=False)
password1 = forms.CharField(label='Password',
widget=forms.PasswordInput)
password2 = forms.CharField(label='Password (Again)',
widget=forms.PasswordInput)
firs
Currently, I have a series of models which look something like this:
class make(model.Models):
name = models.CharField()
class model(model.Models):
name = models.CharField()
make = models.ForeignKey(Make)
class claim(models.Model):
make = models.ForeignKey(Make)
model = mod
Thanks a lot, James.
On Apr 1, 12:22 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 3/31/07, mediumgrade <[EMAIL PROTECTED]> wrote:
>
> > I have a model with charfield's with choices attached to them. In my
> > templates, however, I would like
I am writing an app that makes heavy use of generic views. I have
several forms which include date fields and I want to know how to
attach a widget to the field for entering the date (like the one used
in the admin site).
Am I making sense?
--~--~-~--~~~---~--~~
I have a model with charfield's with choices attached to them. In my
templates, however, I would like to be able to display the values from
the dictionary list in my models, not just the value stored in the
database.
Am I making sense?
--~--~-~--~~~---~--~~
You r
Totally fixed me up. Thanks!
On Mar 19, 9:33 am, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 3/19/07, mediumgrade <[EMAIL PROTECTED]> wrote:
>
> > I am not sure what the difference is between RequestContext and
> > Context (I am still fairly new t
I am writing an app that makes heavy use of generic views. I have
several forms which include date fields and I want to know how to
attach a widget to the field for entering the date (like the one used
in the admin site).
Am I making sense?
--~--~-~--~~~---~--~~
I am writing an app that makes heavy use of generic views. I have
several forms which include date fields and I want to know how to
attach a widget to the field for entering the date (like the one used
in the admin site).
Am I making sense?
--~--~-~--~~~---~--~~
return render_to_response('index.html')
This is just a basic place holder for now as I am developing the
application. Is there something wrong with this method?
On Mar 19, 5:29 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> On Mar 19, 4:11 am, "mediumgrade" <
So, I am writing my first Django app that requires some form of
authentication, and I have run into a bit of a snag:
I authenticate the user via the 'django.contrib.auth.views.login' view
using a login template like this:
{% block main_section %}
{% if form.has_errors %}
Your username and pas
I found this:
http://python.about.com/od/advancedpython/ss/howtocal.htm
--~--~-~--~~~---~--~~
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 u
I have written an application that keeps track of appointments for my
technicians. My partners would like to be able to view the appointments
in a "calendar-like" format which can be viewed and/or printed. Am I
making sense? Is there already some kind of library in Django and/or
Python that does
Alright, I have a simple Work Order entry system. I want to add a
boolean field to the system. How is this done if there is already data
in the system? Can I just add it to the model, then run syncdb? Should
I add it to the model, then manually add it to the database? Is there a
documented approa
In, n my views, I could do something like app.user = request.user? Can
I get all information for the currently logged in user?
nymbyl wrote:
> To say "Hello, Person's name!" you can do "Hello, {{ user.username
> }}!":
> http://www.djangoproject.com/documentation/authentication/#authentication-d
In my application, I have an object which has a foreign key to the
django users table. Is there an environment variable that I can use to
get information on the currently logged-in user? For example, if I want
the main page to display "Hello, Person's Name!" or if I want my
objects to have the use
Great! 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-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
Thanks, Ricardo. That was 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 to
I am trying to setup my django site using mod_python and apache.
My Django project is called "autosales" and it works just fine when
accessing it from the development web server. However, when I try to
access it from apache, I get the following error
EnvironmentError: Could not import settings '
In my models, I have added the options "verbose_name" and
"verbose_name_plural" to make my models easier to understand in the
admin interface. However, even though I have added these options in my
models, the admin interface still displays the model's name in the
default camel case style. Is there
Don't know if this is a Django question or not, but here is the
situation:
I am developing an application for a client who is a automobile broker.
He wants agents to submit requests for vehicles from the web. The agent
will be able to select the make/model of the vehicle. What I want is
for the m
I like this solution:
http://code.djangoproject.com/wiki/CookBookManipulatorWithPostpopulatedFields
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-
So, I have a model which looks like this:
STATUS_TYPES = (
(1, 'Attending'),
(2, 'Not Attending'),
(3, 'Tentatively Attending'),
(4, 'Tentatively Not Attending'),
(5, 'No response'),
)
class Recipient(models.Model):
name = models.CharField(maxlength=50)
persons = mode
And I am a 'tard.
I had pluralized the name of my author foreign key so that the actualy
name of the foreign key was "authors" and not "author". Once I used {{
entry.authors.name }}, everything was fine.
Still learning here,
Dave
--~--~-~--~~~---~--~~
Yo
ing my problem clearly.
Ivan Sagalaev wrote:
> mediumgrade ÐÉÛÅÔ:
> > I have a simple blog app that I am working on. In this app, I have
> > ojects for each entry as well as the author who wrote it. I wrote a
> > simple view which displays a list of all entrys made, but I w
I have a simple blog app that I am working on. In this app, I have
ojects for each entry as well as the author who wrote it. I wrote a
simple view which displays a list of all entrys made, but I want that
list to include the name of the author. Since the author's name is not
part of the entry, ho
30 matches
Mail list logo