Re: Mapping models to CRUD urls?

2007-07-19 Thread Russell Keith-Magee
On 7/20/07, John M <[EMAIL PROTECTED]> wrote: > > Does caching matter that much in my example, since it's dynamic data > anyway? Don't let the fact that the data is dynamic distract you. All database backed websites are dynamic at some level. However, when you have thousands of requests for a res

Re: Mapping models to CRUD urls?

2007-07-19 Thread John M
Russ, Wow, thanks so much for clearing that up, I was never sure about the parameters part of the URL, since this is my first real web program EVER, and I figured django was the right way to go. Does caching matter that much in my example, since it's dynamic data anyway? John On Jul 19, 5:43

Re: Authentication for application with subdomains

2007-07-19 Thread David Marko
> One possible solution would be to append the domain name to the > username before authentication. The user types in 'bob', then the > system munges it to 'bob.sub.domain.com' before doing the validation. ### this approach should work . Do you use it for your app? Any experiences? --~--~--

newforms

2007-07-19 Thread james_027
Which official django apps are using the newforms? I just want to take a look at the coding as I am trying to learn the django's newform thanks james --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

Re: setting up login required pages massly

2007-07-19 Thread Nathan Ostgard
You can define a custom decorator instead, specifying a custom login_url: from django.contrib.auth.decorators import user_passes_test my_login_decorator = user_passes_test(lambda u: u.is_authenticated(), login_url='/my/login/url') Then you can use: @my_login_decorator def someview(request): .

Re: Can't get database driver to use TCP

2007-07-19 Thread UnaCoder
Ha, i figured out a hack that works. Apparently the low level database connection driver provided by mysql will attempt to use /tmp/ mysql.sock even if you specify 'localhost' or '127.0.0.1' as the hostname. To work around this I added an entry to my /etc/hosts file: 127.0.0.1 localhost database

Can't get database driver to use TCP

2007-07-19 Thread UnaCoder
Hi, I have django installed on a development box with a local instance of mysql. I'm trying to use mysql on a foreign server over an ssh tunnel. I've connected the foreign mysql server to the local port 3307. I've confirmed I can connect to the database using: mysql -u username -p'password' -

setting up login required pages massly

2007-07-19 Thread james_027
hi, is there a stupidly fast way to make select but many pages to required login first? I am using 0.96 @login_required is cool, but 0.96 doesn't support LOGIN_URL in the settings.py yet. currently i am using something like this if not request.user.is_authenticated(): return render_to_r

Re: Django on a shared host. The docs are scaring me ;)

2007-07-19 Thread Jacob Kaplan-Moss
On 7/19/07, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > Gypsy is run by Jacob, so naturally ... - afaik they have a waiting > list. Actually, "they", err... me, are basically defunct; turned out running a hosting company is a lot more work than I thought Jacob --~--~-~--~~--

Re: Date Widget (or date format) in newforms

2007-07-19 Thread larry
> django.newforms contains a SplitDateTime field and widget for > splitting DateTime fields into two form fields (date and time) - > modifying this for Y/M/D shouldn't be too taxing. I've looked at that but, unfortunately, don't come close to understanding what it's doing -- in particular, I don'

Re: django foreignkey

2007-07-19 Thread james_027
hi, it seems that there is a small bug for not creating the foreign key on the database. Please see this ticket. http://code.djangoproject.com/ticket/4930#preview Thanks james On Jul 20, 9:05 am, james_027 <[EMAIL PROTECTED]> wrote: > anyone to help me on this? > > thanks > james > > On Jul 19

Re: Debugging file uploads

2007-07-19 Thread Russell Keith-Magee
On 7/19/07, Stefan Matthias Aust <[EMAIL PROTECTED]> wrote: > > Is this something I should file an issue for? > > The Django debug HTML page is great for finding bugs in templates and > view functions. However, if you have an error in a view function with > a request object that contains a - say -

Re: Django on a shared host. The docs are scaring me ;)

