On 5.06.2009 4:39, Karen Tracey wrote:
> My first thought would be to not store that value in a model at all, but
> rather pull it from the DB as max of the appropriate column when needed.
Yes, that would make things easier and more straightforward.
But some features that are easy with my setup
Another "in principle" question. My Street model is the parent of my
Property model, many to one via foreign key.
User selects the street and I store it in request.session. User then
gets to enter the property details in this form:
class PropertyForm(ModelForm):
class Meta:
You need to call form.save() after you validate the form.
As below:
def add(request):
if request.method == 'POST':
form = AddShow(request.POST)
if form.is_valid():
form.save()
return HttpResponseRedirect('/shows/#success')
return HttpResponseRedire
I'm still struggling a bit with related managers. I have what I think
should work right by the documentation but behavior isn't as expect.
I've pasted the actual code below but the basic deal is this.
I have a Project model which has Releases so Releases have a FK field
for Projects. I want to
On Thu, Jun 4, 2009 at 3:25 PM, Luc Saffre wrote:
>
> On 4.06.2009 19:46, Karen Tracey wrote:
> > Well the problems the test reveal with the in-memory Journal instance
> > having a stale lastnum after documents are deleted is a bit of a gotcha
> > with they way you have set this up. Though it's
Hi there,
I am struggling with the Historical Records model, which is introduced
in Apress' Pro Django book by Marty Alchin. (Apologies if this is off-
topic. I tried to contact the author but never got a reply)
In a nutshell, this is a very clever approach to keeping track of
changes in model
Hello Again,
In pursuing a solution to one problem, i seemed to have created
another. After playing around a bit with my dispatch.fcgi script, i
started getting django application errors. After some frustration i
restored my scripts to the half working state they were in when i had
started. How
I'm pretty new to Django and Python and I've had some success from
reading some books and guides playing around so far but I'm having
trouble figuring out how to get data I submit from a form to save into
the database. I've simplified down my code to just the basics and I
can get the form to submi
thank you!
--~--~-~--~~~---~--~~
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
http://docs.djangoproject.com/en/1.0/topics/forms/
--~--~-~--~~~---~--~~
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 grou
You have to put these in a forms.py files inside your app. They are
not database models, so syncdb is maybe ignoring the whole thing?
Hope that helps.
Fred
On Jun 5, 12:08 am, adrian wrote:
> I need to show Telephone and Address modelforms in the middle of
> another big form,
> so I decided to
I need to show Telephone and Address modelforms in the middle of
another big form,
so I decided to organize the big form into smaller modelforms and
display each in a separate fieldset.
This works well until the next time I clear the DB and run syncdb.
At that point,
syncdb completely ignores th
Do you think maybe the view is expecting a value from each one of the
dropdowns?
I had a similar problem with an input box and had to tell the view
what to do if there was no value submitted. Otherwise it would give
out an error.
I can't see from your code, but are you using POST or GET?
Cheers,
I've same problems when launching ./manage.py shell --plain
On 4 juin, 23:46, FranckB wrote:
> Does anyone experiences keyboard and autocompletion problems when
> running manage.py shell whith ipython ?
> It sounds very strange, if i run ipython i have no problem with
> browsing modules and usin
Does anyone experiences keyboard and autocompletion problems when
running manage.py shell whith ipython ?
It sounds very strange, if i run ipython i have no problem with
browsing modules and using addictive shortcuts like cursor keys, but
whithin a django project context i just can't use it, no
au
Thanks for replying so quickly.
It looks like you're right and the login page isn't actually logging
users in.
Any idea why that might be? I'm using the auth.login view and a
template that looks like this:
##login.html
{% extends "base.html" %}
{% block content %}
{% if form.errors %}
Your us
Hi,
I am running svn revision 10924 on Windows Server 2008 with Oracle 10g
release 2.
Using inspectdb, I created a model for an Oracle table. When I issue
.objects.all() for the new model, the records returned are
records added using either the Python interpreter or the Django
admin. None of t
actually, you need to do something like this:
user_stations = u.get_profile().station.all().values_list('pk',
flat=True)
excluded_stations = Station.objects.exclude(id__in=user_station_pks)
all_terrestrial_active_orders = Order.objects.filter(order_type=0,
in_market=True, end_date__gte=today)
ter
I wish there was an easy way to customize CheckboxSelectMultiple. The
widget library doesn't seem to have a well-defined customization
method beyond subclass, paste the superclass impl, and edit it. I
don't like the . I want to create a variant which shows thumbnails
for image choices.
On Jun 4,
The choices are sent to the kitchen and I suppose You also want to be
payed by the customer. You could think about using a database to hold
the customer's order. The kitchen could list all orders that have
status "to be cooked" and later use the orders that have status "to be
payed" to print the i
Great and thanks, on the road but will get these fixes done when I get
back on Monday. Thx !!!
--~--~-~--~~~---~--~~
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@g
On 4.06.2009 19:46, Karen Tracey wrote:
> Well the problems the test reveal with the in-memory Journal instance
> having a stale lastnum after documents are deleted is a bit of a gotcha
> with they way you have set this up. Though it's easily fixed in the
> test, I fear actual code that uses thes
answering my own question, seems like:
Order.objects.filter(Q(station=1), Q(station=2), Q(station=3))
-ryan
On Jun 4, 2:29 pm, ryan wrote:
> #models.py
> class Station(models.Model):
> station_name = models.CharField(max_length=20)
>
> class Order(models.Model):
> station = models.Many
#models.py
class Station(models.Model):
station_name = models.CharField(max_length=20)
class Order(models.Model):
station = models.ManyToManyField(Station, blank=True, null=True)
class UserProfile(models.Model):
user = models.ForeignKey(User, unique=True)
station = models.ManyToM
On Thu, Jun 4, 2009 at 12:52 PM, josebrwn wrote:
>
> Hi,
>
> I would like to have a list of recent flatpages. I'm doing something
> like:
>
> class LatestCmsNode(template.Node):
>def render(self, context):
>context['latest_cms'] = FlatPage.objects.all()[:2]
>
Hi,
I would like to have a list of recent flatpages. I'm doing something
like:
class LatestCmsNode(template.Node):
def render(self, context):
context['latest_cms'] = FlatPage.objects.all()[:2]
return ''
but this orders the results by url (title), and wh
I made a few changes to make it a bit more general-purpose. It now
uses @publicmethod instead of the horrific public__ notation.
However, the dispatcher class just checks if method.__class__.__name__
== 'publicmethod' and __public__ == True inside it.
This seems a bit odd but I'm not sure how to
I just tried the code and it worked for me (although I do work for the
NYT, so I hope it would!), so I'm guessing it's a Windows 7 issue -
perhaps it doesn't treat feedparser requests the same as other Python
scripts for purposes of requesting urls?
Derek
On Jun 4, 11:40 am, Jonathan Nelson wro
On Thu, Jun 4, 2009 at 9:39 AM, Luc Saffre wrote:
> Hello,
>
> here is a code example that illustrates how I plan to implement journals
> in an accounting application. The attached file models.py contains the
> details. I saved it (together with an empty __init__.py) in a new
> directory "journal
Thanks, I'll give it a shot.
J
On Jun 4, 8:06 am, Alex Gaynor wrote:
> On Thu, Jun 4, 2009 at 7:37 AM, Jonathan Nelson wrote:
>
>
>
>
>
>
>
> > I'm trying to add a feedreader element to my django project. I'm
> > using Mark Pilgrim's great feedparser library. I've used it before
> > without a
Just finished reading this book and found it really helpful as a
newbie to both Python and Django. The things I really liked about
this book:
- assumes I know very little
- intro to python programming just the right level of detail for me
- tutorials include plenty of real code examples
- gotchas
In your main urls.py you only have one regex matchin anything starting
with polls, so "/" does not match anything. If you type
http://127.0.0.1:8000/polls/
you should see your index.
On Jun 4, 6:45 pm, Ross wrote:
> I've been working my way through the Django tutorial and everything
> has gone
On Thu, Jun 4, 2009 at 10:55 AM, Daniel Roseman <
roseman.dan...@googlemail.com> wrote:
>
> On Jun 4, 3:19 pm, adelaide_mike wrote:
> > My latest problem can be illustrated thus:
> >
> > In the first form we select the main course - spam or eggs. In the
> > next form we select the dessert - ice
On Jun 4, 4:45 pm, Ross wrote:
> I've been working my way through the Django tutorial and everything
> has gone fine until I came across the part near the end of section 3
> about decoupling the urlconfs. I did as follows: I copied urls.py into
> my polls directory (C:\mysite\polls\urls.py). It n
On Jun 4, 3:19 pm, adelaide_mike wrote:
> My latest problem can be illustrated thus:
>
> In the first form we select the main course - spam or eggs. In the
> next form we select the dessert - ice cream or mud cake, and in the
> third form we select the after-dimmer drink - tea or coffee.
>
> How
I've been working my way through the Django tutorial and everything
has gone fine until I came across the part near the end of section 3
about decoupling the urlconfs. I did as follows: I copied urls.py into
my polls directory (C:\mysite\polls\urls.py). It now looks like this:
from django.conf.ur
In my case I have the next line on my wsgi script.
os.environ['ORACLE_HOME'] =
'/usr/lib/oracle/xe/app/oracle/product/10.2.0/server'
You must be sure you have installed the oracle-instantclient-devel
package (which has the libclntsh.so and others files required).
I hope this helps you.
Regard
Hi all,
I am new to Django, Python and web development in general. I've been
playing with Django for a couple of days and I like it. I am writing
an application that will allow multiple users to create, update and
delete objects. At this point I would like to limit users' access to
their own obje
I am new to django and I am running it on a Windows server. I
installed mod_wsgi with Apache and go it to work, but now when I run
python manage.py runserver. I get the error
Error: Could not import settings 'spot.settings' (Is it on sys.path?
Does it have syntax errors?): No module named setting
On Thu, Jun 4, 2009 at 9:38 AM, justind wrote:
>
> Thanks Alex. That works great.
>
> Just wondering: It seems like this causes the form to be bound, which
> causes it to render all its errors.
> I can set .is_bound to False manually to get around this, is this what
> I should be doing?
>
> On Ju
On Thu, Jun 4, 2009 at 7:37 AM, Jonathan Nelson wrote:
>
> I'm trying to add a feedreader element to my django project. I'm
> using Mark Pilgrim's great feedparser library. I've used it before
> without any problems. I'm getting a TypeError I can't figure out.
> I've tried searching google, bin
On Jun 3, 4:16 am, vishy wrote:
> Hi,
>
> I am developing an application on windows. I decided to upload it on
> webfaction n see how deployment goes. The issues I faced was with
> paths given -
> for templates - I had given absolute path of directory on windows,
> for database(using sqlite) -
Ahh yes, I had not considered calling them from Python since in my use
case they are treated more like an extension into the browser than
anything else. I will definitely refactor the class to use
@publicmethod so as to make the instance containing RPC methods more
general-purpose.
Thanks for th
Thanks Alex. That works great.
Just wondering: It seems like this causes the form to be bound, which
causes it to render all its errors.
I can set .is_bound to False manually to get around this, is this what
I should be doing?
On Jun 3, 5:15 pm, Alex Gaynor wrote:
> On Wed, Jun 3, 2009 at 5:12
Hello!
I'm trying to figure out if it is possible to disable the creation of
a reverse relation field when defining relations between models.
Something like this example:
class Route(models.Model):
start = models.ForeignKey (Location,
related_name='starting_points')
finish = models.Forei
My latest problem can be illustrated thus:
In the first form we select the main course - spam or eggs. In the
next form we select the dessert - ice cream or mud cake, and in the
third form we select the after-dimmer drink - tea or coffee.
How is the proper way to remember the choice made in for
Hi!
I'm trying to run Django app with mod_wsgi and Oracle, but when I try
to configure it I always get an internal server error (500) with this
error.log:
ImproperlyConfigured: Error loading cx_Oracle module: libclntsh.so.
11.1: cannot open shared object file: No such file or directory
It seems
Hello,
here is a code example that illustrates how I plan to implement journals
in an accounting application. The attached file models.py contains the
details. I saved it (together with an empty __init__.py) in a new
directory "journals" under django/tests/modeltests of my SVN working
copy (which
On Thu, 2009-06-04 at 05:01 -0700, janedenone wrote:
>
> On 3 Jun., 12:26, Tom Evans wrote:
> > On Wed, 2009-06-03 at 02:56 -0700, janedenone wrote:
> > > Hi,
> >
> > > is it possible to use alternating url patterns without confusing the
> > > reverse lookup mechanism?
> >
> > > I'd like to do s
I haven't used the form wizard, but it seems like your forms are in
...templates/wha/
Django is looking for your form at
...templates/wha/forms/wizard.html
you have them in
...templates/wha/contact/forms/wizard.html
try adding
...templates/wha/contact/forms
or
...templates/what/contact
to your
I'm trying to add a feedreader element to my django project. I'm
using Mark Pilgrim's great feedparser library. I've used it before
without any problems. I'm getting a TypeError I can't figure out.
I've tried searching google, bing, google groups to no avail.
Here's the dpaste of what I'm tryi
On 3 Jun., 12:26, Tom Evans wrote:
> On Wed, 2009-06-03 at 02:56 -0700, janedenone wrote:
> > Hi,
>
> > is it possible to use alternating url patterns without confusing the
> > reverse lookup mechanism?
>
> > I'd like to do something like
>
> > (r'^(authors|autoren)/(?P[_a-z]+)$', 'author_detail
On Jun 4, 11:15 am, Tom Evans wrote:
> On Wed, 2009-06-03 at 14:28 -0700, LaundroMat wrote:
> > Hi -
>
> > I'm trying to change the way a ChoiceField (with widget =
> > forms.RadioSelect) is being rendered in a template. Currently,
> > rendering the form as_p() for instance, will return HTML such
I forgot something. I noticed that you have two description meta tags
in your code:
There should be only one, of course. The Google bot doesn't like
duplicate descriptions. It might think you're cheating.
Fred
--~--~-~--~~~---~--~~
You received this message bec
Jens,
I have been using django-localeurl and it solves most of your
problems. The site I'm currently working on is indexed in all 5
languages, with no real effort on my part. It prefixes your content
with the correct ISO. Check it here: http://code.google.com/p/django-localeurl/
You can also che
dpaste is a good tool if you have a long code sample or traceback
that are giving you some problems. Usually when responding to
the thread with a solution, the poster with copy the relevant snippet
making the dpaste obsolete for further references. This might not
always be the case, but for most
Hi there!
I've got a Django app working on the Oracle backend. I have a table/
model with a char field and I store there strings (names) that contain
polish letters. On the admin panel when I sort those names, ones that
are starting with polish letters are after those that are starting
with lette
First of, when you use modelforms, you can instead do:
if form.is_valid():
form.save()
It doesn't make any difference to Django if you post the data
via AJAX or regular form submit, the only thing you want to
make different is probably the return value (redirect or json).
This can be done usi
On Wed, 2009-06-03 at 14:28 -0700, LaundroMat wrote:
> Hi -
>
> I'm trying to change the way a ChoiceField (with widget =
> forms.RadioSelect) is being rendered in a template. Currently,
> rendering the form as_p() for instance, will return HTML such as:
>
> value="1" name="type" />choice 1
> .
On Wed, Jun 3, 2009 at 9:18 PM, BenW wrote:
>
> Sorry about the example having bad syntax (doh!) -- I will get that
> fixed. I chose the public__ prefix because it makes it easier to
> introspect the supplied instance to find the methods intended to be
> public without forcing users of the class
Hello,
I have this product model
class Product(models.Model):
VAT_CODES = (
(6.00, '6%'),
(12.00, '12%'),
(21.00, '21%'),
)
description = models.CharField(max_length=50,)
unit_price = models.DecimalField(max_digits=10,decimal_places=2)
vat_code = model
Hi,
this topic is somewhere between django - implementation - SEO stuff...
I am currently running http://work724.com - a business system based on
Django. The intro/signup site is
in both English and Swedish (in process of adding more languages) and
using django language cookie for
getting this
62 matches
Mail list logo