Re: uploding image file

2007-03-05 Thread Kenneth Gonsalves
On 06-Mar-07, at 1:21 PM, samira wrote: > I have Problem with uploading file in Django. First time I want to use > python regular way of uploading file but it is not work by Django. As > I studied Django has "ImageField" and "FillField" but I don't really > know how I can use them, can any body

Re: uploding image file

2007-03-05 Thread limodou
On 3/6/07, samira <[EMAIL PROTECTED]> wrote: > > Hello all > I have Problem with uploading file in Django. First time I want to use > python regular way of uploading file but it is not work by Django. As > I studied Django has "ImageField" and "FillField" but I don't really > know how I can use

uploding image file

2007-03-05 Thread samira
Hello all I have Problem with uploading file in Django. First time I want to use python regular way of uploading file but it is not work by Django. As I studied Django has "ImageField" and "FillField" but I don't really know how I can use them, can any body help me? Regards Samia

DjSelect - get Model objects from cooked SQL select statements

2007-03-05 Thread noelbk
Django's QuerySet objects are nice, but I always run into problem where I need to write a real SQL query that they don't support. For example, I wanted to sort by names in a left joined table. Sort() won't work withou joining the table, but select_related() didn't do it for me (since my

Re: Debugging Django: print statements?

2007-03-05 Thread deaston
Hi Filipe, Tried to post a reply earlier but managed to screw it up. If that never makes it, here it is again... To configure PyScripter to debug Django interactively: 1) Install a version of PyScripter that supports remote debugging (I'm using 1.8.0.0) 2) Select "Run->Python

Re: how to get all the objects in one model that are not foreign keys in another

2007-03-05 Thread Kenneth Gonsalves
On 06-Mar-07, at 8:55 AM, Malcolm Tredinnick wrote: >> >> how do i get a list of all children who are not in Sponsorship? > > I'm pretty sure you can't do this at the moment with only the Django > query functionality. ok - anyway thanks, I thought I was losing my mind and was pretty

Re: creating a website log

2007-03-05 Thread Rubic
If the goal is to write the actions to a log file, limodou's recommendation for using signals is easier to implement. I'm more or less duplicating the admin approach in my application. -- Jeff Bauer Rubicon, Inc. --~--~-~--~~~---~--~~ You received this message

HOT PICS OF INDIAN BABES

2007-03-05 Thread hot babe
HOT PICS OF INDIAN BABES http://bollywoodactress.blogspot.com --~--~-~--~~~---~--~~ 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

Re: regarding Foreign Key Display

2007-03-05 Thread [EMAIL PROTECTED]
You could try adding some javascript to your page to filter the drop down based on specific criteria just a thought but when something has that many entries (not sure what your app is) ... seems like maybe they should be categorized...then have the person choose a category first. On Mar

Re: how to get all the objects in one model that are not foreign keys in another

2007-03-05 Thread Malcolm Tredinnick
On Mon, 2007-03-05 at 18:12 +0530, Kenneth Gonsalves wrote: > hi, > > I have two models: > > Child(models.Model): > name = CharField > > > Sponsorship(models.Model): > name = CharField > child = ForeignKey(Child) > ... > > how do i get a list of all

Re: how to get all the objects in one model that are not foreign keys in another

2007-03-05 Thread lawgon
would work - but isnt there some djangoistic way of doing it? On Mar 5, 5:42 pm, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > hi, > > I have two models: > > Child(models.Model): > name = CharField > > > Sponsorship(models.Model): > name = CharField > child

iCal like interface in the Admin?

2007-03-05 Thread Jay Parlar
I'm currently putting together my first calendar view for a website. Initially, I thought that creating a basic "Event" model with a single DateField would be good enough, but after thinking about it, realized that without some basic "Repeat" functionality, it'll become useless pretty quickly.

Re: creating a website log

2007-03-05 Thread limodou
I think signals will be easier, if you also want to record delete information of a record, you can also hook pre_delete, the pseudo code is: from django.db.models import signals def pre_save(sender, instance, signal, *args, **kwargs): if instance.id:#update state = 'change'

Re: {% url %} syntax, and its equiv in python?

2007-03-05 Thread Malcolm Tredinnick
On Mon, 2007-03-05 at 18:29 -0800, yary wrote: > I'm building up menus in django, and wanted a construct like this: > > {% for item in menu %} > {{item.label}} > > but that doesn't work, because there's no view "item.view" > > so point 1, looks like a shortcoming in the syntax of the URL tag.

Re: creating a website log

2007-03-05 Thread Rubic
My solution is this: I've ripped out some stuff from the old admin code and written AppLogModel with three methods: def add(self, request): def remove(self, request): def update(self, request): The add/update methods call save() and remove calls delete(). Each method invokes a log

{% url %} syntax, and its equiv in python?

2007-03-05 Thread yary
I'm building up menus in django, and wanted a construct like this: {% for item in menu %} {{item.label}} but that doesn't work, because there's no view "item.view" so point 1, looks like a shortcoming in the syntax of the URL tag. With most tags, an unquoted item gets looked up, and a quoted

Re: creating a website log

2007-03-05 Thread limodou
I think maybe you can hook the pre_save() signal to do this thing. -- I like python! UliPad <>: http://wiki.woodpecker.org.cn/moin/UliPad My Blog: http://www.donews.net/limodou --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: creating a website log

2007-03-05 Thread Patrick
On Mon, 05 Mar 2007 12:33:09 +0100, Aidas Bendoraitis wrote: > Maybe this could help you: > http://www.djangosnippets.org/snippets/16/ > > Regards, > Aidas Bendoraitis [aka Archatas] > > On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote: >> >> Hi, I'd like to create a website log, similar to the

Re: QuerySet's get() method in template?

2007-03-05 Thread Malcolm Tredinnick
On Mon, 2007-03-05 at 23:51 +, akonsu wrote: > hello, > > can a template invoke a method with parameters on a QuerySet object? > e.g. get(), filter(), etc. > > or do i need a custom filter/tag for that? You won't be able to pass arguments to the method call if you just called it in a

Re: QuerySet's get() method in template?

2007-03-05 Thread Joseph Heck
You would want a custom tag (or filter) for that. I typically set it up to process that through views, but most of our work is done in the views and we've not expressed a huge amount of work in the custom tags. -joe On 3/5/07, akonsu <[EMAIL PROTECTED]> wrote: > > > hello, > > can a template

Re: Help with profiles

2007-03-05 Thread limodou
On 3/6/07, MattW <[EMAIL PROTECTED]> wrote: > > Dear All, > > I've upgraded to the svn code, but I'm still having problems with user > profiles. > > I've got a method in views.py: > > @login_required > def viewprofile(request): > uname = request.user.username > try: > profile =

Re: Django and jQuery Autocomplete Routing Help

2007-03-05 Thread limodou
On 3/6/07, johnny <[EMAIL PROTECTED]> wrote: > > I am using jQuery to do the autocomplete. Autocomplete request > backend script like this: script_url?q=foo. But there is a problem > with django routing? > > (r'^tag/autocomplete/?q=(?P\w+)/$', > 'apps.tag.views.tag_autocomplete'), > > Here is

QuerySet's get() method in template?

2007-03-05 Thread akonsu
hello, can a template invoke a method with parameters on a QuerySet object? e.g. get(), filter(), etc. or do i need a custom filter/tag for that? thanks konstantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Django and jQuery Autocomplete Routing Help

2007-03-05 Thread johnny
I am using jQuery to do the autocomplete. Autocomplete request backend script like this: script_url?q=foo. But there is a problem with django routing? (r'^tag/autocomplete/?q=(?P\w+)/$', 'apps.tag.views.tag_autocomplete'), Here is my error: [05/Mar/2007 15:11:51] "GET /tag/autocomplete/?q=a

Re: select_related() and null=True

2007-03-05 Thread David Cramer
The problem with this is, when the foreignkey can be null the only way to reference it properly is with a LEFT JOIN. Now, I'm not sure why it isnt implemented in ORM, but I strongly encourage you to find a differently solution, as LEFT JOINs can be VERY costly on system resources. On the same

Re: Some kind of substitute for __exact=None which executes "is null"?

2007-03-05 Thread Anders Hovmöller
I went with something along those lines so what I do now in my view is (pseudo-code of course): queryset = my_filter(SomeClass, a=a, b=b, c=c) It's very strange to me that I need to do this, because I would expect the creation and fetching to be symmetrical. The behavior of "a=a" is

Help with profiles

2007-03-05 Thread MattW
Dear All, I've upgraded to the svn code, but I'm still having problems with user profiles. I've got a method in views.py: @login_required def viewprofile(request): uname = request.user.username try: profile = request.user.get_profile() except User.DoesNotExist:

Re: Help with Files

2007-03-05 Thread [EMAIL PROTECTED]
Well... I'm honestly just treating the file name in the database as a varchar field ... because after I upload my files... I rename them with a uniqueid, and move them to specific directories based on that ID...but anyhow... below is the code for the basic idea... I've parsed out some of my

Re: Help with Files

2007-03-05 Thread Gerard M
I would love to see that code Carole thanks a lot, and if you used some kind of class definition to use it with the database and the view you created I would love to have a look at that one too as well, thanks On 5 mar, 14:23, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I ended up using an

Re: Generic way to create/edit multiple objects?

2007-03-05 Thread [EMAIL PROTECTED]
You would create a custom change manipulator... and you could pass it the main 'parent' object ... then in your flatten data routine, you could extract all of the values for your related objects. I don't really know what fields you have or anything..but here is some sample code in the right

Re: Help with Files

2007-03-05 Thread [EMAIL PROTECTED]
I ended up using an old fashioned form to post files with standard python code (inside of a view though), because I didn't like the way django handled them. I can post a sample of that if you like . On Mar 5, 2:06 pm, "Gerard M" <[EMAIL PROTECTED]> wrote: > Hello, im very new to django

Re: Runserver Hanging

2007-03-05 Thread David Cramer
The traceback is only within the console and from broken pipe.. theres no errors on the page :) On Mar 5, 10:28 am, Tim Chase <[EMAIL PROTECTED]> wrote: > > To expand on this, sometimes the pages load as they would on our live > > environment, but it randomly (and happens most of the time) hangs

