Re: from .views import * VS from views import *

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 13:56 -0700, Antoine De Groote wrote: > Hello, > > this is my first post on this group. I just started using Django > yesterday, reading throuhg the online Django Book > (www.djangobook.com). > > In chapter 3, for the URLconf, the authors put: > > from

Re: memcached

2008-07-09 Thread gt7658b
The previous information was not accurate. Actually it works fine with firefox, but cause apache 500 error on IE. On Jul 9, 9:28 pm, gt7658b <[EMAIL PROTECTED]> wrote: > Thanks for the help, I was able to make it work. It was due to the > fact that memcache.py was not under PYTHONPATH. > >

Re: Server config

2008-07-09 Thread elithrar
On Jul 10, 2:08 am, [EMAIL PROTECTED] wrote: > What does everyone recommend? FreeBSD, RedHat, or Ubuntu? Go with what you're most comfortable with - most of my experience has been with Debian-based distributions, and hence I run Ubuntu on my web- server. A couple of friends run Fedora, and

weird mssql issue

2008-07-09 Thread Bobby Roberts
hey gang - got a really weird issue trying to connect to any mssql databases from home. I have Charter cable Internet, mssql 2000 running Kaspersky firewall.For some reason I can no longer connect to a mssql databases even when I have my firewall down. The issue was sudden and without

Re: memcached

2008-07-09 Thread gt7658b
Thanks for the help, I was able to make it work. It was due to the fact that memcache.py was not under PYTHONPATH. There is still one puzzle. As suggested by you, CacheMiddleware should come before SessionMiddleware (also recommended by the django doc.). If I do that as follow, I will get an

Re: how to log in automaticly

2008-07-09 Thread [EMAIL PROTECTED]
thank you very much. On Jul 9, 10:44 pm, oliver <[EMAIL PROTECTED]> wrote: > Hi, > > just do this after the "registration" part is completed > > http://www.djangoproject.com/documentation/authentication/#how-to-log... > > On Jul 9, 7:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > i

Re: "ImportError No module named django"

2008-07-09 Thread Peter Herndon
Yes, the install worked. If you can import a module without error, it's installed successfully. Mostly. ;) You can also successfully import a module even if it is not on PYTHON_PATH, if you are in the same directory as the module. ---Peter Herndon On 7/9/08, MadMax007 <[EMAIL PROTECTED]>

Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread ristretto.rb
All excellent ideas. Great community here, thanks!! To be clear, I have been coding Python and Django for a few weeks now, and I've bought and read a few books, poured over some online docs and tried to get confortable with Komodo. I don't really WANT to learn the internals of Django at this

puzzle using FileField by uploading file to a non existing folder

2008-07-09 Thread Cliff
I'm trying to use the strftime formatting suggested by Django documentation for my FileField like this: file = models.FileField("File",upload_to="audio/%Y/%m/%d") The problem I ran into is that the specified folder doesn't exist when the object is saved. I guess there is method like presave()

Re: Django, Apache, and CSS

2008-07-09 Thread foo
Thanks for the pointer Milan...much to my surprise, pointing my browser at http://localhost/media/style.css showed the contents of my CSS file. In the last post, by "seeing the same behavior", I meant that there was no 404 error, only a blank page...no output from the template and no stylesheet

Re: Django, Apache, and CSS

2008-07-09 Thread foo
The contents of my base.html page are: http://www.w3.org/1999/xhtml;> {% block title %}{% endblock %} Foo Bar {% block content %} {% endblock %} {% block sidebar %} {% endblock %} As

Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread bruno desthuilliers
On 9 juil, 04:08, "ristretto.rb" <[EMAIL PROTECTED]> wrote: > I leading a project based on Django, and I come from 12 years of Java, > and 0 years of Python. Well, if you insist : "ha ha ha". Oh, BTW: http://dirtsimple.org/2004/12/python-is-not-java.html Ok, done with this. What's next ?-)

Did r7798 break comments?

2008-07-09 Thread Alvaro Mouriño
Hi list, I'm using the comments engine [0] provided by the framework, but after updating to the revision 7798 [1] or later I get the error: u'get_comment_count' tag has invalid content-type. As you can tell by the error message, the exception is raised at the get_comment_count [2] function, but

