manage.py syncdb won't add new fields to the database if the table
already exists. You'll have to do this yourself. See manage.py sqlall
for some help.
Otherwise, if you have: user = models.ForeignKey(User), then look for
a field named user_id in your table.
Nathan Ostgard
On Jul 18, 9
If you just want to specify the urls as listed, you could always
create a urls folder in myapp, put an __init__.py in there, and create
myapp/urls/feature1.py and myapp/urls/feature2.py.
Nathan Ostgard
On Jul 18, 7:37 pm, Collin Grady <[EMAIL PROTECTED]> wrote:
> You'll need two files.
On DreamHost, in ~/mydomain.com I have two files:
1. dispatch.fcgi
#!/home/myusername/python/bin/python
import os
import sys
from django.core.servers.fastcgi import runfastcgi
sys.path += ['/home/myusername/django']
os.environ['DJANGO_SETTINGS_MODULE'] = 'myproject.settings'
runfastcgi(['method=
Correct. I over looked a few basics.
On 19 יולי, 04:58, "Ben Ford" <[EMAIL PROTECTED]> wrote:
> This error message is to do with a syntax error... It doesn't have anything
> to do with django specifically. If you've cut and pasted verbatim, then you
> need a colon ( : ) at the end of your if
On 19-Jul-07, at 11:08 AM, Dmitriy Sodrianov wrote:
> How should the process of synchronisation be performed?
> To my mind only dropping table and recreating it should do the task.
for example:
http://www.djangosnippets.org/snippets/188/
--
regards
kg
http://lawgon.livejournal.com
http://nr
On 7/19/07, Dmitriy Sodrianov <[EMAIL PROTECTED]> wrote:
> After typing manage.py syncdb again the table is not synchronised with
> the model despite the name of the command syncdb.
http://www.djangoproject.com/documentation/django-admin/#syncdb
> How should the process of synchronisation be per
Hi to all!
Imagine a situation when a Django model is installed into the database
with well-known command
manage.py syncdb
and then it is altered, let's say a new field is added to model.
After typing manage.py syncdb again the table is not synchronised with
the model despite the name of the c
hi,
I have a model with a field models.ForeignKey(), with manage.py
validate I check if my code are right, then run manage.py syncdb. When
I was checking the tables generated I don't see any foreign key
created? Is there something wrong? where should I check?
I am using django 0.96, mysql 5 on w
I think I may have fixed it. I did the following:
1) I had moved sqlite, but didn't change the link, so I fixed that.
2) In the settings.py, I entered a path to the database, but not the
actual database name, so I fixed that as well.
3) Then I re-ran the django-admin.py syncdb script
$ django
Hi Jeremy,
I am a bit lost ... where do I apply that? Isn't that I just call the
variable name/dict key in the template?
Thanks
james
On Jul 19, 11:18 am, "Jeremy Dunck" <[EMAIL PROTECTED]> wrote:
> On 7/18/07, james_027 <[EMAIL PROTECTED]> wrote:
> ...
>
> > the commonly use data will automati
It's easy to write a "basic" blog in Django. If that's all people
want, then great. Something like that will work perfectly for the
majority of bloggers (who probably won't get that much readership
anyway)...
But all this talk about making a "full-featured" blog app in Django --
one that will r
On 7/19/07, oggie rob <[EMAIL PROTECTED]> wrote:
>
> Please, if you've seen the same issue or have any helpful ideas to try
> to stop the error, let me know.
I think I've seen the same problem (or, at least, an analogous one).
Unfortunately, I can't provide much by way of helpful debug or
solutio
I've run into a problem that appears to be caused by multiple django
versions running on the same server. I have a preforked mod_python
installation and the problem I'm seeing is this: after using the trunk-
based application, I try to use the 0.91-based application and get a
500 error. The root o
On 7/18/07, Greg <[EMAIL PROTECTED]> wrote:
> Do I have to return a HttpResponse?
Yes. It is an error for an HTTP Request not to be given a HTTP
response in return.
In the 'if "favorite_color"' branch of your example view, simple
"return response" just before the else: clause.
--~--~-~
On 7/18/07, james_027 <[EMAIL PROTECTED]> wrote:
...
> the commonly use data will automatically available, do I get it right?
>
Yes. Just keep in mind that you need to use RequestContext rather
than Context in order for context processors to be applied.
--~--~-~--~~~---
Hi,
As I understand context are data we can use in our templates, and the
purpose of context processor is instead of doing something like
c = Context({
'latest_poll_list': latest_poll_list,
})
or
return render_to_response('polls/index.html', {'latest_poll_list':
latest_poll_list})
Thanks Jason for sharing this one.
cheers,
james
On Jul 18, 9:07 pm, [EMAIL PROTECTED] (Jason F. McBrayer) wrote:
> james_027 <[EMAIL PROTECTED]> writes:
> > what if I need additional fields or methods for my apps? Do i inherit
> > it or edit the user class?
>
> The standard approach is
> here:
Also, when I use 'http://example.com/url_to_set_colour_view/?
favorite_color=Blue' it gives me an error that says:
'The view mysite.rugs.views.set_color didn't return an HttpResponse
object.' Do I have to return a HttpResponse? My view is shown
above...if the 'if' statement is true the view do
I've seen other Django websites that use the ? mark at the end. I've
always wondered what the reason for that was. So the only time the ?
mark is used is to send form data?
On Jul 18, 9:33 pm, "Nimrod A. Abing" <[EMAIL PROTECTED]> wrote:
> On 7/19/07, SmileyChris <[EMAIL PROTECTED]> wrote:
>
>
Also, this library is really simple to use to pull data out of excel.
http://www.lexicon.net/sjmachin/xlrd.htm
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email t
Francesco,
MaxMind(R) produces commercial and free IP geolocation datasets. As a
proof of concept I created GeoDjango-enabled models and import scripts
for their CSV files:
http://www.djangosnippets.org/snippets/327/
http://www.djangosnippets.org/snippets/328/
To create this code I had to patc
You'll need two files.
--~--~-~--~~~---~--~~
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 PR
On 7/19/07, SmileyChris <[EMAIL PROTECTED]> wrote:
>
> On Jul 19, 2:22 pm, Greg <[EMAIL PROTECTED]> wrote:
> > I was wondering how do I send a 'favorite_color' GET parameter? Do I
> > have to use a form to do this that sends data by GET or is there
> > another way to do it?
>
> http://example.com
On Jul 19, 2:22 pm, Greg <[EMAIL PROTECTED]> wrote:
> I was wondering how do I send a 'favorite_color' GET parameter? Do I
> have to use a form to do this that sends data by GET or is there
> another way to do it?
http://example.com/url_to_set_colour_view/?favorite_color=Blue
--~--~-~-
Hello,
I have the following function
/
def set_color(request):
if "favorite_color" in request.GET:
# Create an HttpResponse object...
response = HttpResponse("Your favorite color is now %s" % \
request.GET["favorite_color"])
# ... and set a cookie on
I'm a little fuzzy on how Django imports additional app URLconfs. I've
got two parts of an app that are closely related to one another,
however I'd like to give them both root URLs.
myproject/urls.py::
urlpatterns = patterns('',
(r'^feature1/', include('myproject.apps.myapp.urls')),
I just opened a ticket for this.
http://code.djangoproject.com/ticket/4918
Sebastian Macias
On Jul 12, 6:37 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]>
wrote:
> On 7/12/07,SebastianMacias <[EMAIL PROTECTED]> wrote:
>
>
>
> > By default models are grouped by app. I really need to be able to
>
On Wed, 2007-07-18 at 17:08 +, Sebastian Macias wrote:
> Is there anyway to modify model field attributes on run time.. What
> I'm trying to do is to build some logic that will decide whether a
> model that is related to other model should be edited or not inline in
> the admin.
>
> Basically
This error message is to do with a syntax error... It doesn't have anything
to do with django specifically. If you've cut and pasted verbatim, then you
need a colon ( : ) at the end of your if > 0 line. This is what python
is flagging as an error as far as i can see.
Ben
On 18/07/07, Ilan <[E
Is there anyway to modify model field attributes on run time.. What
I'm trying to do is to build some logic that will decide whether a
model that is related to other model should be edited or not inline in
the admin.
Basically: "client = models.ForeignKey(Client, unique=True,
edit_inline = True,
Thank you James, it's really great to get such answers !
Template loaders is a handy feature, I made my own in minutes.
People interested can find it here :
http://www.djangosnippets.org/snippets/326/
Cheers,
Olivier
On 19 juil, 02:03, "James Bennett" <[EMAIL PROTECTED]> wrote:
> On 7/1
You're correct I did have a extra space, but the original problem was
syntax error on the following line :
if self.segment_set.count() > 0
so my question is : can I acess to FK queryset as described in
http://www.djangoproject.com/documentation/db-api/#Backward in a model
method
thanks
On 18 יול
I am trying to follow jeff croft's tutorial for installing django on
dreamhost.
http://www2.jeffcroft.com/blog/2006/may/11/django-dreamhost/
I am trying to "Install and configure FastCGI"
I followed the tutorial, I don't see where I did anything wrong.
One part that I don't quite understand:
On 7/18/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> I can access other pages in the doc area (ex: /admin/doc/filters/ or /
> admin/doc/tags/) but when I try to access the views documentation, I
> receive:
...snip...
> SyntaxError at /admin/doc/views/
> invalid syntax (views.py, line 3
On 7/18/07, Richard Leland <[EMAIL PROTECTED]> wrote:
> Trying to set up a connection from Django to a MySQL cluster. I've never
> done this before, so any guidance you could provide would be excellent.
Though I may be wrong, I was under the impression that the engine only
needs to be specified w
On 7/18/07, Tim Chase <[EMAIL PROTECTED]> wrote:
> I dislike CSV because it takes extra overhead to
> synchronize the flavors of them (how are quotes quoted? are
> values quoted? etc).
Psst! Check out Python's built-in ``csv`` module
(http://docs.python.org/lib/module-csv.html); it handles all t
On 7/18/07, olivier <[EMAIL PROTECTED]> wrote:
> I'm thinking about a very simple processor that would remove lines
> beginning by ## (ala mako), because the Django comment syntax is sooo
> verbose and tedious to type
You'll probably want to implement it as a custom template loader[1];
Django
On 7/18/07, tyman26 <[EMAIL PROTECTED]> wrote:
> Is it possible to set a property in my model that will set update
> cascade/delete to true when the tables are generated? I know models
> automatically do this anyways when you delete or update, but if I am
> working directly with database informat
AnaReis skrev:
> Hi all,
> I have a problem when inserting a register into this table that I'm
> working with.
> This table belongs to a MySQL database and the storage engine is
> MyISAM. The database that I'm using is a legacy database and I can't
> change it in any way.
> When I insert a registe
> What about CSV? You can export from Excel as CSV pretty easily and it's a
> fairly easy format to parse in python...
Either that or tab-delimited text. I have a django app that does bulk data
upload from the admin interface according to the following protocol.
1. Users make their bulk uploa
Hi Naco
On 7/18/07, Naco <[EMAIL PROTECTED]> wrote:
>
> Does anybody know how to display thumnails in the admin interface?
Maybe this is what you want:
http://www.djangosnippets.org/snippets/239/
Greetings
Kai
--~--~-~--~~~---~--~~
You received this message
Daniel Kontsek skrev:
> Hello
>
> I have a web application with 2 views. The first view checks if the
> session dictionary has a 'uid' key - if not it generates an random ID
> and puts it into request.session dict. The second view reads the uid
> from the session dict and creates a Project DB obje
We don't need such an app (well, I don't need it).
If I want it, I write it in 20 minutes. :-)
Kai
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-use
Lic. José M. Rodriguez Bacallao wrote:
> Have anybody implemented a tree with django, for example, a menu?
>
tree = ui or data structurer? (guessing the answer is yes to both)
Carl K
--~--~-~--~~~---~--~~
You received this message because you are subscribed to
Is it possible to set a property in my model that will set update
cascade/delete to true when the tables are generated? I know models
automatically do this anyways when you delete or update, but if I am
working directly with database information it doesn't work
consistently. I know it's possibl
.. www.cerocom.com
..
You will be able to ask yourself:
Is Internet a good investment for my company?
So that an investment would have to do I of this type?
Really is going to serve to me to have a Web site?
So that to be i
Here's something on djangosnippets.org for displaying thumbnails in
the admin list:
http://www.djangosnippets.org/snippets/239/
Or do you mean on the page for editing a record?
Nathan Ostgard
On Jul 18, 2:11 pm, Naco <[EMAIL PROTECTED]> wrote:
> Does anybody know how to display thumnai
Trying to set up a connection from Django to a MySQL cluster. I've never
done this before, so any guidance you could provide would be excellent.
I know that DATABASE_OPTIONS can be used in the settings.py file, just not
sure if that's the right course of action or even how to write this into the
D
On Wed, Jul 18, 2007 at 07:10:27PM -, John-Scott wrote:
> Next, change your urls.py like so:
>
> (r'^characters/(?P\d+)[-\w]+/$', object_detail,
> dict(character_detail_dict)),
>
> This should capture the '123' and discard '-bob-and-jane'. This is a
> fairly elegant solution that allows you t
The option I want to implement, and which my be a suitable solution
for your situation, is to combine the object id with the slugified
version of the object name. Then in your urls.py, only capture the
object id and ignore the slug when retrieving the object (this gets
you past any issues with rev
I can access other pages in the doc area (ex: /admin/doc/filters/ or /
admin/doc/tags/) but when I try to access the views documentation, I
receive:
"""
SyntaxError at /admin/doc/views/
invalid syntax (views.py, line 39)
Request Method: GET
Request URL:http://localhost:8000/admin/doc/
If there's a problem, it will raise an exception, so you won't just
slide past invisibly.
--~--~-~--~~~---~--~~
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@googl
You can create a BaseForm class and specify it in your form_for_model
call:
from django import newforms as forms
class MyBaseForm(forms.BaseForm):
def clean_myfield(self):
if
MyModel.objects.filter(myfield=self.cleaned_data['myfield']).count():
raise forms.ValidationError('some error
Does anybody know how to display thumnails in the admin interface?
--~--~-~--~~~---~--~~
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 unsu
You want to create a BaseForm to specify in your form_for_model call.
You could do something like:
from django import newforms as forms
class MyBaseForm(forms.BaseForm):
def clean_myfield(self):
if
MyModel.objects.filter(myfield=self.cleaned_data['myfield']).count():
raise forms.Vali
Hi group,
Is there an easy way to plug a preprocessor to the templating system ?
I'm thinking about a very simple processor that would remove lines
beginning by ## (ala mako), because the Django comment syntax is sooo
verbose and tedious to type
Cheers,
Olivier
--~--~-~--~~
Hello,
I'm using a solution I saw on a RoR blog (http://
blog.hasmanythrough.com/2006/7/7/more-on-naming-and-the-crud has a
summary of the technique) which should address the 'reversibility'
issue. Basically you just concatenate the object id with the slug of
the human readable name, but then jus
> left: bulk upload. I've thought of using xls (microsoft
> office's excel files) to make it easy on the client, because
> teaching them xml or yaml isn't the big deal. After thinking
> about it, finding a xls parser module for python might not be
> the problem,
I second the idea of using a plai
On 7/18/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
> Have anybody implemented a tree with django, for example, a menu?
>
> --
> Lic. José M. Rodriguez Bacallao
> Cupet
I've implemented a tree of comments in django-discussion:
http://django-discussion.googlecode.com/svn/trunk/
Nis Jørgensen skrev:
> [EMAIL PROTECTED] skrev:
>
>> OK, fixed the above problem -- figured out that it was related to my
>> setting unique=True on a field. But that raises the larger question...
>>
>> I have a bit of data that may or may not exist... a identifier on the
>> user that not all us
> Can someone point me to the problem?
>
> class Base(models.Model):
> User = models.CharField(maxlength=200)
> Notes = models.CharField(maxlength=200) # free text
>
> def _first_date(self):
>""" Return the first date """
> if self.segment_set.count() > 0
>
I won't attempt to tackle the image conundrum (because our old ecommerce
site is of the single-image variety, which makes it easy).
The other, though I can help you with. My models yield four tables
(products, product_categories, product_site to tie it to a site, and
product_attributes). I wrote
Have anybody implemented a tree with django, for example, a menu?
--
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.
Recuerda: El arca de Noe fue construida por a
Hi,
My name is Ilan, and I kind of new working with Django.
I have a question about model methods.
I trying to write a model method which access ForeignKey FOO_set
functionality
Whoever it does not seems to pass the "syncdb" validation, because of
invalid syntax
Can someone point me to the probl
Folks,
In spirit of recent question regarding custom 'where'... Is there a way to
put a custom ORDER BY into QuerySet? I have an sql function that does all
the math on db side and would like to use it at order_by clause
I quickly skimmed _get_sql_clause and haven't found any way to incorporate
Hi,
I have model with field that has attribute unique set to True. I know
newforms are not able to handle such a validation as this is DB
related. However I read at newforms doc page that it is possible to
provide method called clean_() that can do custom validation.
My problem is that method is s
On 18 Jul 2007, at 12:00 pm, Chris Hoeppner wrote:
Hi there!
I've been working on an ecommerce solution. So far everything works
like
it should. There's just one "nice to have" feature left: bulk upload.
I've thought of using xls (microsoft office's excel files) to make it
easy on the clien
james_027 <[EMAIL PROTECTED]> writes:
> what if I need additional fields or methods for my apps? Do i inherit
> it or edit the user class?
The standard approach is here:
http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model
However, also have a look at this approach:
http://g
On 7/18/07, Ben Ford <[EMAIL PROTECTED]> wrote:
> Just out of interest have you explored using SQLAlchemy directly with the
> django model..? I mean mapping the SA Table onto the django Model..? I had a
> play with that a while back and it seems a very straightforward way of
> achieving SA - dj
Just an FYI,
For all of you folks in the Atlanta Area, we have a special Django
Presentation on Aug. 9th at Turner Studios by a leading Django
instructor from the Big Nerd Ranch. Please see our meetup event for
more details: http://python.meetup.com/46/calendar/5900658/
Thanks,
Noah
--~--~
Just an FYI,
For all of you folks in the Atlanta Area, we have a special Django
Presentation on Aug. 9th at Turner Studios by a leading Django
instructor from the Big Nerd Ranch. Please see our meetup event for
more details: http://python.meetup.com/46/calendar/5900658/
Thanks,
Noah
--~--~
Just out of interest have you explored using SQLAlchemy directly with the
django model..? I mean mapping the SA Table onto the django Model..? I had a
play with that a while back and it seems a very straightforward way of
achieving SA - django integration...
Ben
On 18/07/07, Noam <[EMAIL PROTECTED
I'm following the m2m_intermediary pattern:
9. Many-to-many relationships via an intermediary table
http://www.djangoproject.com/documentation/models/m2m_intermediary/
However, I need associations, not between two different models, but between
pairs of instances of the *same* model, as discussed
what if I need additional fields or methods for my apps? Do i inherit
it or edit the user class?
Thanks
james
On Jul 18, 3:45 pm, Przemek Gawronski <[EMAIL PROTECTED]>
wrote:
> > is this use for the django admin features only? or I can use it for my
> > own app? if yes, do I make it suitable for
Hi there!
I've been working on an ecommerce solution. So far everything works like
it should. There's just one "nice to have" feature left: bulk upload.
I've thought of using xls (microsoft office's excel files) to make it
easy on the client, because teaching them xml or yaml isn't the big
deal. A
On Jul 18, 9:08 am, Jonathan Buchanan <[EMAIL PROTECTED]>
wrote:
> LaundroMat wrote:
> > Hi,
>
> > When running this, I get a "NoneType has no attribute
> > is_authenticated()" error, and I cannot understand why:
>
> > 1 new_user = User.objects.create_user(username, "your.email",
> > password)
>
On Wed, 2007-07-18 at 09:48 +, omat wrote:
> Hi all,
>
> Recently, it occurred to me that, defining some abstract models for
> some types of applications would make my code significantly DRYer, by
> eliminating duplication of common fields, model methods and manager
> methods.
>
> Examples o
Hi all,
Recently, it occurred to me that, defining some abstract models for
some types of applications would make my code significantly DRYer, by
eliminating duplication of common fields, model methods and manager
methods.
Examples of common groups of applications are:
- Orthogonal applications
On Jul 18, 4:47 am, "Ben Ford" <[EMAIL PROTECTED]> wrote:
> > I haven't looked at the code, but I wonder about the dependency on
> > multiple ORMs; the Django ORM cannot expose its own functionality on
> > multiple databases at once...
>
> It can using the multiple-db-support branch (see ticket 47
Hi all,
I have a problem when inserting a register into this table that I'm
working with.
This table belongs to a MySQL database and the storage engine is
MyISAM. The database that I'm using is a legacy database and I can't
change it in any way.
When I insert a register into the table it's MySQL w
Thanks for your comment!
Relying on another ORM isn't technically necessary, but it seems to me
the easiest way - instead of issuing select statements, the generated
code looks like this:
for s in src.myapp.City.select():
d = dst.myapp.City()
d.id = s.id
d.name = s.na
Thanks to all for help.
With your suggestions and links I've found out how to serve static files
with Django.
Now everything works just fine!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To
On 18-Jul-07, at 11:31 AM, James Bennett wrote:
> So I'm not necessarily convinced that there's a great need for a
> "standard" Django blog application; it would appease some folks, but I
> have a feeling that in the Django world a lot of people really would
> be happier, in the long run, writin
On 17 juil, 20:29, Tim Chase <[EMAIL PROTECTED]> wrote:
> Fortunately, Django's ORM lets you get at the underlying SQL via
> a call to .extra() where you can provide your own WHERE clause.
> This would look something like
>
>Article.objects.extra(where="""
> app_article.id in (select arti
> is this use for the django admin features only? or I can use it for my
> own app? if yes, do I make it suitable for my application?
Sure you can, tak a look at:
http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in
Przemek
--
AIKIDO TANREN DOJO - Poland - Warsaw
hi,
is this use for the django admin features only? or I can use it for my
own app? if yes, do I make it suitable for my application?
Thanks
james
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" gro
On 7/18/07, james_027 <[EMAIL PROTECTED]> wrote:
>
> sorry for this stupid question ... does django's session only work
> when cookies are enabled?
Yes.
Yours,
Russ Magee %-)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Are you working on a specific application that uses model inheritance,
or testing the models I posted in the first message in this thread?
Also, previously, you've mentioned something that you will post to
another list. I didn't get that either.
I was using the model api. The error is:
Programmin
On Wed, 2007-07-18 at 06:51 +, james_027 wrote:
> hi,
>
> sorry for this stupid question ... does django's session only work
> when cookies are enabled?
That is correct. See
http://www.djangoproject.com/documentation/sessions/#session-ids-in-urls
for the documentation on this.
Regards,
Malc
LaundroMat wrote:
> Hi,
>
> When running this, I get a "NoneType has no attribute
> is_authenticated()" error, and I cannot understand why:
>
> 1 new_user = User.objects.create_user(username, "your.email",
> password)
> 2 new_user.is_active = False
> 3 new_user.save()
> 4 user = authenticate(use
90 matches
Mail list logo