Re: openId cookbook updates?

2007-03-05 Thread Joseph Heck
I riffed off those directions and the Zyon's code, but I found that the Zyon's code really didn't help me that much - I think it was written to an earlier version of the openID libraries from Janrain. Anyway, I used the request.session and a store built in to Postgres for my implementation.

Help with Files

2007-03-05 Thread Gerard M
Hello, im very new to django and python, I've read the tutorials and the django beta book, but there is one thing I dont see covered and I need to know hot to do it for a project, any help is welcome. The main problem is that I dont know how can I upload a file to the server to be procesed using

Re: Runserver Hanging

2007-03-05 Thread Tim Chase
> To expand on this, sometimes the pages load as they would on our live > environment, but it randomly (and happens most of the time) hangs to > where it takes up to a couple minutes to load a page. If you disable CSS (or expand all of the collapsed sections of the traceback), are you getting

Re: Outputting navigation

2007-03-05 Thread Aidas Bendoraitis
You don't need to put each page into a dictionary. Just loop through the categories in the template and then get all the child pages for each category: {% for category in categories %} {{ category }} {% for page in category.page_set.all %} {{ page }} {% endfor %}

Any Swedish Django developers out there?

2007-03-05 Thread [EMAIL PROTECTED]
Sending out the probe: I'm currently involved in a new web startup and we've decided to use Django as our development platform. Are there any Swedish Django developers out there, preferably in the Stockholm- region? Please let me know by e-mail -- it would be more than interesting to have a

