File upload and access properties

2008-08-25 Thread Julien Phalip
Hi, I'm using the FileSystem storage to save uploaded files, in a very basic way: storage.save('/blah/test.mp3', uploaded_file) Now, the resulting file has '600' file access properties. That file is then served by apache, but because of those access properties, it cannot be accessed as you get

Re: Custom manager for many-to-many traversal

2008-08-25 Thread MrJogo
I could, but I need to do it in a template, and from what I understand, passing variables to method calls in the template language is a pain, or at least ugly. I think a custom manager is the elegant, "proper" way to so it (someone can correct me if I'm wrong. On Aug 25, 10:31 am, John M <[EMAIL

Re: send_mail timeout

2008-08-25 Thread tm
Ok I figured it out. Basically I changed the send port to something other than 25. Apparently my machine requires that. On Aug 25, 11:27 pm, tm <[EMAIL PROTECTED]> wrote: > Hello, I am trying to use django's send_email exactly as in the docs, > and am receiving 10060, 'Operation timed out'.  I

Re: settings.TIME_ZONE

2008-08-25 Thread lingrlongr
Here's more info: $ ./manage.py shell Python 2.5 (r25:51908, Mar 23 2007, 14:22:20) [GCC 3.4.6 20060404 (Red Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> from datetime import datetime >>> datetime.today()

send_mail timeout

2008-08-25 Thread tm
Hello, I am trying to use django's send_email exactly as in the docs, and am receiving 10060, 'Operation timed out'. I am developing on my local machine and using my webhost's email (the same settings I use in outlook send mail fine). I have the my settings file populated with the right data

settings.TIME_ZONE

2008-08-25 Thread lingrlongr
I'm a little confused about the TIME_ZONE setting in settings.py. I originally had it set to 'America/New_York', because that's the time zone where I'm located, but I noticed the times were ~4 hours off when I would save an object that had a DateTimeField(auto_now_add=True) field in the model.

Re: disable admin log

2008-08-25 Thread chefsmart
Thanks Malcolm. On Aug 25, 9:14 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-08-25 at 09:12 -0700,chefsmartwrote: > > Can someone in the know please confirm the existence or otherwise of > > an option to disable logging in admin? > > Such an option does not exist. > >

Re: help implementing search in django

2008-08-25 Thread chefsmart
That's a really good suggestion. Will go over that code today. Still would like to hear other opinions though. On Aug 26, 1:48 am, Steve Potter <[EMAIL PROTECTED]> wrote: > I really don't have any experience with this.  However if I was trying > to implement a search, the first thing I would do

Best wiki for the "support" section of a ISV

2008-08-25 Thread mamcxyz
I'm working towards a relaunch of my website, with new focus & products. I have 1 main product for the consumer (the focus) & resell 6 for the developers. I wanna a simpler but profesional face. Also, as now, I'm a solo- developer so need the more simple aproach. I hope get something like in

Re: Strategies for staying current with django development

2008-08-25 Thread Jay Parlar
Another good idea is to listen to the "This Week in Django" podcast (www.thisweekindjango.com). They cover all the major things that have happened to trunk in the last week, as well as things happening in the community, snippets they've run across, etc. It's put together really well, and fun to

Re: Strategies for staying current with django development

2008-08-25 Thread Gremmie
On Aug 25, 8:06 pm, Gremmie <[EMAIL PROTECTED]> wrote: > Karen, I am using a customized admin template, so perhaps my auth > problem is related to that. Indeed, my admin/index.html needed an update. The {% get_admin_app_list as app_list %} stuff is now obsolete. Thanks!

HowTo: Django view as a class

2008-08-25 Thread zvoase
Hey Django users, just a quick suggestion which might help a few people. I have come up with a way of writing a Django view as a class. I've done this as part of an effort to write easier-to-understand RESTful apps, as this allows the grouping of similar views as different types of operation on a

Re: MultipleObjectsReturned with get() on 1.0-beta1 admin UI

2008-08-25 Thread dchandek
OK, this is interesting: I didn't mention that I also has limit_choices_to set on the self-referential foreign key. When I remove limit_choices_to the problem goes away! My model is listed below. I had set limit_choices_to=PARENT_CHOICES on OrgUnit.parent. [start code] LIBRARY_ID = 1

Re: Strategies for staying current with django development

2008-08-25 Thread Gremmie
Thanks for the replies so far. I'm glad to hear someone thinks a dump and reload of the auth tables isn't necessary. Can I also assume that the model to database mapping hasn't changed, and I don't need to drop my model tables and reload? I did make a careful note of what rev I had django pinned

Re: MultipleObjectsReturned with get() on 1.0-beta1 admin UI

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 17:44 -0700, dchandek wrote: > To make this even stranger, the problem only occurs when the pk of the > selected (self-)related object is 1. There's something deep going on > in Django that I can't trace ... This is going to be infinitely easier to debug if have a small

Re: MultipleObjectsReturned with get() on 1.0-beta1 admin UI

2008-08-25 Thread dchandek
To make this even stranger, the problem only occurs when the pk of the selected (self-)related object is 1. There's something deep going on in Django that I can't trace ... --David On Aug 25, 4:20 pm, dchandek <[EMAIL PROTECTED]> wrote: > After upgrading from post-0.96 development version to

Setting the value of the select box for a ModelChoiceField

2008-08-25 Thread [EMAIL PROTECTED]
Hi, I am using the ModelChoiceField to provide a filtered set of choices on a profile form and I was wondering how I can set the initial value of the select box. In other words I want to set the initial value of the form to the value retrieved from the database when a person is editing or

Re: simple multiplication in models

2008-08-25 Thread Chris Amico
Awesome. That worked. Thanks all. On Aug 25, 4:14 pm, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-08-25 at 15:58 -0700, Chris Amico wrote: > > Changed the variable names to make it a little more readable. Method > > now returns "amount" (formerly "total"): > > > Class

Re: simple multiplication in models

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 15:58 -0700, Chris Amico wrote: > Changed the variable names to make it a little more readable. Method > now returns "amount" (formerly "total"): > > Class Item(models.Model): > name = models.CharField(max_length=100) > price = models.DecimalField(max_digits=9,

Re: exporting apps and db from windows to ubuntu.

2008-08-25 Thread John M
from the command line / console / whatever... ./manage.py dumpdata http://www.djangoproject.com/documentation/django-admin/#dumpdata-appname-appname On Aug 25, 3:25 pm, KillaBee <[EMAIL PROTECTED]> wrote: > ok it is dumpdata and loaddata, but where does it go?  I searched for > *.json but

Re: simple multiplication in models

2008-08-25 Thread Chris Amico
Changed the variable names to make it a little more readable. Method now returns "amount" (formerly "total"): Class Item(models.Model): name = models.CharField(max_length=100) price = models.DecimalField(max_digits=9, decimal_places=2) quantity = models.IntegerField(default=1)

Re: simple multiplication in models

2008-08-25 Thread nicksergeant
Should 'total_cost' simply: return total instead of: return total_cost(total) On Aug 25, 5:22 pm, Chris Amico <[EMAIL PROTECTED]> wrote: > This seems like it should be simple, but I'm getting errors. > > I have a model tracking individual purchases. User inputs an item cost > and quantity; I

Re: exporting apps and db from windows to ubuntu.

2008-08-25 Thread KillaBee
ok it is dumpdata and loaddata, but where does it go? I searched for *.json but nothing came up. and there are alot of fixtures. On Aug 25, 4:05 pm, KillaBee wrote: > I am moving a app and db from a windows server to a Ubuntu server.  Is > there a easy way to export the data from the windows

Re: simple multiplication in models

2008-08-25 Thread Karen Tracey
On Mon, Aug 25, 2008 at 5:22 PM, Chris Amico <[EMAIL PROTECTED]> wrote: > > This seems like it should be simple, but I'm getting errors. > > I have a model tracking individual purchases. User inputs an item cost > and quantity; I want the total cost calculated. Here are the relevant > parts: > >

prepopulated_fields with generic relations

2008-08-25 Thread Donovan
Hi, I am trying to get this model and admin declaration working: #models.py class SeoUrl(models.Model): seotitle = models.SlugField(max_length = 100) priority = models.PositiveIntegerField(blank=False, null=False) content_type = models.ForeignKey(ContentType)

simple multiplication in models

2008-08-25 Thread Chris Amico
This seems like it should be simple, but I'm getting errors. I have a model tracking individual purchases. User inputs an item cost and quantity; I want the total cost calculated. Here are the relevant parts: class Item(models.Model): name = models.CharField(max_length=100) price =

Re: Strategies for staying current with django development

2008-08-25 Thread Karen Tracey
On Mon, Aug 25, 2008 at 5:01 PM, Steve Potter <[EMAIL PROTECTED]>wrote: > If you look in the django-users archive I think I remember a few other > people having the same auth problems you are describing, however I > don't remember the solution. > As I recall a lot of people reported this error,

Re: Empty template_name for login

2008-08-25 Thread Karen Tracey
2008/8/25 Ludwig <[EMAIL PROTECTED]> > I am using the 1.0 beta 1 release. > > I think I am following the documentation, when I set > > ('^accounts/login/(.*)', 'django.contrib.auth.views.login', {}), > > in my urls.py > > But then I get a TemplateDoesNotExist exception when opening >

exporting apps and db from windows to ubuntu.

2008-08-25 Thread KillaBee
I am moving a app and db from a windows server to a Ubuntu server. Is there a easy way to export the data from the windows server and import it into the Ubuntu server. I don't think that I can copy and paste, then change the URLS.py file. I looked for the files but the files I did see looks

Re: Strategies for staying current with django development

2008-08-25 Thread Steve Potter
Personally when the newforms-admin was merged I quit updateing django so I wouldn't have to make multiple changes to my code before the 1.0 release. Then I planned to move everything to 1.0 and stay with it until another major release (or until there was a new feature I couldn't live without

Re: help implementing search in django

2008-08-25 Thread Steve Potter
I really don't have any experience with this. However if I was trying to implement a search, the first thing I would do is look at the Django Admin code and see how it was done there. Steve On Aug 25, 1:15 pm, chefsmart <[EMAIL PROTECTED]> wrote: > Please seehttp://dpaste.com/hold/73759/I

Strategies for staying current with django development

2008-08-25 Thread Gremmie
I checked out the latest django from SVN some 14 weeks ago and built a site with it. It rocks. :-). Yesterday, I decided to port my code to the latest to take advantage of the newforms-admin. I had to update my Photologue app also. A lot of stuff has changed! I am not quite there yet, but I can

Better way that _meta to alter Admin?

2008-08-25 Thread Jay Parlar
I'm starting to port my projects, from a version of Django before NFA. In the past, I had something like this: User._meta.admin.list_display = User._meta.admin.list_display + ('is_active',) User._meta.get_field('is_staff').help_text = u"Select this if you want this user to be able to log into

MultipleObjectsReturned with get() on 1.0-beta1 admin UI

2008-08-25 Thread dchandek
After upgrading from post-0.96 development version to 1.0-beta1, I now get a MultipleObjectsReturned when submitting a change via the Admin UI to an object, where the model has a many-to-one relationship with itself. From the Python interactive prompt I am not able to reproduce the error.

Re: urlpatterns and generic views cheatsheet

2008-08-25 Thread maeck
I have printed this from scribd into a PDF and use it as such, no need for login. Works somewhat, cannot select the text from it (could have run some text recognition on it), but expect to find the original code or pdf somewhere soon (Google code maybe). maeck

Re: Random NoReverseMatch

2008-08-25 Thread koenb
I guess you are seeing the bug reported in #6379. You probably have an import error somewhere, but it is being hidden by the NoReverseMatch exception that is raised for anything that goes wrong. Koen On 25 aug, 16:13, Robin <[EMAIL PROTECTED]> wrote: > Hello, > > i have the same exception and

Create/update/delete generic views and user

2008-08-25 Thread mccomas . chris
Is is possible with Create/update/delete generic views to get the user that's logged in's ID and use? I have a field with a FK for user, I'd really just like to use the generic views for this, since it's a simple thrown together internal site, instead of writing out other views/forms/etc. So,

Empty template_name for login

2008-08-25 Thread Ludwig
I am using the 1.0 beta 1 release. I think I am following the documentation, when I set ('^accounts/login/(.*)', 'django.contrib.auth.views.login', {}), in my urls.py But then I get a TemplateDoesNotExist exception when opening /accounts/login. The template (standard

Re: email not being sent from within unit tests

2008-08-25 Thread Andrew D. Ball
It turns out that this is by design: http://docs.djangoproject.com/en/dev/topics/testing/#e-mail-services This behavior is fine -- even better than the SMTP "black hole" setup that I have. Peace, Andrew On Tue, Aug 19, 2008 at 07:21:52PM -0400, Andrew D. Ball wrote: > I've noticed that email

Re: Modules path when importing models

2008-08-25 Thread Norman Harman
Alexis Bellido wrote: > I'm reading the Django book and playing with the 'mysite' test site, > in many parts I've noticed something like this in views.py: > > from mysite.models import Event, BlogEntry > > I was wondering if it's good practice using 'mysite.models' (which > seems to be an

help implementing search in django

2008-08-25 Thread chefsmart
Please see http://dpaste.com/hold/73759/ I need some guidance implementing search feature in django. What I want to do is to be able to search for Regions. Let's suppose we have: - A page where the user will be able to specify (a) one or multiple states from a list, (b) one user to match with

Re: how to get {% url %} working with {% blocktrans %}?

2008-08-25 Thread David Larlet
Le 23 août 08 à 13:45, Viktor Nagy a écrit : > > Hi! > > I need a url in a blocktrans message, but I have no clue how to do it. > > it would be intuitive to use > > {% blocktrans url app.views.add as createurl %} > and then {{ createurl }} > > but it didn't work for me. > > could someone help

Re: Processing multiple forms in same page

2008-08-25 Thread timc3
Well then you just test to see what fields are pulled back, but its fine, its possible. I am doing it for a forum. On Aug 24, 2:51 am, Rodolfo <[EMAIL PROTECTED]> wrote: > Just for curiosity, why would one have two forms in a single page? > I don't think it is possible to submit the two in a

Making time sheet program.

2008-08-25 Thread KillaBee
How do I get started making a time sheet program? I have did the polls on the Django websie, but I can't get it to do what I want it to. I just need a username, radio, and number fields to go into a table. yes I a new to this django. --~--~-~--~~~---~--~~ You

Re: Widget rendering working as intended?

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 10:35 -0700, Alex G wrote: > Hi there, > > I have been trying to get a function call into a widget argument, but > have not been able to at the template level, because it would appear > that my safe_strings are being escaped somewhere down in the > framework. I have

Re: Widget rendering working as intended?

2008-08-25 Thread Alex G
Whoops, I forgot the actual call to mark_safe in the above example, but everything holds... class MyWidget(forms.TextInput): def __init__(self, *args, **kwargs): attrs = kwargs.setdefault('attrs', {}) attrs['safe_string'] = mark_safe("will o' the wisp")

form inheritance

2008-08-25 Thread fax8
Hi guys, anyone can tell me why the following does not works as expected? I mean why, when displaying the form with: form = RenderForm() return render_to_response('add_render.html', {'form': form}, context_instance=RequestContext(request)) the subject field is not displayed? And why the

Widget rendering working as intended?

2008-08-25 Thread Alex G
Hi there, I have been trying to get a function call into a widget argument, but have not been able to at the template level, because it would appear that my safe_strings are being escaped somewhere down in the framework. I have created a widget and mark_safe'd an attribute value, but no matter

Re: Template path for new admin doc broken in revision 8520?

2008-08-25 Thread Shadow
Hi, not an expert! but I think I had this same problem. The admin docs were fairly recently moved into a separate app. So you'll need to update your urls to something like: -- from

Re: urlpatterns and generic views cheatsheet

2008-08-25 Thread rex
Tim Chase <[EMAIL PROTECTED]> [2008-08-25 08:43]: > >> It's not terribly obvious from the scribd layout, but at the >> top (above the document) there's a "download" link or similar, >> and there you can download the original PDF. > >...which expects that I create login... Copy & paste doesn't

Re: photologue installation

2008-08-25 Thread Karen Tracey
On Mon, Aug 25, 2008 at 12:39 PM, Briohny <[EMAIL PROTECTED]> wrote: > > I'm using the Django-1.0-alpha_2 version and I'm trying to install the > photologue application. When i run my database sync it's coming up > with the following error: > > > File "C:\Documents and Settings\TR\Sample > >

Re: ANN: An unofficial companion to Practical Django Projects

2008-08-25 Thread [EMAIL PROTECTED]
Thanks for the update, Brett. I just did a "svn up" on the django code last night and found the code in the book no longer work. I will keep track of your blog. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

photologue installation

2008-08-25 Thread Briohny
I'm using the Django-1.0-alpha_2 version and I'm trying to install the photologue application. When i run my database sync it's coming up with the following error: File "C:\Documents and Settings\TR\Sample > Projects\newsite\photologue\models.p > y", line 95, in Gallery >help_text='A

Re: How to know which fields a model contains?

2008-08-25 Thread Jim D.
I'm pretty new to python myself, but my favorite way to inspect objects that I have found so far is the builtin method dir(). As in: dir(Publisher.objects.get(pk=1)) dir() tells you all of the methods and attributes for a given object, though it doesn't display the value of attributes.

Issue with serializing a queryset that includes a custom SQL field defined by extra()

2008-08-25 Thread Jim D.
I think this might be a bug in source code, but before I report a ticket I thought I would ask just to ensure it's not me doing something wrong/stupid. In brief, I have a (MySQL) database table containing latitude and longitude columns. I am finding records from this table and sorting them based

ANN: Django group in Israel

2008-08-25 Thread Ahik Man
Hi All, We have an Israeli group for web-app development with Python. Well, it is mostly Django. We are going to have our second meeting in two weeks for now. The meeting will be title is: Django and Google-app. If you are interesting: come join us at: http://groups.google.com/group/pyweb-il

Re: How to know which fields a model contains?

2008-08-25 Thread Alexis Bellido
Thanks everybody, using __dict__ and meta_fields helped but the most complete data came from the documentation in admin, that's exactly what I needed :) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users"

Modules path when importing models

2008-08-25 Thread Alexis Bellido
I'm reading the Django book and playing with the 'mysite' test site, in many parts I've noticed something like this in views.py: from mysite.models import Event, BlogEntry I was wondering if it's good practice using 'mysite.models' (which seems to be an 'absolute path' for importing) or if it

Foreign key on forms

2008-08-25 Thread chewynougat
Hi, I need to display a form such that the foreign key fields are displayed exactly like that in djangoproject.com/documentation/ tutorial02, where up to 3 entries can be made using the fk fields. It would be nice to have the same functionality provided in this tutorial for normal forms, not

Re: Changing Login Page for Admin

2008-08-25 Thread Tim Sawyer
On Sunday 24 Aug 2008, Tim Sawyer wrote: > Hi, > > I'm using the newforms admin stuff, and I'd like to use my own URL for the > login page for the admin site. > > So, if someone goes to /admin on my site (which is where the admin site is > located), I'd like to redirect to

DATE_WITH_TIME_FULL bug in multiple i18n???

2008-08-25 Thread est
Hi guys! This is my first time submitting a ticket to a OSS project. So if I did something wrong plz tell me :-) http://code.djangoproject.com/ticket/8541 I discovered in history of a custom model's auto-admin interface. that the date/time displays wrong. in zh_CN locale is shows SunPMChina

Re: Is it possible to use Django + Postgresql on leopard?

2008-08-25 Thread Theme Park Photo, LLC
Thanks for the tips! I'll try again. I have to admit, I'm one of those new "Switchers" (despite being a former Apple employee, I never ran Mac at home!) and exepct all Unix-y things to "just work". I'm going to clean out everything I tried to install and then attempt the Fink and the MacPorts

Re: Calling attributes from other models

2008-08-25 Thread Norman Harman
Matt Berg wrote: > I apologize, I realize this is probably documented somewhere. > > Say I have 2 models. > > Artist and Album > > Album has a foreign key to Artist. > > I want to do a list_display of Albums something like this... > > list_display =

Re: disable admin log

2008-08-25 Thread Malcolm Tredinnick
On Mon, 2008-08-25 at 09:12 -0700, chefsmart wrote: > Can someone in the know please confirm the existence or otherwise of > an option to disable logging in admin? Such an option does not exist. Regards, Malcolm --~--~-~--~~~---~--~~ You received this message

Re: disable admin log

2008-08-25 Thread chefsmart
Can someone in the know please confirm the existence or otherwise of an option to disable logging in admin? On Aug 14, 12:52 pm, chefsmart <[EMAIL PROTECTED]> wrote: > In my case I don't require the admi log. To save trips to the database > server, is there a way to disable logging in admin?

Re: dynamic creation of model with geodjango ?

2008-08-25 Thread guillaume
Hi Justin, Glad to hear you too actually ! Your analysis is completely right ! I've already build an app which allows to feed a postgis database with Django. But geodata is completely disconnected from the app itself. So yes, the idea would be to automatically build a geodjango model from that

Re: Form validation

2008-08-25 Thread julianb
On Aug 23, 11:17 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > This seems to have done the trick. Thanks for your help. > > def index(request): >     if request.method == 'POST': >         form = pasteForm(request.POST) >         if form.is_valid(): >             name =

ANN: An unofficial companion to Practical Django Projects

2008-08-25 Thread Brett H
I'm really enjoying learning Django through Practical Django Projects (thanks James), but obviously with the newforms admin in 1.0 the examples needed a bit of re-working. After seeing a few people asking similar questions in this group I decided to just write it up for others who may have

Re: urlpatterns and generic views cheatsheet

2008-08-25 Thread Tim Chase
> It's not terribly obvious from the scribd layout, but at the > top (above the document) there's a "download" link or similar, > and there you can download the original PDF. ...which expects that I create login... Given that the source is likely just a PDF, posting a link to it somewhere is a

Re: Outputting PDF

2008-08-25 Thread saeb
forgot to mention, that I did HttpResponse(response) and there was just gibberish displayed... On Aug 25, 10:00 am, saeb <[EMAIL PROTECTED]> wrote: > Thanks, I did use form validation as inhttp://dpaste.com/73704/but I > couldn't get the validation to work. I wasn't sure what I was doing >

Re: i18 returns me an UnicodeDecodeError

2008-08-25 Thread Malcolm Tredinnick
On Sun, 2008-08-24 at 23:29 -0700, Jose Jiménez wrote: > Hello, > > i'm using the stable version (0.96.2) of Django. > When newforms library try to returns a field's validation error, if > his translation contains any accent, it returns me an > UnicodeDecodeError. If i deactivate i18n in

Re: Write Caching

2008-08-25 Thread TiNo
Maybe this could be a solution: http://www.stardata.it/articoli_en/triggers_on_select_articoli_en.html No idea how much overhead that would create though. On Sun, Aug 24, 2008 at 5:43 AM, Steve Potter <[EMAIL PROTECTED]>wrote: > > I am working on a project that involves logging every time an

Re: custom widget necessary?

2008-08-25 Thread peter_g
Thank you, Norman! > > Do you have links to examples? > > http://www.djangosnippets.org/snippets/937/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Boosting your productivity when debugging Django apps

2008-08-25 Thread Wes Winham
I use Wing IDE (not free, wingide.com). It contains a full debugger that worked for me with Django with minimal fuss. I can step through the whole thing by debugging the manage.py runserver --noreload The thing I find most valuable about their debugger is that it gives you a full python shell

Re: urlpatterns and generic views cheatsheet

2008-08-25 Thread Idan Gazit
Tim, It's not terribly obvious from the scribd layout, but at the top (above the document) there's a "download" link or similar, and there you can download the original PDF. -I On Aug 25, 5:50 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > Here is a summary of all the tutorials and docs that I

Re: urlpatterns and generic views cheatsheet

2008-08-25 Thread Tim Chase
> Here is a summary of all the tutorials and docs that I have > read on urlpatterns and generic views. It is a 2 page, > concise, example code based cheat sheet. > > http://www.scribd.com/doc/4975790/urlpatterns-for-django-cheatsheet Nifty, but scribd is annoying as heck. Printing from scribd

Re: Outputting PDF

2008-08-25 Thread saeb
Thanks, I did use form validation as in http://dpaste.com/73704/ but I couldn't get the validation to work. I wasn't sure what I was doing wrong, so I resorted to the ad hoc method you are seeing, hoping to resolve it once I get the view working. In regards to PDF generation, I wasn't sure what

Re: Segmentation fault (postgresql - psycopg2)

2008-08-25 Thread kire
Just to mention: it's appearantly a psycopg2 error. with psycopg1 everything worked fine. On Aug 25, 10:18 am, kire <[EMAIL PROTECTED]> wrote: > My site works fine locally mysql, sqlite and postgresql. On the server > it worked fine om mysql - myisam (well, as long you can speak about > fine for

Re: Custom manager for many-to-many traversal

2008-08-25 Thread John M
Since my_book.auther_set.all() returns a QS, can't you just say something like ...all().filter(author__isalive=True) or something like that? I've never tried, but I thought that django would figure it out? J On Aug 25, 12:11 am, MrJogo <[EMAIL PROTECTED]> wrote: > How do I create a custom

Re: custom widget necessary?

2008-08-25 Thread Norman Harman
peter_g wrote: > Hi! > > I have datetime fields like "createdate" or "modified" in some of my > models. > Do I need to create custom widgets if i want their time and date to > be displayed in the admin area (change-form) and not the default > editable representation (text fields, with "now" etc.

Calling attributes from other models

2008-08-25 Thread Matt Berg
I apologize, I realize this is probably documented somewhere. Say I have 2 models. Artist and Album Album has a foreign key to Artist. I want to do a list_display of Albums something like this... list_display = ('album','release_date','artist') This works fine and displays

Hosting with support for Satchmo webstore

2008-08-25 Thread Benedict Verheyen
Hi, i need to develop a website with a webstore and i thought it was the perfect time to use Django & more specific Satchmo. However, Satcho has a big list of requirements and i'm not sure if this will work with the usual providers that have Django enabled. These are the requirements: *

Re: Random NoReverseMatch

2008-08-25 Thread Robin
Hello, i have the same exception and exactly as Julien explained in the dev server works fine ... and also works fine with fast_cgi, but I am using apache + mod_wsgi and it didn't work with the same problem: NoReverseMatch Has any of you any clue to this error ? thanks in advance, r

return django models using custom sql

2008-08-25 Thread chefsmart
I found a solution called djselect on this group. But is there a django-istic way of running custom sql queries and returning the results as django models? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django

Re: Outputting PDF

2008-08-25 Thread Karen Tracey
On Mon, Aug 25, 2008 at 9:01 AM, saeb <[EMAIL PROTECTED]> wrote: > > Hi, > > Following is my view. http://dpaste.com/73677/ > In the template I have 2 buttons, one is to retrieve results for the > id typed in the input box and other is to generate a PDF of the > results (if user desires). The

Outputting PDF

2008-08-25 Thread saeb
Hi, Following is my view. http://dpaste.com/73677/ In the template I have 2 buttons, one is to retrieve results for the id typed in the input box and other is to generate a PDF of the results (if user desires). The results are generated fine, but when I click the generatePDF button it gives a

custom widget necessary?

2008-08-25 Thread peter_g
Hi! I have datetime fields like "createdate" or "modified" in some of my models. Do I need to create custom widgets if i want their time and date to be displayed in the admin area (change-form) and not the default editable representation (text fields, with "now" etc. shortcuts)? Like, e.g.

Re: Template path for new admin doc broken in revision 8520?

2008-08-25 Thread Eric VW
I opened the ticket and I have a patch out there to fix the problem. The real problem is 'django.contrib.admindocs' doesn't really deserve its own contrib app page in the documents. It is more of a helper application than anything. It just needs to be enabled via INSTALLED_APPS and adding a

Re: Hosting with support for Satchmo webstore

2008-08-25 Thread Benedict Verheyen
David Zhou wrote: > On Aug 25, 2008, at 8:02 AM, Chris Moffitt wrote: > >> On Mon, Aug 25, 2008 at 5:17 AM, Benedict Verheyen <[EMAIL PROTECTED] >>> wrote: >> Hi, >> >> i need to develop a website with a webstore and i thought it was >> the perfect time to use Django & more specific Satchmo. >>

Re: Making Custom Model Methods to Work

2008-08-25 Thread David Zhou
On Aug 24, 2008, at 8:19 AM, rmschne wrote: > 4. calling render_to_response is differnt than I thought! > print render_to_response('mtg_summary.html',{'my_meeting':my_meeting}) > > Question: in the context of this example, in > {'my_meeting':my_meeting}), what are these two things opposite of

Re: Hosting with support for Satchmo webstore

2008-08-25 Thread David Zhou
On Aug 25, 2008, at 8:02 AM, Chris Moffitt wrote: > On Mon, Aug 25, 2008 at 5:17 AM, Benedict Verheyen <[EMAIL PROTECTED] > > wrote: > > Hi, > > i need to develop a website with a webstore and i thought it was > the perfect time to use Django & more specific Satchmo. > However, Satcho has a big

Re: Hosting with support for Satchmo webstore

2008-08-25 Thread Chris Moffitt
On Mon, Aug 25, 2008 at 5:17 AM, Benedict Verheyen < [EMAIL PROTECTED]> wrote: > > Hi, > > i need to develop a website with a webstore and i thought it was > the perfect time to use Django & more specific Satchmo. > However, Satcho has a big list of requirements and i'm not sure > if this will

More advanced test runner available?

2008-08-25 Thread Peter Bengtsson
Is there an alternative to the test runner that comes by defauly with Django (svn version)? The one that you get doesn't have colour coding and it doesn't have the option to stop all other tests after the first failure. --~--~-~--~~~---~--~~ You received this

Not displaying data...

2008-08-25 Thread mccomas . chris
I have the following code, http://dpaste.com/73388/ For some reason the data in the rows is not displaying, there are the correct number of rows in each table so the for tag is working correctly. Any ideas why the content is not displaying? --~--~-~--~~~---~--~~

Re: S3 tutorial for File Storage Refactor?

2008-08-25 Thread David Larlet
Le 20 août 08 à 17:56, shadfc a écrit : > > With the code from the django-storages you referenced installed > somewhere on PYTHONPATH, its as easy as setting a few things in your > settings.py. You can see the docs for the code at > http://code.larlet.fr/doc/django-s3-storage.html. Put the

Re: FileStorage S3Storage Error importing storage module S3Storage

2008-08-25 Thread David Larlet
Hi Tom, The DEFAULT_FILE_STORAGE setting need to be set with a (python) path to your S3Storage location, the example is a bit confusing because the first part is the path and the second one is the class name (which is the same). Where did you put the S3Storage.py file? Let's you've got

Segmentation fault (postgresql - psycopg2)

2008-08-25 Thread kire
My site works fine locally mysql, sqlite and postgresql. On the server it worked fine om mysql - myisam (well, as long you can speak about fine for that database). I'm trying to convert to postgresql, everything is configured correct and when i execute 'python manage.py syncdb --noinput' I just

Re: limiting choices in admin.ModelAdmin based on request.user

2008-08-25 Thread krylatij
> There is no longer any reason whatsoever to use this in any way in the > admin. It was an ugly, fragile hack before and it's unnecessary now > because ModelAdmin has a get_form() method -- which receives the > HttpRequest object as an argument -- that you can override to tweak > the form on a

Re: QuerySets are scary!

2008-08-25 Thread V
thanks for the exhausting answer! I thought that something similar is going on under the hood, and just wanted to point it out to other ignorant people like myself. thanks once again! V On Aug 23, 12:27 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Sat, Aug 23, 2008 at 3:57 AM, Viktor

Custom manager for many-to-many traversal

2008-08-25 Thread MrJogo
How do I create a custom manager for many-to-many traversal? An example will illustrate what I want to do better. Suppose I have the following models.py: class Book(models.Model): title = models.CharField(max_length=100) class Author(models.Model): books = models.ForeignKey(Book) name =

  1   2   >