2007-07-19 Thread Kenneth Gonsalves
On 20-Jul-07, at 7:20 AM, walterbyrd wrote: >> You could do what I did decide Dreamhost is unacceptable for >> hosting anything but a very, very small Django site, and go over to >> Webfaction. > > I don't use Webfaction myself, but I have heard nothing but good > things about them. If you d

Re: Django on a shared host. The docs are scaring me ;)

2007-07-19 Thread walterbyrd
On Jul 17, 2:22 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > You could do what I did decide Dreamhost is unacceptable for > hosting anything but a very, very small Django site, and go over to > Webfaction. I don't use Webfaction myself, but I have heard nothing but good things about

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-19 Thread walterbyrd
On Jul 19, 4:08 pm, FrankW <[EMAIL PROTECTED]> wrote: > in your shell, if you cd into /home/walterbyrd/django.niche-software/ > django > and type ./dispatch.fcgi, what do you get? > ./dispatch.fcgi WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI! WSGIServer: missing FastCGI pa

Re: django foreignkey

2007-07-19 Thread james_027
anyone to help me on this? thanks james On Jul 19, 3:20 pm, james_027 <[EMAIL PROTECTED]> wrote: > Hi Nathan, > > I did manage.py syncdb with the table still not existing. I did > manage.py sqlall myapps when saw that the foreign key was not created. > > here is my actual source code. > > from d

Re: Date Widget (or date format) in newforms

2007-07-19 Thread Russell Keith-Magee
On 7/20/07, larry <[EMAIL PROTECTED]> wrote: > > Has anyone written a date widget with separate fields for day, month, > and year (and, ideally, a calendar) for the newforms package? Check out the capabilities of MultiWidget. This provides a mechanism to break apart a single model field into mult

Re: Mapping models to CRUD urls?

2007-07-19 Thread Russell Keith-Magee
On 7/20/07, John M <[EMAIL PROTECTED]> wrote: > > http://.../model3/add/#- calls a view to add a new model3, with > foreign key model2 of # > http://.../model3/edit/#- calls a view to edit a model3 of ID# > > It seems simple enough, but wanted to get everyones feedback on > anything I'm mi

Re: schema evolution

2007-07-19 Thread Derek Anderson
Hey all, Sorry for the double-post, but I've written up some examples / documentation: http://kered.org/blog/wp-content/uploads/2007/07/django_schema_evolution_documentation.html Also, I've ported the changes to SVN. I would like to solicit testers, for potential inclusion in django-proper.

Re: Unicode problem while changing from 0.95 to latest developer version

2007-07-19 Thread Jeremy Dunck
On 7/19/07, piotr <[EMAIL PROTECTED]> wrote: ... > TemplateSyntaxError: Caught an exception while rendering: 'utf8' codec > can't decode bytes in position 833-834: invalid data > ... > Any idea what can be wrong? I'm betting a string it's trying to decode isn't in utf-8. ;-) Go through this ch

Emergency - In Need Of Developer

2007-07-19 Thread Peter Pluta
I need a developer in the US (only) with at least 2 years experience with Django/Python to fix and optimize a Django site I had done a few weeks back. The original developer can no longer be contacted and the code is horribly inefficient, delaying the site from launch. Please email me for more de

Re: forloop variables without for

2007-07-19 Thread sean
Glad to help. {{ images.image_set.count }} or similar should work, depending on your models. cheers, Sean On Jul 20, 1:13 am, Marc Garcia <[EMAIL PROTECTED]> wrote: > Thanks mate, it works great. > > Anybody could tell me if there is something like that for counting > items on that? > > Don't wa

Re: Multiple URLconfs per app?

2007-07-19 Thread Nathaniel Whiteinge
Thanks, guys. On Jul 19, 12:52 am, Nathan Ostgard <[EMAIL PROTECTED]> wrote: > 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 Ostga

Re: Problem with multiple django versions on mod_python

