syncdb has never been able to modify existing models. In order to get
some functionality like that, look into django-evolution:
http://code.google.com/p/django-evolution/
-Chris
On Thu, Dec 25, 2008 at 1:11 AM, Fluoborate wrote:
>
> Running the command:
> python manage.py syncdb
> Used to add t
I am trying to make an application for recipes using Django. I am
starting simple and going from the tutorial but not getting the
results I want. In a less strict framework I'd be able to represent
what I want to easily but I'm having trouble figuring out how to do it
the Django way while keeping
Perfect, the "extra fields" and an intermediary relationship model
were exactly what I needed. Thanks.
On Thu, Dec 25, 2008 at 3:14 PM, Ramiro Morales wrote:
>
> On Thu, Dec 25, 2008 at 5:13 PM, Chris Czub wrote:
>>
>>
>> I think I need to use a ManyT
Is there any way to get the old value of a field in a clean_* method
on the ModelForm?
That is - the validation depends on the old value of the field versus
the new value.
self.cleaned_data only contains the new value.
Thanks,
Chris
--~--~-~--~~~---~--~~
You re
nclear, but i think what you are looking for is
> in self.data in your clean_ method
>
> On 12 Feb., 23:56, Chris Czub wrote:
>> Is there any way to get the old value of a field in a clean_* method
>> on the ModelForm?
>>
>> That is - the validation de
If you are using default Django sessions, they will be stored in the database.
>From the docs:
By default, Django stores sessions in your database (using the model
django.contrib.sessions.models.Session). Though this is convenient, in
some setups it's faster to store session data elsewhere, so Dj
I am trying to customize the list view of one of my models in the
admin to separate it into a few different tables for organization
purposes.
My model is an "order". The important fields for this problem are the
user who placed the order, the date is was placed, the restaurant it
was for, and the
if you include the django.core.context_processors.media context processor
http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#django-core-context-processors-media
On Thu, Feb 26, 2009 at 8:04 PM, AKK wrote:
>
> Hi,
>
> I have a template and I want to get some images out of my
What you are describing are Django "Context Processors".
http://docs.djangoproject.com/en/dev/ref/templates/api/?from=olddocs#id1
Basically you'd make a new context processor to set the variables you
need in your context and have it included for all of your views.
You can do this on an applicat
That is a short-coming of the Django ORM, unfortunately solving the
problem of iterative schema changes is pretty difficult.
There are some projects around that attempt to fix this issue, in
varying stages of completion:
http://south.aeracode.org/wiki/Alternatives is a decent list.
As for your s
What reason do you have for this? Security through obfuscation isn't a
good strategy, especially with something as intrinsically open as
HTML. If your site can be hacked just by being able to view the HTML
then you have bigger problems to worry about than obfuscating it.
On Mon, May 25, 2009 at 4
Are you running that command from the interactive shell invoked by
running 'python manage.py shell'?
Invoking the interactive shell that way should set up all your python
library settings properly for your Django app.
On Apr 30, 2010, at 5:44 PM, Mark Serva wrote:
I am running django 1.
Oh... Actually looking at the error that was spit out, it looks like
you made a typo.
Your error says you typed 'from mysite.blog import BlogPost'.
On Apr 30, 2010, at 5:44 PM, Mark Serva wrote:
from mysite.blog import BlogPost
--
You received this message because you are subscribed to
Much like programming, it will come from experience. Practice a lot. You'll
make a lot of things you aren't happy with, probably like your first bits of
code :) Try to imitate things you like, and see the techniques they use to
create cool designs. It, like anything else worth doing, will be easier
It really depends on how you're selecting the data from the database. If
you're doing something that necessitates a full table scan(like in-DB ORDER
BY) it will slow you down considerably. If you're selecting one row from the
database by an indexed column, then the performance will be very fast and
at 3:20 PM, nameless wrote:
> The table is queried from ajax using an autocomplete field with this
> query in the views.py:
>
> books.objects.filter(book_title__istartswith=request.GET['q'])[:100]
>
>
>
>
> ---
>
> On Jan 12, 8:47 pm, C
>1. my apache server on port 80 serves both a normal site (php) and the
>django files. i would like to keep my normal site on port 80. is there
>a way to keep it that way? as far as i understand the two servers must
>be running on different ports.
Look into what is called a "reverse proxy" e.g. Sq
Here's a question that is probably divisive - why did Django decide to go
with Model/Template/View instead of Model/View/Controller? MVC just
conceptually makes so much more sense to me.
Anyhow, that's not the primary point of this posting...
Is there any way to implement some sort of pre and/or
Yes, I am 95% sure the line below is Verdana - note the shape of the a, o,
and d.
On Tue, Mar 25, 2008 at 10:01 PM, Ned Batchelder <[EMAIL PROTECTED]>
wrote:
> The "perfectionists with deadlines" tagline is also in Prokyon, but a
> different weight (regular or light). The line below that on the
Would it be possible to replace the Django database driver(i.e. postgresql,
sqlite, mysql) with a custom one that managed the various database
connections? Similar to the SQL proxy idea(or maybe identical).
On Wed, Apr 16, 2008 at 1:41 PM, RaviKondamuru <[EMAIL PROTECTED]>
wrote:
>
> Here is the
Follow the instructions on the Django website at
http://www.djangoproject.com/download/ and run `svn co
http://code.djangoproject.com/svn/django/trunk/`
After that, you should be able to `svn up` to get the latest version.
On Fri, Apr 18, 2008 at 5:09 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
wro
If you are using SQLite you could just delete the database file. If not, I'm
confused at why you'd have access to the shell but not access to the
database - do you not have access to the database you are working on or
something? If so, I would ask whoever has access to it to drop the tables
for you
Additionally, you could use `django-admin.py flush` to wipe all the database
tables and reset them to the state they were in after you initially
syncdb'ed.
http://www.djangoproject.com/documentation/django-admin/
On Mon, May 12, 2008 at 10:20 AM, Chris Czub <[EMAIL PROTECTED]> wrote
ence.com/"
MEDIA_ROOT = '/home/myuser/webapps/static/'
# URL that handles the media served from MEDIA_ROOT.
# Example: "http://media.lawrence.com";
MEDIA_URL = 'http://www.mysite.com/media'
which is correct - the url of the image SHOULD be
http://www.mysite.c
http://www.djangoproject.com/documentation/models/fixtures/
What you are looking for is an initial_data fixture. You need to serialize
the default instance of the model you want as JSON and save it in
initial_data.json and then it should prepopulate when you run syncdb.
On Wed, Jun 4, 2008 at 2:3
Thanks, that was it.
-Chris
On Jun 3, 5:44 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 3, 2008 at 5:15 PM, Chris Czub <[EMAIL PROTECTED]> wrote:
> > # URL that handles the media served from MEDIA_ROOT.
> > # Example: "http://
That really depends on the app and how everything is configured.
For example, where are you installing the required Python packages? Do you
have a Python lib directory in the application or are you using one of your
system's Python include paths?
It should not be *too* difficult but depending on
You're creating a contrived test though. If you really wanted the
count of users you'd probably do a "count" in the database itself.
I don't think you're getting any valuable data on your application's
actual performance: you basically made a view that just loops over
9000 items. Of course it will
Heroku has been good to me and some of my colleagues so far. They host
on AWS so if there was an AWS outage obviously your site would be
down(would be nice to be able to fail over to Rackspace or something)
but other than that reliability is fine.
Their support is very good and responsive as well.
RIP, Kenneth.
He was one of the primary contributors to this list and his
contributions will be missed.
Condolences go out to all of his friends and family.
On Fri, Aug 3, 2012 at 11:20 AM, Anoop Thomas Mathew wrote:
> Chronic Asthma. He was hospitalized yesterday, and passed away today.
>
>
>
Shawn -- what do you recommend instead? A friend and I recently had
this debate. His suggestion was to split off as much behavior into
smaller apps with only a handful of models in the models.py as
possible, but I said that if it's not reusable, it shouldn't be an
app. I still haven't found a solut
> 3) Using one or the other for Geographic Information Systems work;
I know a lot of GIS people like GeoDjango a lot. I can't comment more than
that as I'm not familiar with the field, but it says something that I've
heard of GeoDjango but nothing similar for Rails.
On Thu, Jan 19, 2012 at 10:59
I think you might be taking the wrong approach. Rather than having your
application code checking whether or not it's in a test, have your testing
code disable/mock certain behaviors that you don't want exercised(like have
it always return that the user answered the security question correctly or
s
I've had good luck with Lettuce. It's very similar to Cucumber(the
test format is the same) so you should be able to jump right in. The
terrain features they offer are really useful as well.
On Sat, Jun 11, 2011 at 8:58 PM, Mark Curphey wrote:
> Thanks. Do most Python folks generally use Selenium
Yup, that is my approach...
The Django sourcecode is eminently readable and well-organized and most of
it has documentation associated with it.
You can jump into a shell and use the help() command to view API
documentation like you requested.
e.g.
>>> help('django.contrib.auth.models.User')
On
35 matches
Mail list logo