Problems creating custom multi-widget....

2009-11-21 Thread mediumgrade
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",

Can I tell IE not to cache data?

2009-09-17 Thread mediumgrade
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

Custom function to serve a static file with Django...

2009-05-06 Thread mediumgrade
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? --

Some help creating custom widgets...

2009-03-03 Thread mediumgrade
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

Re: Validation problems with formset_factory

2009-02-23 Thread mediumgrade
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

Validation problems with formset_factory

2009-02-20 Thread mediumgrade
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

Filtering one form field with value from another...

2009-01-15 Thread mediumgrade
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

Re: Using field choices in a template...

2007-04-08 Thread mediumgrade
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

Date field widget for generic views...

2007-03-31 Thread mediumgrade
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? --~--~-~--~~~---~--~~

Using field choices in a template...

2007-03-31 Thread mediumgrade
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

Re: Authentication Issues...

2007-03-24 Thread mediumgrade
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

Date field widget for generic views...

2007-03-23 Thread mediumgrade
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? --~--~-~--~~~---~--~~

Date field wiget for generic views...

2007-03-21 Thread mediumgrade
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? --~--~-~--~~~---~--~~

Re: Authentication Issues...

2007-03-19 Thread mediumgrade
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" <

Authentication Issues...

2007-03-19 Thread 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

Re: A calendar-like view in Django/Python...

2007-01-16 Thread mediumgrade
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

A calendar-like view in Django/Python...

2007-01-13 Thread mediumgrade
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

Changing Field names...

2006-12-28 Thread mediumgrade
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

Re: User Environment Variables

2006-09-12 Thread mediumgrade
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

User Environment Variables

2006-09-12 Thread mediumgrade
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

Re: verbose_name option not working...

2006-08-29 Thread mediumgrade
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]

Re: mod_python apache problems...

2006-08-29 Thread mediumgrade
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

mod_python apache problems...

2006-08-27 Thread mediumgrade
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 '

verbose_name option not working...

2006-08-26 Thread mediumgrade
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

Dynamic Menus...

2006-08-24 Thread mediumgrade
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

Re: Manipulators Question

2006-08-19 Thread mediumgrade
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-

Manipulators Question

2006-08-15 Thread mediumgrade
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

Re: Getting properties of parent objects into a template

2006-08-14 Thread mediumgrade
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

Re: Getting properties of parent objects into a template

2006-08-13 Thread mediumgrade
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

Getting properties of parent objects into a template

2006-08-13 Thread 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 want that list to include the name of the author. Since the author's name is not part of the entry, ho