On Feb 28, 12:21 pm, Simon Davies wrote:
> figured out how to do it using the get_form method like this:
>
> class AccessoryStockOrderAdmin(admin.ModelAdmin):
> form = AccessoryStockOrderForm
> def get_form(self, request, obj=None, **kwargs):
> form = super(AccessoryStockOrderAdm
I don't see much reason to keep Payment method separate from the Orders
class then. For each order, you can have a different payment method, so just
make a payment method column in the Orders model. Like this:
payment_method_choices = (
('$$', 'Cash'),
('cc', 'Credit Card'),
)
class Order
On Sun, Feb 28, 2010 at 5:13 PM, Andrej wrote:
> I want to use the Admin module to pre-set default values when creating
> the form. For example, in the gender case, I want to have default
> "Unknown" option. Is this this not possible?
It is possible; all you have to do is specify the choices you
Thank you. That is exactly what I did in my production environment -
I manually created the application directory.
I used the startapp command on my development box, and thus got the
error message.
Thanks again for clarifying.
On Feb 28, 4:41 pm, Russell Keith-Magee
wrote:
> On Sun, Feb 28,
It looks like the mark-up used for the RadioSelect widget is
incorrect.
For example:
from django import forms
class PersonForm(forms.Form):
GENDER_OPTIONS = (
('M','Male'),
('F','Female'),
)
gender =
forms.ChoiceField(widget=forms.RadioSelect(),choices=GENDER_OPTION
If it's on your local machine there is no big sense to use ssl unles you are
paranoid. If someone can sniff local traffic, then ssl is useless.
Anyway, as Janusz said http://www.stunnel.org/
On Mon, Mar 1, 2010 at 1:06 AM, Janusz Harkot wrote:
> So you can use stunnel: http://www.stunnel.org/
>
>
On Sun, Feb 28, 2010 at 3:33 PM, Anthony wrote:
> I've got my app deployed on my production server where the application
> name == site name. (It's running fine.)
>
> I copied it down to my development machine and tried to set up the
> same thing ('python manage.py startapp [appname==sitename]'),
On Mon, Mar 1, 2010 at 2:04 AM, Michael Shafrir wrote:
> Can a date be loaded into a DateField using Django's loaddata admin
> feature? I have a JSON file that I'm using to bulk load data into my
> app. When you dumpdata, date fields are outputted in the format -
> mm-dd. However, if you try l
no, but you can do this very easy on the fronted-webserver (nginx,
apache, cherokee etc.)
J.
--
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, sen
So you can use stunnel: http://www.stunnel.org/
J.
--
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...@googl
I'm having trouble seeing PendingDeprecationWarning's on stderr when
using the dev server.
To make sure I'm not crazy, I wrote a simple Python program that looks
like this:
print "** WARNING **"
import warnings
warnings.warn(
"Testing the warnings module!",
I'm not using Apache on my development machine and I don't want to use
it. I enjoy the low headache factor of runserver. But it'll be nicer
if it served through https as well.
On Mar 1, 12:53 am, Andrej wrote:
> because you need to load apache ssl gear. Set up your normal virtual
> host and then
I want to use the Admin module to pre-set default values when creating
the form. For example, in the gender case, I want to have default
"Unknown" option. Is this this not possible?
On Feb 28, 6:00 pm, James Bennett wrote:
> On Sun, Feb 28, 2010 at 4:42 PM, Andrej wrote:
> > Shouldn't this work?
On Sun, Feb 28, 2010 at 4:42 PM, Andrej wrote:
> Shouldn't this work? It's a tuple.
>
> gender = models.CharField(_('Gender'), max_length=1,
> choices=GENDER_CHOICES, default=GENDER_CHOICES[2])
>
> It doesn't.
> I smell black magic!
The value that goes in 'default' is the actual DB value you'd wa
because you need to load apache ssl gear. Set up your normal virtual
host and then use reverse proxy:
ProxyPass / http://localhost:8000/
ProxyPassReverse / http://localhost:8000/
On Feb 28, 5:09 pm, cool-RR wrote:
> Why doesn't runserver automatically serve in https as well as http? It
>From the docs:
GENDER_CHOICES = (
('M', 'Male'),
('F', 'Female'),
)
Shouldn't this work? It's a tuple.
gender = models.CharField(_('Gender'), max_length=1,
choices=GENDER_CHOICES, default=GENDER_CHOICES[2])
It doesn't.
I smell black magic!
Please help :)
--
You received this message
Thanks for the reply, that definitely works, and it's within the MVC
paradigm.
On Feb 28, 3:14 pm, sc...@thereceptor.net wrote:
> > Greetings,
>
> > Django is awesome! I'm playing around and I was wondering if there is
> > a way to specify conditional validators in the model.
>
> > Example: if fie
Why doesn't runserver automatically serve in https as well as http? It
would have been useful.
Ram.
--
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 gro
Does `admin` provide a way to force using it through https? I'd want
it to simply redirect a user which doesn't use https to the same
address, except with https instead of http.
Is there something like this built into `admin`?
Ram.
--
You received this message because you are subscribed to the
figured out how to do it using the get_form method like this:
class AccessoryStockOrderAdmin(admin.ModelAdmin):
form = AccessoryStockOrderForm
def get_form(self, request, obj=None, **kwargs):
form = super(AccessoryStockOrderAdmin, self).get_form(request,
obj, **kwargs)
if o
> Greetings,
>
> Django is awesome! I'm playing around and I was wondering if there is
> a way to specify conditional validators in the model.
>
> Example: if field x is blank, field y is required.
>
> Thanks for your help!
You might consider making a ModelForm and then adding cleaner methods.
For
I'll take a guess: one of your apps, middleware or possibly even a
management command is generating this text.
Grep for it in your source code, and remove/disable.
Malcolm
On Sat, Feb 27, 2010 at 4:34 AM, Russell Keith-Magee wrote:
> On Sat, Feb 27, 2010 at 4:07 AM, Joel Stransky
> wrote:
>
(r'^static/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
the diffirence.
(r'^static_media/(?P.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT}),
Thanks a lot!! :-)
It cost me one day this tiny problem..
--
You received
Greetings,
Django is awesome! I'm playing around and I was wondering if there is
a way to specify conditional validators in the model.
Example: if field x is blank, field y is required.
Thanks for your help!
--
You received this message because you are subscribed to the Google Groups
"Django
Read your settings.py file carefully:
- you've said that the MEDIA_URL is /
- but that Django is only configured to serve static content from /static
So when the photo is uploaded, it's stored in /photos/x.jpg,
which you've told Django is accessible via the URL /photos.
But this gives http://exa
Can a date be loaded into a DateField using Django's loaddata admin
feature? I have a JSON file that I'm using to bulk load data into my
app. When you dumpdata, date fields are outputted in the format -
mm-dd. However, if you try loading data back in with the same format,
the field is treated a
I don't know if you can do it directly using the ordering metadata - easiest
way to find out is to try it and see.
If not, I'd suggest a customer manager on the Gallery that returns the
photos in order so that the line:
Gallery.photos.all()
refers to your customer manager that "does the right th
Hi people,
I started working on an image gallery with Django and I'm stuck. I
suppose that my static files on the development server are not
configured properly.
I have the following models.py code:
from django.db import models
from PIL import Image
class Photo(models.Model):
name = models
Alexis Selves wrote:
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
> In my template I am linking jquery :
>
>
>
where do you have your static files? did you serve them as static files?
maybe ur only missi
On Sun, Feb 28, 2010 at 5:39 PM, Alexis Selves wrote:
> Hello,
> I am totally helpless. I am trying to use JQuery in my django
> templates, but I always get in firebug this: $ not defined.
>
Check with Firebug if the jquery script has been successfully loaded (using
either the CSS or Net tabs)
Hello,
I am totally helpless. I am trying to use JQuery in my django
templates, but I always get in firebug this: $ not defined.
In my template I am linking jquery :
And then
$(document).ready(function() {
alert("Hello from jQuery");
});
But I always get nothing..
using ubuntu 9.
The user needs to be able to manually position the photos in the
gallery (using drag and drop, for example). A photo can exist in
multiple galleries, which is why the join model GalleryPhoto is
required (and this is where the position gets stored).
On Feb 27, 7:36 pm, Prabhu wrote:
> What is wro
Thanks guys. It appears using URLField is the best answer here.
It automatically prepends http:// if the url doesn't include that.
On Feb 27, 7:27 pm, Prabhu wrote:
> If you use URLField it should do the trick. Just prefix http:// if it
> doesn't exist already using javascript.
>
> On Feb 26, 9:3
OK thanks. I didn't realise that was the implication of the
related_name field. All working as expected now.
Thanks, Ben
On 28 Feb, 13:16, Daniel Roseman wrote:
> On Feb 28, 11:46 am, Ben Dowling wrote:
>
>
>
> > I have a Thread and a Message model, as defined below:
>
> > class Thread(models.M
Unfortunately that didn't do the trick.
The strange thing is that the same code is working on another server.
We just migrated everything to a new server environment,
making it sound to me that there might be something different in
versions installed.
could anyone point me to the actual method th
On Feb 28, 7:07 am, sinanjj wrote:
> hello everyone.
> I am doing a GIS related project, with django.
> There is a question that how to get the one-to-one relation class's
> name of a class?
> for example:
> class Thing(models.Model):
> lat = models.FloatField(default=0.0)
> lng =
On Feb 28, 11:46 am, Ben Dowling wrote:
> I have a Thread and a Message model, as defined below:
>
> class Thread(models.Model):
> modified = models.DateTimeField(auto_now=True, auto_now_add=True)
>
> class Message(models.Model):
> subject = models.CharField(max_length = 100)
>
I have a Thread and a Message model, as defined below:
class Thread(models.Model):
modified = models.DateTimeField(auto_now=True, auto_now_add=True)
class Message(models.Model):
subject = models.CharField(max_length = 100)
thread = models.ForeignKey(Thread, related_name='t
Ok, I'll change my database charset.
Thanks
On Feb 27, 1:06 pm, jul wrote:
> hi,
>
> when submitting some characters in a charfield of a django form I get
> the following error (e.g. when submitting 'ś')
>
> (1267, "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and
> (utf8_general_ci,COE
Hi
I have a model which I access from the admin application. I want to
exclude some fields dynamically.
My model looks like this:
class StockOrder(models.Model):
number_of_items_pending_order =
models.PositiveIntegerField(max_length=5, default=1)
number_of_items_ordered = models
I checked the ROOT_URLCONF and it was fine, and deleted all the *.pyc,
without good results, but finally I found the problem. There was a
copy of the same project in some other folder under the PYTHONPATH, so
there was some kind of collision.
Thanks everybody for helping me out.
On Feb 28, 1:57 am
hello everyone.
I am doing a GIS related project, with django.
There is a question that how to get the one-to-one relation class's
name of a class?
for example:
class Thing(models.Model):
lat = models.FloatField(default=0.0)
lng = models.FloatField(default=0.0)
class Streetlight(mod
42 matches
Mail list logo