Re: Runserver Hanging

2007-03-05 Thread David Cramer
To expand on this, sometimes the pages load as they would on our live environment, but it randomly (and happens most of the time) hangs to where it takes up to a couple minutes to load a page. On Mar 5, 9:14 am, "David Cramer" <[EMAIL PROTECTED]> wrote: > I've had issues as of lately with

Re: Outputting navigation

2007-03-05 Thread Mike H
Actually, after a nice strong cup of coffee, I figured I was doing this completely the wrong way. I added a get_pages method to the category which returns a queryset, then I supply the categories to the template and let the template ask the category for the pages. Mike On 3/5/2007, "Mike H"

Outputting navigation

2007-03-05 Thread Mike H
Hi all, I have a list of wiki pages, each one has a category. I want to output them in a list, grouped by category. So far I am looping through each page and putting them into a dict, so the end result looks like this : {'category_name': [page1,page2,page3],} Now I want to loop round that

Runserver Hanging

2007-03-05 Thread David Cramer
I've had issues as of lately with runserver hanging upon using it for the dev server. I've been unable to diagnose this myself so here's my plea :) The issue seems to be on the system as a whole, and I've tried going through the list of middleware and context processors and none of that seemed

Re: Getting the Hjang of Django?

2007-03-05 Thread James Bennett
On 3/5/07, cjl <[EMAIL PROTECTED]> wrote: > After browsing through the Django Users and Django Developers groups, > I started to wonder which branch I should be using as I learn. I'd recommend starting on trunk and maybe sticking to 0.96 once it's released. After 0.96 there will be some big