Re: Named URL not picking up parameter value

2008-07-09 Thread Brandon Taylor
OMG. I definitely need more sleep! Many thanks, Brandon On Jul 9, 3:20 pm, "Norman Harman" <[EMAIL PROTECTED]> wrote: > Brandon Taylor wrote: > >     url(r'^(?P[w-]+)/$', 'my_site.groups.views.show_group', > > That regex matches one or more w's and hyphens.  You surely wanted [-\w] > to match

from .views import * VS from views import *

2008-07-09 Thread Antoine De Groote
Hello, this is my first post on this group. I just started using Django yesterday, reading throuhg the online Django Book (www.djangobook.com). In chapter 3, for the URLconf, the authors put: from django.conf.urls.defaults import * from mysite.views import current_datetime urlpatterns =

Re: Named URL not picking up parameter value

2008-07-09 Thread Norman Harman
Brandon Taylor wrote: > url(r'^(?P[w-]+)/$', 'my_site.groups.views.show_group', That regex matches one or more w's and hyphens. You surely wanted [-\w] to match letters, numbers, underscores and hyphens. -- Norman J. Harman Jr. Senior Web Specialist, Austin American-Statesman

Re: Server config

2008-07-09 Thread Joshua Jonah
[EMAIL PROTECTED] wrote: > Thanks Jeff. > > Something else, we're going to be running that as the web-server, but > also have a media server, but it is a Windows server. Still possible > to send the audio/video/powerpoint to the media server, even though it > is Windows? > > On Jul 9, 2:48 pm,

Re: Where to put stylesheets?

2008-07-09 Thread Benjamin Buch
Fixed it. Thanks for pointing me to the right place in the documentation. Searched the docs, but overlooked 'Serving static/media files'. Who thought that there would be something about where to put my css files? Lame excuse, glad you helped me! -benjamin > > meant to put this in there: >

Re: Server config

2008-07-09 Thread mccomas . chris
Thanks Jeff. Something else, we're going to be running that as the web-server, but also have a media server, but it is a Windows server. Still possible to send the audio/video/powerpoint to the media server, even though it is Windows? On Jul 9, 2:48 pm, Jeff Anderson <[EMAIL PROTECTED]> wrote:

Re: Where to put stylesheets?

2008-07-09 Thread mccomas . chris
meant to put this in there: http://www.djangoproject.com/documentation/static_files/ On Jul 9, 2:59 pm, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > Just to clarify what may be obvious...do you have the correct one > > of these: > > >  href=" {{ MEDIA_URL }}styles.css"  <- what you wrote > >  

Re: Where to put stylesheets?

2008-07-09 Thread mccomas . chris
did you set the path to your in your URLconf, since you're using the development server? On Jul 9, 2:59 pm, Benjamin Buch <[EMAIL PROTECTED]> wrote: > > Just to clarify what may be obvious...do you have the correct one > > of these: > > >  href=" {{ MEDIA_URL }}styles.css"  <- what you wrote > >

Re: streaming output

2008-07-09 Thread Brogli
PEP 333 indicates chunked encoding is ok in WSGI apps: "And, if the server and client both support HTTP/1.1 "chunked encoding" [3], then the server may use chunked encoding to send a chunk for each write() call or string yielded by the iterable, thus generating a Content-Length header for each

Re: Where to put stylesheets?

2008-07-09 Thread Benjamin Buch
> Just to clarify what may be obvious...do you have the correct one > of these: > > href=" {{ MEDIA_URL }}styles.css" <- what you wrote > href="{{ MEDIA_URL }}styles.css" <- likely what you want > > without the extra space? > > -tim fixed it, but it still won't load... -benjamin

Re: OneToOne and model deletion

2008-07-09 Thread alex finn
> Try setting the primary_key option as True. Fair enough, but this will solve the issue (will it? Didn't try yet) only in case I need just one OneToOne mapping per model. What if I need more? In the example above, what if I need Person to be mapped to Profile and ProjectParticipant models as

Re: Where to put stylesheets?

2008-07-09 Thread Tim Chase
> href=" {{ MEDIA_URL }}styles.css" /> , > > 'styles.css' won't load. Just to clarify what may be obvious...do you have the correct one of these: href=" {{ MEDIA_URL }}styles.css" <- what you wrote href="{{ MEDIA_URL }}styles.css" <- likely what you want without the extra space? -tim

Re: Server config

2008-07-09 Thread Jeff Anderson
[EMAIL PROTECTED] wrote: Hey, At work we're getting a new server and going to use it as our web- server and use Django to run our website and our special student/ faculty stuff. What does everyone recommend? FreeBSD, RedHat, or Ubuntu? We have been using rhel since about rhel3, but we're

Where to put stylesheets?

2008-07-09 Thread Benjamin Buch
Okay, I'll ask. Perhaps it's a stupid supernoob-question, but I'll do it: Where should my projects' stylesheets live? I've made a 'media' directory beneath the projects' home folder, and I put that into settings.py: MEDIA_ROOT = '/path/to/my/project/media' MEDIA_URL =

Re: Django + tiny_mce

2008-07-09 Thread LRP
Many many thanks to all who helped. Problem solved. There seem to have been two issues: 1) Mathias pointed out missing slash. 2) I'd copied only the top tiny_mce directory into my .../media/ jscripts/tiny_mce directory. Mario, I'll definitely look at your note again when I try out django

Named URL not picking up parameter value

2008-07-09 Thread Brandon Taylor
Hi everyone, According to: http://www.djangoproject.com/documentation/url_dispatch/ I'm supposed to be able to use {% url url-name parameter(s) %}, to de- couple models form URLs. Here's a snippet from my template: {% for group in groups %} {{ group.name }} {% endfor %} #in urls.py

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-09 Thread Nicolas Steinmetz
Nicolas Steinmetz wrote: > On Jul 9, 11:10 am, "Marek Stępniowski" <[EMAIL PROTECTED]> > wrote: > >> It seems you are running into one of django-tagging quirks. >> See issue #95 >> [http://code.google.com/p/django-tagging/issues/detail?id=95]. > > Oh thanks I missed this issue. I'll test it

Re: Double pre-save signals emitted for User model during tests

2008-07-09 Thread davenaff
OK, more insight. This appears to be a figment of the testing framework. I didn't mention that I also had a file tests.py and the duplicate problem is generated when the model that holds the doctests is imported into tests.py. (I agree that the test code shown below shouldn't sit in a model

Server config

2008-07-09 Thread mccomas . chris
Hey, At work we're getting a new server and going to use it as our web- server and use Django to run our website and our special student/ faculty stuff. What does everyone recommend? FreeBSD, RedHat, or Ubuntu? Thanks, --~--~-~--~~~---~--~~ You received this

Re: "ImportError No module named django"

2008-07-09 Thread MadMax007
Thanks for the links I'll check them out One last question, I re-did the installation for Django using some instructions I found on Google. When I open Python now and type: >>> import.django >>> django.VERSION >>> (0,96 ) "There's something else after the 0, 96 but I can't remember what >>> it

Re: accessing a model ojbect's saved fields

2008-07-09 Thread davenaff
To add more detail: The db version of the file won't be removed until the save method is complete. def save(self): if self.id: #The photo currently exists m = MyModel.objects.get(pk=self.id) if m.photo == self.photo: #They are the same photo else:

Re: how to post XML with python / Django

2008-07-09 Thread davenaff
Alternatively you can use the xml Element Tree (included in python 2.5) library for building and parsing your xml file: http://effbot.org/zone/celementtree.htm Then of course use urllib/urllib2 (a good reference is here: http://www.voidspace.org.uk/python/articles/urllib2.shtml) Dave On Jul

Double pre-save signals emitted for User model during tests

2008-07-09 Thread davenaff
This behavior is really quite bizarre and I've spent a tremendous amount of time trying to figure it out. Here is the code to demonstrate the problem: In one of my models.py files, I have this: COUNT = 0 def user_pre_save(sender, instance, signal, *args, **kwargs): global COUNT

Re: Ordering a queryset with the same field type from two different models

2008-07-09 Thread [EMAIL PROTECTED]
Hi Malcolm, I think what I'm going to do now is basically not mix the two models but make Model B the main model. This will solve another problem I'm having as well in one go. Thanks again for all your help. Mike. On Jul 9, 2:42 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed,

Re: how to post XML with python / Django

2008-07-09 Thread Norman Harman
Bobby Roberts wrote: > We are using a payment gateway for usaepay.com to process credit > cards. Does anyone have experience with this? I'm trying to find a > good resource for posting XML to another site but i'm coming up short > with how to do this in django and python. Create a

Re: Problem with broken link emails

2008-07-09 Thread Norman Harman
HenrikG wrote: > Hi! > > I have a problem with email-reports of "Broken INTERNAL link" that > doesn't seem correct. For example this one: > > Referrer: http://www.teamxstream.se/ > Requested URL: /star_empty.gif > > When I access the referrer page, I get no error message myself and in > the

Re: memcached

2008-07-09 Thread Norman Harman
gt7658b wrote: > Hello, I tried to use memcached as follow. BTW, memcached is running > as seen from top command on server. > > CACHE_BACKEND = 'memcached://127.0.0.1:11211/' > # CACHE_BACKEND = 'dummy:///' > CACHE_MIDDLEWARE_SECONDS = 60*30 > CACHE_MIDDLEWARE_KEY_PREFIX ='' >

Re: OneToOne and model deletion

2008-07-09 Thread rui
Try setting the primary_key option as True. >From http://www.djangoproject.com/documentation/models/one_to_one/: class Restaurant(models.Model): place = models.OneToOneField(Place, primary_key=True) # Delete the restaurant; the waiter should also be removed >>> r =

OneToOne and model deletion

2008-07-09 Thread alex finn
Hi, I'm new to django and was trying to play around OneToOne mapping (a very powerful feature in my mind) and found one possible issue. I created two models: Person and Profile, where Profile is mapped to Person with OneToOne profile field in the Person class. So now when I create a Person, I

vanilla login_required decorator not strict enough to rely on?

2008-07-09 Thread Egon Esser
Hi all, I have spent some weeks on Django in my spare time now. In the docs and in most of the code (examples) I have seen, relying solely on request.user.is_authenticated seems to be the word. However, lately this once happened onto me: I logged a user out of my site and for testing purposes,

how to post XML with python / Django

2008-07-09 Thread Bobby Roberts
We are using a payment gateway for usaepay.com to process credit cards. Does anyone have experience with this? I'm trying to find a good resource for posting XML to another site but i'm coming up short with how to do this in django and python.

Re: Arbitrary precision arithmetic in django

2008-07-09 Thread Rob Hudson
On Jul 9, 8:07 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > Rob, I am never letting you do my financial programming for me. Float > fields lose precision. Inexact. Approximate. Heh. Sorry. I was misunderstanding "arbitrary". Yeah, don't listen to me, obviously. :)

Re: Django, Apache, and CSS

2008-07-09 Thread phillc
if you use multiple django instances, you need to add to each PythonInterpreter somestring On Jul 8, 11:52 pm, "Milan Andric" <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 9:47 PM, foo <[EMAIL PROTECTED]> wrote: > > > First, I want to thank you for your reply Milan!  I just recently > >

Re: does django cache models.py?

2008-07-09 Thread Norman Harman
Daehee wrote: > i'm trying it figure out why django is not recognizing a new models.py > file for my app. even when i completely butcher the code in models.py > or change the filename and run "manage.py sqlreset" or "manage.py > syndb," it still generates the old model. any thoughts?? manage.py

Re: Generic delete view.

2008-07-09 Thread Rob Hudson
It took me a minute to see it, but "str object not callable" is referring to the fact that your URL pattern is providing a string as its 2nd argument and "delete_object" (the string) cannot be imported and called. You can either: 1) Use the actual view you imported (i.e. remove the single

Re: integer form fields

2008-07-09 Thread Bobby Roberts
> How about max_value=99? > > Regards, > Jonathan. Thanks Jonathan... couldn't find that anywhere! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread [EMAIL PROTECTED]
Wow, I had never heard of pdb before. --~--~-~--~~~---~--~~ 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

Problem with broken link emails

2008-07-09 Thread HenrikG
Hi! I have a problem with email-reports of "Broken INTERNAL link" that doesn't seem correct. For example this one: Referrer: http://www.teamxstream.se/ Requested URL: /star_empty.gif When I access the referrer page, I get no error message myself and in the source there are only occurrences of

Re: Arbitrary precision arithmetic in django

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 08:02 -0700, Rob Hudson wrote: > FloatField? > http://www.djangoproject.com/documentation/model-api/#floatfield Rob, I am never letting you do my financial programming for me. Float fields lose precision. Inexact. Approximate. There is no Django field that is arbitrary

Re: Black Box Testing Framework for Django

2008-07-09 Thread Rob Hudson
I've seen articles using Twill: http://twill.idyll.org/ And Selenium for Javascript testing: http://selenium.openqa.org/ I'm pretty sure Twill would meet your definition of "Black Box Testing" since it has no knowledge of the internals of the Django app you are testing. -Rob On Jul 8, 10:55 

Re: accessing a model ojbect's saved fields

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 17:02 +0200, KONTRA, Gergely wrote: > > Could you override the save method and remove the file from the > > filesystem prior to saving? > > That's what I'm attempting to. > BUT: > the question is: how can I figure out the database-saved value of the photo > > class

Re: accessing a model ojbect's saved fields

2008-07-09 Thread KONTRA, Gergely
> Could you override the save method and remove the file from the > filesystem prior to saving? That's what I'm attempting to. BUT: the question is: how can I figure out the database-saved value of the photo class MyModel(models.Model): photo = ImageField(upload_to='temp') def

Re: Arbitrary precision arithmetic in django

2008-07-09 Thread Rob Hudson
FloatField? http://www.djangoproject.com/documentation/model-api/#floatfield On Jul 9, 4:02 am, shabda <[EMAIL PROTECTED]> wrote: > I need to do some Financial calculations in an app in Django. > models.DecimalField is fixed precision, while I need an arbitrary > precision field. How can I do

Re: accessing a model ojbect's saved fields

2008-07-09 Thread Rob Hudson
Could you override the save method and remove the file from the filesystem prior to saving? e.g. class MyModel(models.Model): ... def save(self): if self.id: # is a record in the database # file system unlink call to self.path super(MyModel, self).save()

Re: In admin, unable to save many-to-many relation objects with intermidiate table

2008-07-09 Thread Rob Hudson
I just bumped into this last night and found that having core on the ForeignKey field cause it to not save the record. Try removing core=True and see if that helps. -Rob On Jul 8, 6:02 pm, "ristretto.rb" <[EMAIL PROTECTED]> wrote: > Hello, I'm stuck.  Any help will be much appreciated. > > I

Re: AutoImageField From Custom upload and filters

2008-07-09 Thread Milan Andric
On Tue, Jul 8, 2008 at 10:23 AM, Milan Andric <[EMAIL PROTECTED]> wrote: > On Tue, Jul 8, 2008 at 10:02 AM, moos3 <[EMAIL PROTECTED]> wrote: >> >> does any know why the auto_rename loses the file name but not the >> extension? > > Not familiar with auto_rename but maybe if you show a little code

Re: streaming output

2008-07-09 Thread Brogli
Thanks for the information. I was hoping to use Django for all of the web application I'm building (which requires a continuous stream of data to the client rather than poling) though it appears I'll have to build the streaming portion outside of Django, or perhaps modify the server behavior to

Re: Too many values to unpack error

2008-07-09 Thread Arien
On Wed, Jul 9, 2008 at 9:27 AM, Fernando Rodríguez <[EMAIL PROTECTED]> wrote: > > Hi, > > I'm getting this error while calling .as_table() on a form. This is how > I define the form and the view function: > > from django import newforms as forms > > TOPIC_CHOICES = ( ('general', 'General

Re: Too many values to unpack error

2008-07-09 Thread rui
Looks like you are following the djangobook, so check if your view is like: Contact us Contact us {{ form.as_table }} Cheers. -- Rui --~--~-~--~~~---~--~~ You received this message because you are

Too many values to unpack error

2008-07-09 Thread Fernando Rodríguez
Hi, I'm getting this error while calling .as_table() on a form. This is how I define the form and the view function: from django import newforms as forms TOPIC_CHOICES = ( ('general', 'General enquiry'), ('bug', 'Bug report'), ('suggestion' 'Suggestion'),

Re: Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
Karen, thanks for that. Yes it is the same bug. I tried the fix and it solved the issue. Not sure how "nice" the fix is yet but it makes the SVN work for this project again. o On Jul 9, 3:04 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 2008 at 8:31 AM, oliver <[EMAIL

Re: Problems using custom sql in manager

2008-07-09 Thread AJ
Thanks for your assistance, I got it working properly now. On Jul 8, 9:55 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Tue, 2008-07-08 at 17:17 -0700, AJ wrote: > > Thanks for your quick reply.  I have been searching for a long time > > for good documentation on using IN and paramaters

Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread Joshua Jonah
Tim Chase wrote: >>> Any other tips to getting up to speed fast? >>> >> With the internal code? I wish there was some silver bullet like that. >> > > I found James Bennett's page[1] on "How Django processes a > request" helpful for understanding the big picture of how the > pieces

Re: What is the fastest way to come up to speed with Django?

2008-07-09 Thread Tim Chase
>> Any other tips to getting up to speed fast? > > With the internal code? I wish there was some silver bullet like that. I found James Bennett's page[1] on "How Django processes a request" helpful for understanding the big picture of how the pieces fit together. It helps makes sense of

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
On Wed, 09 Jul 2008 16:06:23 +0200, Adi J. Sieker <[EMAIL PROTECTED]> wrote: > True, but then it opens another are which needs to be maintained. ups, thats meant tobe "another area" Regards Adi -- Adi J. Sieker mobile: +49 - 178 - 88 5 88 13 Freelance developer skype:

How to get the Django bug and version data ?-I need help:)

2008-07-09 Thread BlueSky
Hello, I am a novice. I plan to study whether the design measures can predict fault-prone classes in Python. Through investigating, Django is a good experimental subject. I need the the Django bug and version data. Is there any web API for accessing the Django bug and version databases? It is a

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
On Wed, 09 Jul 2008 15:50:32 +0200, Joshua Jonah <[EMAIL PROTECTED]> wrote: > Mod rewrite will be faster and more efficient. Not to mention, it takes > some complexity out of your project. True, but then it opens another are which needs to be maintained. But in general I do agree that

Re: URLs rewrite

2008-07-09 Thread Eric Abrahamsen
> Mod rewrite will be faster and more efficient. Not to mention, it > takes some complexity out of your project. Granted that's true, I wonder if contrib.redirects would be more effective if it used regexs. Particularly for old-site to new-site conversions, one-to-one redirects aren't

Re: Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread Karen Tracey
On Wed, Jul 9, 2008 at 8:31 AM, oliver <[EMAIL PROTECTED]> wrote: > > one more note, I was not uploading a new file. just re-saving the > object. > > On Jul 9, 1:31 pm, oliver <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I get this odd error:http://dpaste.com/61580/ > > > > "SuspiciousOperation:

Re: URLs rewrite

2008-07-09 Thread Joshua Jonah
Adi J. Sieker wrote: > On Wed, 09 Jul 2008 15:27:07 +0200, Antoni Aloy <[EMAIL PROTECTED]> > wrote: > > >> 2008/7/9 RHC <[EMAIL PROTECTED]>: >> >>> I know this may seem like an insanely simple question, but I'm a real >>> newbie so be kind. >>> >>> I am trying to upgrade from an old php

Re: URLs rewrite

2008-07-09 Thread Adi J. Sieker
On Wed, 09 Jul 2008 15:27:07 +0200, Antoni Aloy <[EMAIL PROTECTED]> wrote: > 2008/7/9 RHC <[EMAIL PROTECTED]>: >> >> I know this may seem like an insanely simple question, but I'm a real >> newbie so be kind. >> >> I am trying to upgrade from an old php website to Django. The problem >> is I

Re: Ordering a queryset with the same field type from two different models

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 06:25 -0700, [EMAIL PROTECTED] wrote: > Thanks Malcolm for a speedy response! > > I guess my best bit is to somehow output the QuerySet into a list > which I can then order myself (although this seems a bit ugly!), or > have a rethink about the design of the two models.

Re: list_display a Many to Many field

2008-07-09 Thread urukay
this should work: def get_authors(self): return self.authors.all() list_display = ('title', 'Publisher', 'publicationDate', 'get_authors' ) Radovan Fernando Rodríguez wrote: > > > Hi, > > I'm trying to display a many to many field in the admin interface. > > This is my model: > >

list_display a Many to Many field

2008-07-09 Thread Fernando Rodríguez
Hi, I'm trying to display a many to many field in the admin interface. This is my model: class Book(models.Model): title = models.CharField(maxlength = 100, db_index = True) authors = models.ManyToManyField(Author) Publisher = models.ForeignKey(Publisher) publicationDate =

Re: URLs rewrite

2008-07-09 Thread Antoni Aloy
2008/7/9 RHC <[EMAIL PROTECTED]>: > > I know this may seem like an insanely simple question, but I'm a real > newbie so be kind. > > I am trying to upgrade from an old php website to Django. The problem > is I need to 301 redirect old urls to new Django ones, eg. > >

Re: Ordering a queryset with the same field type from two different models

2008-07-09 Thread [EMAIL PROTECTED]
Thanks Malcolm for a speedy response! I guess my best bit is to somehow output the QuerySet into a list which I can then order myself (although this seems a bit ugly!), or have a rethink about the design of the two models. Thanks again, Mike. On Jul 9, 2:07 pm, Malcolm Tredinnick <[EMAIL

accessing a model ojbect's saved fields

2008-07-09 Thread pihentagy
Hi all! Is it possible to access a model object's saved field values? Purpose: I have an ImageField, and if that field changes, I would like to remove the old file from the filesystem. Now the only way to figure it out is with a new query, but I suspect this hits the database again, and seems a

Re: newforms-admin, forms.ModelForm, formtools.preview

2008-07-09 Thread d-rave
Thanks very much for these responses, they've given me something to think about. However, assuming I'm going about things the right way, the problem appears with the loading of Model data into a Form object which can be passed to a FormTools.preview class. For example, in the view function

Re: Ordering a queryset with the same field type from two different models

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 05:51 -0700, [EMAIL PROTECTED] wrote: [...] > I tried using the order_by with two sets of dates: > > .order_by('-related_name_to_model__date_field_in_B', '- > date_field_in_A') > > However, this just produces a queryset that is partitioned into two > separate date

Ordering a queryset with the same field type from two different models

2008-07-09 Thread [EMAIL PROTECTED]
Hi guys, I'm having a bit of trouble figuring this problem out. I have "Model A" with a set of fields, one of which is of type DateTimeField with auto_now_add=True, and the same in a second "Model B". Model B has a foreign key relationship to Model A. ModelA: date_field_in_A =

Re: how to log in automaticly

2008-07-09 Thread oliver
Hi, just do this after the "registration" part is completed http://www.djangoproject.com/documentation/authentication/#how-to-log-a-user-in On Jul 9, 7:15 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > i am using registration module from google, does anyone know how to > log in

Submit Button jammed by Tiny_MCE django widget while using newforms

2008-07-09 Thread Ramdas S
Hi I am using TinyMCE to create pages using newforms. I am following this link http://code.djangoproject.com/wiki/CustomWidgetsTinyMCE The program works perfectly without TinyMCE. But the submit button stops working once I include TinyMCE widget to render the textbox. I am following exactly

Re: Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
one more note, I was not uploading a new file. just re-saving the object. On Jul 9, 1:31 pm, oliver <[EMAIL PROTECTED]> wrote: > Hi, > > I get this odd error:http://dpaste.com/61580/ > > "SuspiciousOperation: The multipart parser got stuck, which shouldn't > happen with normal uploaded files.

Error in latest SVN "multipartparser.py", think it is a bug ..

2008-07-09 Thread oliver
Hi, I get this odd error: http://dpaste.com/61580/ "SuspiciousOperation: The multipart parser got stuck, which shouldn't happen with normal uploaded files. Check for malicious upload activity; if there is none, report this to the Django developers." This started happening only since I updated

Re: newb URL mapping problem

2008-07-09 Thread JeffH
Thanks. I can live with it. The main thing is knowing I'm not crazy. ;-) On Jul 9, 8:00 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Wed, 2008-07-09 at 04:51 -0700, JeffH wrote: > > I have a URL mapping problem, running 0.96.2 on Windows. > > > The problem: I have to specify the site

Re: newb URL mapping problem

2008-07-09 Thread Malcolm Tredinnick
On Wed, 2008-07-09 at 04:51 -0700, JeffH wrote: > I have a URL mapping problem, running 0.96.2 on Windows. > > The problem: I have to specify the site name in the urls.py or else I > get 404s. > > For example: > urlpatterns = patterns('', > (r'^/$', home), > (r'^/home/$', theview), >

newb URL mapping problem

2008-07-09 Thread JeffH
I have a URL mapping problem, running 0.96.2 on Windows. The problem: I have to specify the site name in the urls.py or else I get 404s. For example: urlpatterns = patterns('', (r'^/$', home), (r'^/home/$', theview), (r'^SouthHavenReservations/home1/$', theview1),

Arbitrary precision arithmetic in django

2008-07-09 Thread shabda
I need to do some Financial calculations in an app in Django. models.DecimalField is fixed precision, while I need an arbitrary precision field. How can I do this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Response wit File Name

2008-07-09 Thread jurian
So the the filename is then determined by the browser, of course! That makes sense. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Response wit File Name

2008-07-09 Thread Arien
On Wed, Jul 9, 2008 at 4:43 AM, jurian <[EMAIL PROTECTED]> wrote: > > Is there any way to specify the filename that a HTTPResponse will be > saved as on the browser side? > > (without using the 'Content-Disposition' header, I see many responses > with filenames that don't use this header) I

Re: Where is the source code for Practical Django Projects?

2008-07-09 Thread James Bennett
On Wed, Jul 9, 2008 at 3:33 AM, Evan H. Carmi <[EMAIL PROTECTED]> wrote: > I am reading Practical Django Projects but am unable to find the online > source code. Does anyone know where this is located? I would think that > it would be at http://www.apress.com/book/view/1590599969. However, that >

Response wit File Name

2008-07-09 Thread jurian
Is there any way to specify the filename that a HTTPResponse will be saved as on the browser side? (without using the 'Content-Disposition' header, I see many responses with filenames that don't use this header) --~--~-~--~~~---~--~~ You received this message

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-09 Thread Nicolas Steinmetz
On Jul 9, 11:10 am, "Marek Stępniowski" <[EMAIL PROTECTED]> wrote: > It seems you are running into one of django-tagging quirks. > See issue #95 [http://code.google.com/p/django-tagging/issues/detail?id=95]. Oh thanks I missed this issue. I'll test it this evening. Regards, Nicolas

Re: Issue with django-tagging 0.3 (svn) with models definition

2008-07-09 Thread Marek Stępniowski
On Sat, Jul 5, 2008 at 11:23 PM, Nicolas Steinmetz <[EMAIL PROTECTED]> wrote: > Despite I read a lot of time the overview.txt on the django tagging svn > repository, I still can't stand how to use it at my model's level. I'm > quite new to python and may miss some elements. > > When diving into

Where is the source code for Practical Django Projects?

2008-07-09 Thread Evan H. Carmi
Hi, I am reading Practical Django Projects but am unable to find the online source code. Does anyone know where this is located? I would think that it would be at http://www.apress.com/book/view/1590599969. However, that doesn't seem to be the case. Thanks, Evan

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-09 Thread ristretto.rb
Wow, Karen, you're amazing. Thanks for that. I can say I learned a lot about Django today with your help. thanks!! On Jul 9, 6:38 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote: > On Wed, Jul 9, 2008 at 12:57 AM, ristretto.rb <[EMAIL PROTECTED]> > wrote: > > > I'm using the svn version.  I

Re: In admin, unable to save many-to-many relation objects with intermediate table

2008-07-09 Thread Karen Tracey
On Wed, Jul 9, 2008 at 12:57 AM, ristretto.rb <[EMAIL PROTECTED]> wrote: > I'm using the svn version. I updated this morning. I can't remember > if I was getting the error before I updated, or not. > That ticket I pointed to identifies r7710 as a revision where this problem did not exist.

  1   2   >