2007-07-19 Thread oggie rob
> In short, a C extension module may cache data from one sub interpreter > and then use it in the context of a different sub interpreter causing > incorrect or errornous behaviour. The problem with Decimal support in > pyscopg falls into this category. It is entirely possible that the OP > may hav

Re: Problem with multiple django versions on mod_python

2007-07-19 Thread Russell Keith-Magee
On 7/20/07, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > > For the record, the description which was given to you whereby "if the > first request served by a thread used the old version of Django, that > was the version that was used for all subsequent requests on that > thread" is nonsense. Ther

Re: Problem with multiple django versions on mod_python

2007-07-19 Thread Graham Dumpleton
On Jul 19, 2:07 pm, "Russell Keith-Magee" <[EMAIL PROTECTED]> wrote: > 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 analogou

Re: forloop variables without for

2007-07-19 Thread Marc Garcia
Thanks mate, it works great. Anybody could tell me if there is something like that for counting items on that? Don't want to do: {% for image in images %} {% if forloop.last %} {{ forloop.counter }} {% endif %} {% endfor %} On Jul 19, 7:51 pm, sean <[EMAIL PROTECT

Mapping models to CRUD urls?

2007-07-19 Thread John M
Loving django still, and now I'm at the point where I'm running into a limit on my understanding on how to map the Model CRUD functions (non- admin style) to a URL pattern. For example: Model1: fielda fieldb Model2: key=Foreignkey(model1) fielda fieldb Model3: key=foriengkey(model2

Re: How to loop through a Dict to add values?

2007-07-19 Thread Derek Anderson
well, you're dealing in $$$, so you prob. want floats...but where is your FloatField? an attribute of your class Price? or can you cast your Price class to a float? pr = 0.0 for a in cart: pr = pr + float(a['choice'].price) do you understand how classes in obj

Re: schema evolution

2007-07-19 Thread Derek Anderson
yeah, i did a poor/non-existent job advocating inclusion of my SoC work into django-proper. (combination of frustration with my original mentor and busy prepping for starting my phd right after it ended - i just handed it off and didn't follow through afterwards) but i use django quite a bit

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-19 Thread FrankW
in your shell, if you cd into /home/walterbyrd/django.niche-software/ django and type ./dispatch.fcgi, what do you get? in the dreamhost control panel do you have the domain set up with FastCGI support? what about Extra Web Security? On Jul 19, 4:36 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > O

Re: How to loop through a Dict to add values?

2007-07-19 Thread Greg
Derek, Ok...I made the change and I'm now getting the error: TypeError at /rugs/cart/1/4/ unsupported operand type(s) for +: 'int' and 'Price' Is 'a['choice'].price' not an Int? It says it is in my model file. Here is my view def showcart(request, style_i

Re: Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Chris Moffitt
The way we handle it with Satchmo is to have a cart object and store that id in the session. It's pretty simple and does not require a user to be logged in. -Chris --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Dj

Re: schema evolution

2007-07-19 Thread daev
It's great! I have my own schema evolution solution here http://code.google.com/p/django-schemaevolution/. But yours seems to be more powerful. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: How to loop through a Dict to add values?

2007-07-19 Thread Derek Anderson
you were supposed to substitute "value" with whatever column you have defined. (you didn't post your model def) Greg wrote: > Derek, > I tried that and now I get the following error: > > AttributeError at /rugs/cart/1/4/ > 'Choice' object has no attribute 'value' > > / > > Here

Re: How to loop through a Dict to add values?

2007-07-19 Thread Greg
Derek, I tried that and now I get the following error: AttributeError at /rugs/cart/1/4/ 'Choice' object has no attribute 'value' / Here is my view def showcart(request, style_id, choice_id): s = Style.objects.get(id=style_id) c = Choice.objects.get(id=choice_id)

Re: How to loop through a Dict to add values?

2007-07-19 Thread Derek Anderson
you're not adding two ints, you're adding an int to an instance of your Choice class. make your line: pr = pr + a['choice'].value or whatever you called it. Greg wrote: > Hello, > I have the following view > > def showcart(request, style_id, choice_id): > s = Style.objec

Re: Simple Left Join in Django question???

2007-07-19 Thread Joshua
Thanks for your help, again On Jul 19, 4:10 pm, gkelly <[EMAIL PROTECTED]> wrote: > The Django db-api handles JOINs for you. It abstracts them into > "forward", "backward" and "many-to-many" relationships (as documented > on the page I linked before). > > Spend some time on the command line playi

How to loop through a Dict to add values?

2007-07-19 Thread Greg
Hello, I have the following view def showcart(request, style_id, choice_id): s = Style.objects.get(id=style_id) c = Choice.objects.get(id=choice_id) cart = request.session.get('cart', []) cart.append({'style': s, 'choice': c}) request.session['cart'] = cart

Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Xanthus
On 19 jul, 17:33, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]> wrote: > take a look at:http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser Great! It worked like a charm! Thanks very much José. --~--~-~--~~~---~--~~ You received this message be

Re: Simple Left Join in Django question???

2007-07-19 Thread gkelly
The Django db-api handles JOINs for you. It abstracts them into "forward", "backward" and "many-to-many" relationships (as documented on the page I linked before). Spend some time on the command line playing with these relationships and you'll see how you can navigate around your models through f

Re: Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Jeremy Dunck
On 7/19/07, Greg <[EMAIL PROTECTED]> wrote: > So I guess Session's will work if that is the case. It looks > like I will have to place a cookie on the visitor's computer using > set_test_cookie() and test_cookie_worked() method's so that I'm able > to tell the difference between two users that ar

Re: Authentication for application with subdomains

2007-07-19 Thread Doug Van Horn
On Jul 19, 2:19 pm, David Marko <[EMAIL PROTECTED]> wrote: > I know this topis has been discussed already but I stiil havent find > solution. We would like to build up the application that will be used > by many customers. After registration the customer will access > application via its subdomain

schema evolution

2007-07-19 Thread Derek Anderson
Hey all, I've ported my schema evolution work from my SoC project last summer to Django v0.96. To use it, download the patch below, and run the following: $ cd //site-packages/django/ $ patch -p1 < ~//django_schema_evolution-v096patch.txt It should output the following: patching file core/m

Unicode problem while changing from 0.95 to latest developer version

2007-07-19 Thread piotr
Hello, I have done upgrade from 0.95 to svn developer version. One of my django apps using unicode characters does not start anymore, I get the following: -- Traceback (most recent call last): File "C:\Python24\lib\site-packages\django\core

Re: Simple Left Join in Django question???

2007-07-19 Thread Joshua
Maybe I should have titled this how do I create a left join in Django syntax or with the Django db-API All the examples in the documentation let you retrieve the related object ONLY if you have ONE related object retrieved. On Jul 19, 2:18 pm, Joshua <[EMAIL PROTECTED]> wrote: > Thank you for yo

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-19 Thread walterbyrd
On Jul 19, 12:24 pm, FrankW <[EMAIL PROTECTED]> wrote: > A couple of things to check - what are the permissions on > dispatch.fcgi? > It needs to be executable, e.g. -rwxr-xr-x Permissions are correct. > Also, make sure it does not have DOS mode CR-LF No DOS mode CR-LF. > And, do you have debu

Re: Problem with multiple django versions on mod_python

2007-07-19 Thread oggie rob
Thanks for the tip, Niels. I tried that and it didn't work either. I got to thinking about how likely it would be that mod_python & interpreters were causing problems. I've used multiple interpreters for some time and haven't noticed any other strange behaviour. A little test by printing out the a

Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Lic. José M. Rodriguez Bacallao
take a look at: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 7/19/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote: > > A view knows the logged in user through request.user but i could not > > find if a signal has this informatio

Re: Authentication for application with subdomains

2007-07-19 Thread SH
Hi David, I'm just starting on an app with the same structure. I think the main problem here is that the username field has to be unique. One possible solution would be to append the domain name to the username before authentication. The user types in 'bob', then the system munges it to 'bob.sub

Re: Request Context and Generic Views

2007-07-19 Thread Daniel A.
As has been mentioned, they all use a RequestContext to begin with, but if you need additional custom variables to be exposed to your template, then you can pass them as a dict for the extra_context variable. On Jul 19, 5:08 am, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Hi there! > > How does i

Re: newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread cjl
Duc & Kevin: Thank you for your quick and accurate replies. It looks like I need to spend more time with the documentation. Kevin's solution fixed my problem. -CJL --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Django's User authentication

2007-07-19 Thread rskm1
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: > http://www.b-list.org/weblog/2006/06/06/django-tips-extending-user-model I'm glad this c

Date Widget (or date format) in newforms

2007-07-19 Thread larry
Has anyone written a date widget with separate fields for day, month, and year (and, ideally, a calendar) for the newforms package? Failing that, is there any way to change the format in which the text widget used for dates displays and decodes the date. -MM-DD may be better in every way, bu

Re: 4 beginner's questions

2007-07-19 Thread Collin Grady
> Oh, it's not creating the ID, my question was whether I can safely > assume that I will always get an IntegrityError (and nothing else) and > whether just inserting stuff and catching errors is the recommended > Pythonic way. IntegrityError is what you will get on a unique conflict, yes. Howev

Re: Request Context and Generic Views

2007-07-19 Thread Collin Grady
They all use RequestContext already. --~--~-~--~~~---~--~~ 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 emai

Re: newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread Duc Nguyen
It would probably be easier if you processed crime_list in your view and generated a 'crimes' variable for use in your template. cjl wrote: > DU: > > I am a newbie, and I'm working on a simple tutorial for other > newbies. I am trying to generate some javascript, and I have the > following code

Re: newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread Kevin
There's a forloop.last variable that you could test. Eg: var crimes = [ {% for crime in crime_list %} [ {{crime.longitude}}, {{ crime.latitude }},'{{ crime.address }}','{{ crime.type }}','{{ crime.date }}'] {% if not forloop.last %},{% endif %} {% endfor %} ]; On Jul 19, 12:35 pm, cjl <[EMA

Re: Authentication for application with subdomains

2007-07-19 Thread daev
It's very simple to implement that application structure. For authentication you must set proper SESSION_COOKIE_DOMAIN variable in settings: http://www.djangoproject.com/documentation/settings/#session-cookie-domain For manage subdomains you can write you own middleware to parse request.META[ 'SER

newbie question: generating javascript, avoiding trailing comma

2007-07-19 Thread cjl
DU: I am a newbie, and I'm working on a simple tutorial for other newbies. I am trying to generate some javascript, and I have the following code in my template: var crimes = [ {% for crime in crime_list %} [ {{crime.longitude}}, {{ crime.latitude }},'{{ crime.address }}','{{ crime.type }}',

Authentication for application with subdomains

2007-07-19 Thread David Marko
I know this topis has been discussed already but I stiil havent find solution. We would like to build up the application that will be used by many customers. After registration the customer will access application via its subdomain name: eg. cust1 = http://cust1.application.com cust2 = http://cust

Re: Simple Left Join in Django question???

2007-07-19 Thread Joshua
Thank you for your response I'm not familiar with the context object - I'll have to do some research. I have this working portfolioPage = client.objects.filter(project_portfolio__project_display_bit = True) It's returning the clients data - just not the data for the project_portfolio (it's not

Multiple User profiles

2007-07-19 Thread Chris Hoeppner
Hi there! I just wanted to share opinions on this. I'm in the process of building a rather large site, that's going to expect quite some hits a day. So I want to to keep things as clean as possible. One never knows when I'll be getting my hands dirty again. The User(tm), can have a variable amou

Re: Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Greg
Lutz, Yea I don't plan on having the user login to purchase a product from me. So I guess Session's will work if that is the case. It looks like I will have to place a cookie on the visitor's computer using set_test_cookie() and test_cookie_worked() method's so that I'm able to tell the differen

Re: Simple Left Join in Django question???

2007-07-19 Thread gkelly
I believe in your template you should be able to do something like: {% for p in project_portfolio_list %} {{ p.project_name_char }} {{ p.project_client.client_name_char }} {% endfor %} If you had a view with: context['project_portfolio_list'] = project_portfolio.objects.all() You'll also wa

Re: Question about comment_utils

2007-07-19 Thread Shankar
Hi James, Thanks. Keep up the great work! Meanwhile, I'll submit an issue report. Shankar On Thu, 19 Jul 2007 13:12:04 -0500, James Bennett wrote: > On 7/19/07, Shankar <[EMAIL PROTECTED]> wrote: >> Is anyone else seeing the same behavior? Should I be running the latest >> SVN version of Djang

Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Lic. José M. Rodriguez Bacallao
take a look at: http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser On 7/19/07, James Bennett <[EMAIL PROTECTED]> wrote: > > > On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote: > > A view knows the logged in user through request.user but i could not > > find if a signal has this informatio

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-19 Thread FrankW
A couple of things to check - what are the permissions on dispatch.fcgi? It needs to be executable, e.g. -rwxr-xr-x Also, make sure it does not have DOS mode CR-LF And, do you have debug set in your settings.py? On Jul 19, 2:04 pm, walterbyrd <[EMAIL PROTECTED]> wrote: > As I said, I tried to

Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread James Bennett
On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote: > A view knows the logged in user through request.user but i could not > find if a signal has this information somewhere. No, this information is not available in the default signals. This is because Django can be used completely independently of its

Re: Question about comment_utils

2007-07-19 Thread James Bennett
On 7/19/07, Shankar <[EMAIL PROTECTED]> wrote: > Is anyone else seeing the same behavior? Should I be running the latest > SVN version of Django to take advantage of comment_utils? You should go here http://code.google.com/p/django-comment-utils/issues/list and paste in the code -- including yo

Re: Unicode chars in CharField

2007-07-19 Thread Chris Hoeppner
Chris Hoeppner escribió: > Hi there! > > I'm getting this whenever I try to use some non-ascii character in a > CharField. I know this has something to do with the unicode() function, > but my python knowledge doesn't get me that far. > > Thanks everyone! > > Traceback (most recent call last): >

Re: How do I know if fastcgi is installed correctly? (using dreamhost)

2007-07-19 Thread walterbyrd
As I said, I tried to follow the tutorial: In this directory /home/walterbyrd/django.niche-software.com I have these two files: 1. dispatch.fcgi sys.path += ['/home/walterbyrd/django.niche-software/django/ django_src'] sys.path += ['/home/walterbyrd/django.niche-software/django/ django_project

Simple Left Join in Django question???

2007-07-19 Thread Joshua
I've tried to search for a solution to this problem for the last 2 hours and I can't seem to figure it out. I basically want to return a joined table from a queryset - formatted for my template. I can't seem to figure out how to do this with the Django database API. With SQL a join query works

Re: forloop variables without for

2007-07-19 Thread sean
Try {{ images.0.image }} Sean On Jul 19, 7:43 pm, Marc Garcia <[EMAIL PROTECTED]> wrote: > Hi! > > In a project I get a set of images from a model, and then I display it > on the template. In same template (but in another place), I just want > to display first element of set, and number of objec

Re: Newforms, MultiSelect, "Hold Down Control" message.

2007-07-19 Thread larry
Thanks for your reply, sorry I didn't get back to this sooner. > The string you're referring to is appended to the help_text of a > ManyToManyField in django.db.models.fields.related. It's not being > set by newforms, merely inherited. You also wouldn't be seeing it if > you were using Checkbox

forloop variables without for

2007-07-19 Thread Marc Garcia
Hi! In a project I get a set of images from a model, and then I display it on the template. In same template (but in another place), I just want to display first element of set, and number of objects given. Can I do it without adding those fields to views.py? I've found a way for doing first, bu

Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Xanthus
I'm implementing a model modification history and the only thing it is lacking is saving the user who did the modification. A view knows the logged in user through request.user but i could not find if a signal has this information somewhere. Thanks in advance! --~--~-~--~~-

Question about comment_utils

2007-07-19 Thread Shankar
Hi all, I'm using Django 0.96 and trying to use James Bennett's comment_utils with my blog application. When I add the CommentModerator subclass and 'moderator.register' statements to models.py, the ManyToManyField class attributes in the moderated class stop working. I keep getting the follo

Re: Bulk data upload

2007-07-19 Thread Tim Chase
>> 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 that > nastiness for you. I've used it b

Re: 4 beginner's questions

2007-07-19 Thread Carl Karsten
Stefan Matthias Aust wrote: > Carl, Jeremy, > > Thanks for your answers. > > Carl wrote: > >> I just made this. it should answer most of 1 and 2. >> http://code.djangoproject.com/wiki/DatabaseReset > > Somehow, it seems to me that there should be a standard utility > function to initialize th

Colleen Robledo is out of the office

2007-07-19 Thread crobledo
I will be out of the office starting Thu 07/19/2007 and will not return until Mon 07/23/2007. I will return emails as soon as possible Monday 7/23. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" gr

Re: Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Lutz Steinborn
Hi Jeremy, On Thu, 19 Jul 2007 10:45:46 -0500 "Jeremy Dunck" <[EMAIL PROTECTED]> wrote: > > On 7/19/07, Greg <[EMAIL PROTECTED]> wrote: > > x = request.session ?? # I want to add s and c to my session? > > cart = request.session.get('cart', []) > cart.append({'style':s,'choice'c}) > >

Re: Blog engine

2007-07-19 Thread Chris Hoeppner
Stefan Matthias Aust escribió: > Chris, > > 2007/7/19, Chris Hoeppner <[EMAIL PROTECTED]>: > >> There would still be the problem of people wanting to >> "one-click-install" plugins and themes. But why would such a person even >> think about using a framework instead of wordpress? > > My point wa

Re: Blog engine

2007-07-19 Thread Stefan Matthias Aust
Chris, 2007/7/19, Chris Hoeppner <[EMAIL PROTECTED]>: > There would still be the problem of people wanting to > "one-click-install" plugins and themes. But why would such a person even > think about using a framework instead of wordpress? My point was that - assuming the Django community wants

Re: 4 beginner's questions

2007-07-19 Thread Stefan Matthias Aust
Carl, Jeremy, Thanks for your answers. Carl wrote: > I just made this. it should answer most of 1 and 2. > http://code.djangoproject.com/wiki/DatabaseReset Somehow, it seems to me that there should be a standard utility function to initialize the system for command line tools. I saw your "nif

Re: Blog engine

2007-07-19 Thread Chris Hoeppner
Stefan Matthias Aust escribió: > If it is so easy to create a blogging application with Django, then > this should be an argument for a standard application, not against it > IMHO. > > At minimum, it could become a nice example application, either as part > of the django distribution or as a separ

Re: Blog engine

2007-07-19 Thread Rob Hudson
Why not start a Google code repository and see how many people want to chip in and help. This comes up often enough that it sounds like there's enough interest. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Djan

Re: Django advocacy in a commercial environment

2007-07-19 Thread Rob Hudson
On Jul 19, 1:19 am, "Jon Atkinson" <[EMAIL PROTECTED]> wrote: > If anyone has any good resources which show off the power of Django > (and by association, the benefits of PHP), then please share them with > us. Where I work we migrated away from PHP to Django with great success but it depends on

Re: Blog engine

2007-07-19 Thread Stefan Matthias Aust
If it is so easy to create a blogging application with Django, then this should be an argument for a standard application, not against it IMHO. At minimum, it could become a nice example application, either as part of the django distribution or as a separate download. And if it is still easy enou

Re: Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Jeremy Dunck
On 7/19/07, Greg <[EMAIL PROTECTED]> wrote: > x = request.session ?? # I want to add s and c to my session? cart = request.session.get('cart', []) cart.append({'style':s,'choice'c}) request.session['cart']=cart But, fundamentally, putting cart info in session is a bad idea; people switc

Using Sessions to display the contents of a shopping cart

2007-07-19 Thread Greg
I have the following view: def showcart(request, style_id, choice_id): s = Style.objects.get(id=style_id) c = Choice.objects.get(id=choice_id) x = request.session ?? # I want to add s and c to my session? return render_to_response('show_test.html', {'mychoice': x})

Re: 4 beginner's questions

2007-07-19 Thread Jeremy Dunck
On 7/19/07, Stefan Matthias Aust <[EMAIL PROTECTED]> wrote: > 1) It is important for me to recreate my environment from scratch > (that is, from the VCS). I'd like to have a working application after > calling "syncdb". For my own application, I've create an initial_data > fixture. But I'd like to

Re: Problem when inserting into a table with a MySQL auto_increment primary key

2007-07-19 Thread AnaReis
On Jul 18, 6:14 pm, Nis Jørgensen <[EMAIL PROTECTED]> wrote: > 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 legac

Re: 4 beginner's questions

2007-07-19 Thread Carl Karsten
Stefan Matthias Aust wrote: > Hi, > > Coming from a Java background, I introduced Django in my company for a > new web application. So far, we made great progress and web > development suddenly was fun again. Unfortunately, it feels like all > time I save because of Django, is spent on searching

Debugging file uploads

2007-07-19 Thread Stefan Matthias Aust
Is this something I should file an issue for? The Django debug HTML page is great for finding bugs in templates and view functions. However, if you have an error in a view function with a request object that contains a - say - 200MB file object, well, then your browser dies a slow and painful dea

4 beginner's questions

2007-07-19 Thread Stefan Matthias Aust
Hi, Coming from a Java background, I introduced Django in my company for a new web application. So far, we made great progress and web development suddenly was fun again. Unfortunately, it feels like all time I save because of Django, is spent on searching for an IDE (I still haven't found someth

Unicode chars in CharField

2007-07-19 Thread Chris Hoeppner
Hi there! I'm getting this whenever I try to use some non-ascii character in a CharField. I know this has something to do with the unicode() function, but my python knowledge doesn't get me that far. Thanks everyone! Traceback (most recent call last): File "/usr/lib/python2.5/site-packages/djang

Re: Random IndexError

2007-07-19 Thread Niels
Well, that should be explained in http://www.djangoproject.com/documentation/contributing/#reporting-bugs And after following the do's and avoiding the don'ts, you would proceed at http://code.djangoproject.com/newticket Best, Niels On Jul 19, 2:33 pm, Chris Hoeppner <[EMAIL PROTECTED]> wrote

Re: Random IndexError

2007-07-19 Thread Chris Hoeppner
You're right, they was ending with '\r'. Should I file a ticket? How's that done? Never done it before. Niels escribió: > This might mean your sourcefile uses '\r' for newlines which isn't > handled correctly by django. If that's the case, this might be worth > filing a ticket, i think. > > On Ju

Re: Random IndexError

2007-07-19 Thread Niels
This might mean your sourcefile uses '\r' for newlines which isn't handled correctly by django. If that's the case, this might be worth filing a ticket, i think. On Jul 19, 1:20 pm, Chris Hoeppner <[EMAIL PROTECTED]> wrote: > Hi there! > > I'm getting random IndexErrors. This has risen when loadi

  1   2   >