Re: Getting the Hjang of Django?

2007-03-05 Thread Marijn P. Vriens
Cjl, After playing with Django for the last month or so, I would sugest you just go with trunk/. My Method of operation is syncing with trunk/ each time I make a update to my website and run my tests. I have yet to see my site brake because of updates to trunk. They are pretty careful not to

Getting the Hjang of Django?

2007-03-05 Thread cjl
Django Users: I am just getting started with Django, and have worked through the book and most of the documentation. So far, so good. I recently started reading the daily change log on the Trac SVN wiki. I probably shouldn't be doing that. It seems to me that Django is about to undergo some

Re: how to get all the objects in one model that are not foreign keys in another

2007-03-05 Thread Tim Chase
> I have two models: > > Child(models.Model): > name = CharField > > > Sponsorship(models.Model): > name = CharField > child = ForeignKey(Child) > ... > > how do i get a list of all children who are not in Sponsorship? AFAIK, for any sort of efficiency,

English pronunciation

2007-03-05 Thread [EMAIL PROTECTED]
English I need a help of a person whose mother tongue is English. Would you please record the pronunciation of the following name and send it to the following address? [EMAIL PROTECTED] Aaron (US) Adie (Australian) Archambault (US) Argyll Robertson (Scottish) Auer (US) Ayre (US) Branham (US)

Re: Admin interface and custom managers

2007-03-05 Thread Picio
I had the same issue in the past. There's a bug in the django code and a ticket was already scheduled. Before 0.96, that by the way seems to improve a lot the admin class providing more hooks to customize It, you can add a row in your Admin class code that says: manager=myCustomManager() Hope

Generic way to create/edit multiple objects?

2007-03-05 Thread allmanj
Hi all, I've been trawling through django code and i'm beginning to hit a brick wall on this one. I want to create a view to edit and create a bunch of objects. Edit those which exist and (optionally) add those that don't. I have for the purposes of this discussion, four classes, Project,

Re: Upcoming Django release, and the future

2007-03-05 Thread Lakin Wecker
On 2/25/07, James Bennett <[EMAIL PROTECTED]> wrote: If there's a bug that's been annoying the heck out of you and you want > it fixed before the release, this would be the time to speak up about > it. We have a fairly high concentration of Django developers all in > one place with nothing to

Re: change save url of imagefield

2007-03-05 Thread Benedict Verheyen
Jarosław Świerad schreef: > On Monday 05 March 2007 09:42, Benedict Verheyen wrote: >> Hi, >> >> i have a class with an imagefield. >> I'm trying to add the current logged in user to the path where the image >> field is saved. >> image = models.ImageField(upload_to="img/_USER_/icons/", blank=True

Re: Model help

2007-03-05 Thread Kai Kuehne
Hi Duncan, On 3/5/07, DuncanM <[EMAIL PROTECTED]> wrote: > [Class description] > > The squad selector also has a foriegnkey on fixture, but also has 16 > other fields that are all foreignkeys on player. > > [SquadSelector class] > > Now I have a few queries/questions. > 1.)As you can see from

how to get all the objects in one model that are not foreign keys in another

2007-03-05 Thread Kenneth Gonsalves
hi, I have two models: Child(models.Model): name = CharField Sponsorship(models.Model): name = CharField child = ForeignKey(Child) ... how do i get a list of all children who are not in Sponsorship? -- regards kg http://lawgon.livejournal.com

HOT PICS OF INDIAN BABES

2007-03-05 Thread hot babe
HOT PICS OF BOLLYWOOD ACTRESS http://bollywoodactress.blogspot.com --~--~-~--~~~---~--~~ 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

Model help

2007-03-05 Thread DuncanM
I have some classes related to football (soccer), I have Player, Team, Fixture, Result, Squad, Squad Selector, Appearance and Scorer classes. They way I have modelled it is that A player belongs to a squad, and each team is picked from a squad (e.g. a squad may consist of 30 players but a team

Re: creating a website log

2007-03-05 Thread Aidas Bendoraitis
Maybe this could help you: http://www.djangosnippets.org/snippets/16/ Regards, Aidas Bendoraitis [aka Archatas] On 3/3/07, Patrick <[EMAIL PROTECTED]> wrote: > > Hi, I'd like to create a website log, similar to the log found in > django.contrib.admin and was wondering if anyone has thought

Re: Recursion in templates... again

2007-03-05 Thread Aidas Bendoraitis
It's not so hard to do recursion using templates as well as without them. 1. Write a template tag that takes one menu item as a parameter. I don't have enough time to write the whole tag this time, but the example usage should be like this: {% load recursive_menu %} {% menu root_category %} 2.

Development in LAN. URLs of FlatPages. Best Practices?

2007-03-05 Thread Aidas Bendoraitis
We are developing a few Django projects. The development versions are accessible in the local network under some directories of the local server's IP (i.e. http://1.2.3.4/example/) and the published versions are accessible under some domains directly (i.e. http://example.com/). If you have a

Re: change save url of imagefield

2007-03-05 Thread Jarosław Świerad
On Monday 05 March 2007 09:42, Benedict Verheyen wrote: > Hi, > > i have a class with an imagefield. > I'm trying to add the current logged in user to the path where the image > field is saved. > image = models.ImageField(upload_to="img/_USER_/icons/", blank=True ) > > _USER_ is a placeholder for

Re: Recursion in templates... again

2007-03-05 Thread Malcolm Tredinnick
On Mon, 2007-03-05 at 10:31 +0100, Jens Diemer wrote: > Chris Moffitt schrieb: > > I've implemented a similar hierarchy for categories in Satchmo using > > elementtree. You can see my example here- > >

regarding Foreign Key Display

2007-03-05 Thread MacH G
hi all, sorry to bother u ppl for the second time in a day . in my application i have foreign key relationship which is shown as a drop down list box. but in my application it contains some 2000-3000 entries . so i tried to display in other format . but it seems that a foreign could only be

Re: Recursion in templates... again

2007-03-05 Thread Jens Diemer
Chris Moffitt schrieb: > I've implemented a similar hierarchy for categories in Satchmo using > elementtree. You can see my example here- > http://www.satchmoproject.com/trac/browser/satchmo/trunk/satchmo/shop/templatetags/category_display.py But you have html code in your programm. (The und

Re: Newbie: Admin / Model help

2007-03-05 Thread DuncanM
Ooops I realise you can use a verbose name on a foreign key field you must just use verbose_name="xxx" e.g. Poll = models.ForeignKey(Poll, verbose_name="the related poll") On Mar 5, 9:16 am, "DuncanM" <[EMAIL PROTECTED]> wrote: > Thank you Kai, > I really appreciate the time you put in to help

Re: Newbie: Admin / Model help

2007-03-05 Thread DuncanM
Thank you Kai, I really appreciate the time you put in to help me with that, it had me puzzled because all this time I was looking for something wrong with my fixture or result classes when it fact it had nothing to do with them, it was due to my last class called SquadSelector as shown below:

Re: connecting to multiple databases

2007-03-05 Thread Michal Jedryszka
I had an data import task for django application. Client moved data from several databses into new one. All legacy databases had same model, so there was proper django model created for them. And I had problem with importing data from all those legacy system. I've sniffed a bit and on the base of

change save url of imagefield

2007-03-05 Thread Benedict Verheyen
Hi, i have a class with an imagefield. I'm trying to add the current logged in user to the path where the image field is saved. image = models.ImageField(upload_to="img/_USER_/icons/", blank=True ) _USER_ is a placeholder for the "real" user. def add_icon(request): IconForm =

Admin interface and custom managers

2007-03-05 Thread Michael Cuddy
I've defined a custom manager for some of my models (similar to, but not exactly like filtering by settings.SITE_ID). Unfortunately, the Model's manager doesn't seem to get used in the admin interface? from myapp.company.managers import CurrentCompanyManager class