Re: "clever" fields

2008-03-31 Thread martyn
Hi, Do you know the class Admin, a subclass of your model ? http://www.djangobook.com/en/1.0/appendixB/#cn311 Maybe it could help you. On 31 mar, 13:46, Grupo Django <[EMAIL PROTECTED]> wrote: > Hi! > I'm trying to create a generic form template for a custom admin zone. > I'm doing it this >

Re: Basic Configuration Issue?

2008-03-31 Thread Cephire
Michael: I'm no good at regex to explain why it doesn't work. But chapter 3 of Django book (pg 16 of pdf format) says the below: "... You should exclude the expected slash at the beginning of the '^time/ $' expression in order to match /time/. Django automatically puts a slash before every

Re: Basic Configuration Issue?

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 23:19 -0500, Michael Wieher wrote: > Can someone glance at this and tell me what is wrong? > > Request Method: > GET >Request URL: > http://myserver.mydomain.net/datatab/ > Using the URLconf defined in web.urls, Django tried these URL > patterns, in

Basic Configuration Issue?

2008-03-31 Thread Michael Wieher
Can someone glance at this and tell me what is wrong? Request Method: GET Request URL: http://myserver.mydomain.net/datatab/ Using the URLconf defined in web.urls, Django tried these URL patterns, in this order: 1. ^/datatab/$ 2. ^/datatab/login/$ 3. ^/datatab/load-dataset/$ 4.

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread Sarah . Vardy
Hi Graham, Thanks so much for all that information, it is greatly appreciated. Kind regards, Sarah vardy - Original Message - From: Graham Dumpleton <[EMAIL PROTECTED]> Date: Tuesday, April 1, 2008 1:54 pm Subject: Re: Dynamic Subdomain Generation for Users To: Django users

Re: Manipulating request.FILES

2008-03-31 Thread Cephire
Dimitri: I assume that you want to modify the name of the file that is submitted. It can be done in _save_FIELD_file of the model. Here is a snippet that i use to change the name of the uploaded avatar icon for the user. def _save_FIELD_file(self, field, filename, raw_contents,

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread Graham Dumpleton
On Apr 1, 1:21 pm, [EMAIL PROTECTED] wrote: > Hey, > > I am currently looking at installing multiple instances of Django on a server > to use Django as a teaching and learning tool. > > What is the best way to go about this? > > I want to minimise the amount of storage needed and optimize the

Re: Newbie with Django

2008-03-31 Thread Karen Tracey
On Mon, Mar 31, 2008 at 11:28 PM, Richa <[EMAIL PROTECTED]> wrote: > > Thanks Evert for your reply. I had tried that as well and it gave me > the following error. > > TemplateDoesNotExist at /admin/ > admin/login.html > Request Method: GET > Request URL:http://127.0.0.1:8000/admin/ >

Re: Newbie with Django

2008-03-31 Thread Richa
Thanks Evert for your reply. I had tried that as well and it gave me the following error. TemplateDoesNotExist at /admin/ admin/login.html Request Method: GET Request URL:http://127.0.0.1:8000/admin/ Exception Type: TemplateDoesNotExist Exception Value:

Just learning the ropes with Django and authentication

2008-03-31 Thread James
I am trying to figure out if there is a way to used the Django built in login page (the one used to get into the administration pages) and link that to my own site. I am also just beginning in the website business as well. Does anyone have any suggestions, or anyway that I can better understand

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread Sarah . Vardy
Hey, I am currently looking at installing multiple instances of Django on a server to use Django as a teaching and learning tool. What is the best way to go about this? I want to minimise the amount of storage needed and optimize the performance of the server. I have heard that modwsgi can

ensuring uniqueness in newforms

2008-03-31 Thread msoulier
If I have a field, for example a CharField named 'name', which must be unique, what's the best way to ensure uniqueness whether creating a new entry or editing an existing one? By default, the form won't know if it is being used to edit or create, so if you look for duplicates in the db, how

Re: obeying the DRY principle in views

2008-03-31 Thread msoulier
On Mar 31, 10:04 pm, Michael <[EMAIL PROTECTED]> wrote: > Not really a DRY issue moreover there is an easier logic to your code: Sad that I didn't see that. Thanks, Mike --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
Yes, of course there is a constraint there: the primary key, which of course I don't want to remove. Marty's solution was it. Thanks for the assistance. On Mar 28, 12:50 pm, "James Bennett" <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 2:35 PM, makebelieve <[EMAIL PROTECTED]> wrote: > >

Re: IntegrityError: duplicate key violates unique constraint

2008-03-31 Thread makebelieve
You, my friend, rule. That's exactly what I needed to do. I've just recently moved from MySQL and am at the point in which I appreciate Postgresql's strictness, but I am still getting used to it. On Mar 28, 12:57 pm, "Marty Alchin" <[EMAIL PROTECTED]> wrote: > Given that you say you're working

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread [EMAIL PROTECTED]
Thanks, Dan! Just what I needed. On Mar 31, 5:58 pm, Dan Ellis <[EMAIL PROTECTED]> wrote: > Hi, Levi. I've just had a look through the code, and it appears you're > in luck (at least in the trunk -- I haven't looked elsewhere). core/ > handlers/base.py contains this line[1]: > >     # Get

FormWizard and process_step

2008-03-31 Thread Jay Parlar
I'm trying to use process_step() to dynamically add new classes to my form_list, and running into some issues. Essentially, what I want my process_step to look like is: def process_step(self, request, form, step): next_form = build_next_form(step, form) if next_form:

Re: obeying the DRY principle in views

2008-03-31 Thread Michael
Not really a DRY issue moreover there is an easier logic to your code: if request.method == 'POST': form = MyForm(request.POST) if form.is_valid(): # make new model object and save return HttpResponseRedirect('/') else: form = MyForm(initial=data) return

Re: Put javascript in newforms or template?

2008-03-31 Thread Michael
I am only partially understanding what you are trying to accomplish, but in general you would put calls to static media files from your templates. There are some ways of including javascript files with custom widgets, but that's still a relatively new feature and in the case of most newforms a

obeying the DRY principle in views

2008-03-31 Thread msoulier
I find myself doing this a lot in view code if request.method == 'GET': form = MyForm(initial=data) return render_to_response('template.html', RequestContext(request, { 'foo': foo, 'bar': bar })) elif request.method == 'POST': form =

Re: Strange login error in newforms-admin site: ViewDoesNotExist at /accounts/login/

2008-03-31 Thread Michael
This is an instance of the AlreadyRegistered exception rearing its head in the contrib.auth section, something I have been banging my head against since I originally rewrote the auth code for a personal project a few months ago. Here is the ticket and a patch that fixes the problem without quite

Re: JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-03-31 Thread Michael
Your error is actually coming from the fact that you are not getting any results from your filter query. The reason that the error is appearing on the second line of your script is because filter is a lazy call and isn't really made until you ask it to return objects in this bit: s[:5]. Change

Re: question on ModelMultipleChoiceField

2008-03-31 Thread Iamnewbie
I forgot attaching my related codes in views: if id is None: form = PostForm() else: post = get_object_or_404(Post, pk=id) form = PostForm(post.__dict__) I'd appreciated any help. Thanks. --~--~-~--~~~---~--~~ You

Re: Calling syncdb twice

2008-03-31 Thread blis102
James, Django Evolution is a project that is working to take care of that problem (http://code.google.com/p/django-evolution/). I have not used it but, if what they say on their site is correct, it does what you are looking for: "When you run ./manage.py syncdb, Django will look for any new

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread Dan Ellis
Hi, Levi. I've just had a look through the code, and it appears you're in luck (at least in the trunk -- I haven't looked elsewhere). core/ handlers/base.py contains this line[1]: # Get urlconf from request object, if available. Otherwise use default urlconf = getattr(request,

question on ModelMultipleChoiceField

2008-03-31 Thread Iamnewbie
I have codes as follows: tags=forms.ModelMultipleChoiceField(queryset=Tags.objects.all(), widget=forms.CheckboxSelectMultiple) It is working for showing an empty form to the user to enter data. however, when I want to show an existing data (that stored in database) to the user to edit, the

Re: Newbie with Django

2008-03-31 Thread Evert Rol
> I am a newbie with Django and was trying to get it work on windows > vista following the tutorial at > http://www.djangoproject.com/documentation/0.96/tutorial02/ > . > > After "activating the admin site" as suggested in the tutorial, I got > the following error > > > > Using the URLconf

Newbie with Django

2008-03-31 Thread Richa
Hi guys I am a newbie with Django and was trying to get it work on windows vista following the tutorial at http://www.djangoproject.com/documentation/0.96/tutorial02/ . After "activating the admin site" as suggested in the tutorial, I got the following error Using the URLconf defined in

Re: get_or_create and DoesNotExist

2008-03-31 Thread Bryan Veloso
Sure thing Bruno, Model: http://dpaste.com/hold/42454/ Flickr Importer: http://dpaste.com/hold/42455/ I think that's all that's involved. Cheers, Bryan On Mar 31, 1:22 pm, "Bruno Tikami" <[EMAIL PROTECTED]> wrote: > Hi Bryan, > > would you post your model and view code too? As you didn't

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread [EMAIL PROTECTED]
Hey Tkm, Basically this application follows the Basecamp model. A company signs up for a sub domain, and many users are able to access it. It would be all in one project, but the sub domain would access a different url.py so that different applications and views can be used. Let me know if that

Re: Dynamic Subdomain Generation for Users

2008-03-31 Thread Bruno Tikami
Hi vemon, when the user access user.domain.com the request will be treated by a different project or all users share the same project? Though it may look a stupid question, if they have separate projects, you don't have to worry about it, cause they'll have different urls.py files. If they share

Re: How to json serialize dicts from values(*fields)

2008-03-31 Thread ydjango
I found what I needed here http://blog.michaeltrier.com/2007/7/30/json-generic-serializer Ashish On Mar 31, 2:27 pm, ydjango <[EMAIL PROTECTED]> wrote: > thanks. > > also when I add 'id' in fields, it appears to just ignore it, I get > back only food_name , group and description. Is it by

Using form wizard to complete form over multiple sessions

2008-03-31 Thread leifbyron
Hi there, I have a 20-step form wizard that many users prefer to complete over multiple sessions. I am considering adding save_for_later() and resume_form_wizard() functions that would save the serialized form data to the database, and allow users to resume the wizard at a later time. Has

Re: How to json serialize dicts from values(*fields)

2008-03-31 Thread ydjango
thanks. also when I add 'id' in fields, it appears to just ignore it, I get back only food_name , group and description. Is it by design or a bug? serializers.serialize('json',Food.objects.filter(group__exact=my_group),fields=('id','food_name','group','description')) thanks Ashish On Mar

Re: How to json serialize dicts from values(*fields)

2008-03-31 Thread Jeff Gentry
On Mon, 31 Mar 2008, ydjango wrote: > u'jsklajdkls'}, {'food_name': u'PMC', 'group': 1L, 'description': > u'jsklajdkls'}] > ( why do I see u before text in output above?) It indicates that they're unicode strings. --~--~-~--~~~---~--~~ You received this message

Dynamic Subdomain Generation for Users

2008-03-31 Thread [EMAIL PROTECTED]
Hi guys. I'm developing a system that gives a user a sub domain for their account. I found this article, http://www.rossp.org/blog/2007/apr/28/using-subdomains-django/, which is really helping. But the problem I'm having trouble thinking through is how I could give sub domains certain urls

Re: geo django and mysql

2008-03-31 Thread Justin Bronn
Greg, Please read the GeoDjango Database API documentation: http://code.djangoproject.com/wiki/GeoDjangoDatabaseAPI#CreatingandSavingGeographicModels In short, you may use WKT strings directly, e.g., `m = MyModel(mpoly='MULTIPOLYGON(((..)))')`. The API is the same whether you're using PostGIS

Re: get_or_create and DoesNotExist

2008-03-31 Thread Bruno Tikami
Hi Bryan, would you post your model and view code too? As you didn't send the view code, it's quite hard to say what's wrong. I *guess* result is your QuerySet object created by the get_or_created call . If so, did you save() the created object ? Regards, Tkm

get_or_create and DoesNotExist

2008-03-31 Thread Bryan Veloso
Hi all, I mostly just need a tap in the right direction for this one. I'm sure I'm missing something that's obvious. Anyway, I'm trying to run django- syncr, and it's telling me that "Photo matching query does not exist." But if it doesn't exist, shouldn't it create it? I'm thinking that

Re: How to json serialize dicts from values(*fields)

2008-03-31 Thread ydjango
I was able to get this to work. There was an import error from my side, data = serializers.serialize('json',Food.objects.filter(group__exact=my_group),fields=('food_name','group','description')) following two serialization ways gave me exception - 'dict' object has no attribute '_meta' a)

Strange login error in newforms-admin site: ViewDoesNotExist at /accounts/login/

2008-03-31 Thread AndyB
Some code that has previously worked fine and still works fine on my development server has started giving the following error on a production server when I try and visit my login page: ViewDoesNotExist at /accounts/login/ Could not import django.contrib.auth.views. Error was: cannot import name

How to json serialize dicts from values(*fields)

2008-03-31 Thread ydjango
I am on svn version as of two days back. I am using values(*fields) to create an output from my table. (following using print statement) out_list=Food.objects.filter(group__exact=my_group).values('food_name','group','description') print out_list [{'food_name': u'nirvana', 'group': 1L,

Re: geo django and mysql

2008-03-31 Thread jeffself
Is there a reason you must use MySQL? GeoDjango works much better with PostgreSQL with the PostGIS extensions. On Mar 31, 11:40 am, Greg_IAP <[EMAIL PROTECTED]> wrote: > Hi everybody, > > I'm working on a image processing pipeline for french astrophysicians > using web services through django.

edit form perform committing

2008-03-31 Thread jorgehugoma
Hi all, I am having a problem trying to add a field that i excluded in my ModelForm class in my views.py. This field is requeired by the model . In the django documentation says i should do the following: form = Myform(request.POST) formInstance = form.save(commit=False)

ImportError on login/logout

2008-03-31 Thread knack
I'm using Django 96.1 and am attempting to enable the user authentication system following the directions in the Django book and website documentation. I'm also using the 'login_required' decorator to restrict all my views, so typing in any valid address should redirect me to the login screen.

100% SUCCESSFUL SOLUTIONS OF PROBLEMS ONLY ONE CALL AWAY

2008-03-31 Thread janjanjanpakistan
ALMASHOOOR BABA JINNAA WALA Problems such as LOVE IMMATURITY, FINANCIAL/BUSINESS LOSS, DISTRESS among the COUPLES, MISTRUST, FAMILY DISPUTES ETC CALL ON 24HRS +923006952609 and +923216953893 VISIT:: www.astropalmist.blogspot.com (FOR PAKISTANI) AND (INDIANS) SHADI MAIN RUKAWAT,

Re: Using Django for Teaching

2008-03-31 Thread Todd O'Bryan
On Mon, Mar 31, 2008 at 12:46 AM, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > > > On 31-Mar-08, at 9:58 AM, Todd O'Bryan wrote: > > > Sorry this is two weeks late (it's been a bear of a two weeks), but > > I use Django with high school students who've done the equivalent > > of a year of

Re: to_template filter

2008-03-31 Thread peschler
Your "to_template" tag does what inclusion tags are for (not the {% include %} tag!). http://www.djangoproject.com/documentation/templates_python/#inclusion-tags peschler On 31 Mrz., 15:20, glopglop <[EMAIL PROTECTED]> wrote: > Hi, > > here is a simple filter I use sometimes when I want to

Re: Complicated relations

2008-03-31 Thread R. Akerman
Ah great, I thought I went over the models documentation but must have missed just what I was looking for... Thanks, I'll have a go at it. On 31 Mar, 18:25, "Jonathan Buchanan" <[EMAIL PROTECTED]> wrote: > On Mon, Mar 31, 2008 at 2:31 PM, R. Akerman <[EMAIL PROTECTED]> wrote: > > > I'm

Re: Complicated relations

2008-03-31 Thread Jonathan Buchanan
On Mon, Mar 31, 2008 at 2:31 PM, R. Akerman <[EMAIL PROTECTED]> wrote: > > I'm co-writing a site for a student nation ( > http://en.wikipedia.org/wiki/Nations_at_Swedish_universities ) and > I've run into some issues in the first step of creating the site, > making the models. > > I have a

Manipulating request.FILES

2008-03-31 Thread Dmitriy Sodrianov
Hi to all! I'm stuck with the problem of manipulating request.FILES. I need to do the following thing - there is a form with the FileField in it, After the submit file that is send with the form must be renamed and stored in particular way, let's say md5 of client ID. I have no idea of how to

Re: using Django unit test framework with existing production db

2008-03-31 Thread Faheem Mitha
On Fri, 28 Mar 2008 17:10:28 -0400 (EDT), Jeff Gentry <[EMAIL PROTECTED]> wrote: >> Is there some graceful way to have the Django unit test framework >> access the "production database" for certain tests as opposed to >> creating a test db? The idea is to do a basic sanity check of the >>

geo django and mysql

2008-03-31 Thread Greg_IAP
Hi everybody, I'm working on a image processing pipeline for french astrophysicians using web services through django. i'm using mysql database with innodb storage engine.I need to use geo django because i must be able to locate images taken by telescops in the celestial sphere (with

Re: Calling syncdb twice

2008-03-31 Thread Evert Rol
> I was wondering why you can only call "python manage.py syncdb" to > create your databases but after that if you change your models file > it work create the changes and you have to do them manually using SQL? I think there are several threads in this discussion group that have some

Re: howto display table data in html?

2008-03-31 Thread Jaap
"A model class represents a database table, and an instance of that class represents a particular record in the database table." I'm beginning to see some light. What I try to achieve is telling the application that, depending on the user's authority, he may not see some data, and/or may not

Calling syncdb twice

2008-03-31 Thread James Matthews
Hi, I was wondering why you can only call "python manage.py syncdb" to create your databases but after that if you change your models file it work create the changes and you have to do them manually using SQL? Thanks James -- http://search.goldwatches.com/?Search=Movado+Watches

Re: howto display table data in html?

2008-03-31 Thread Evert Rol
> I read there: > from django.shortcuts import render_to_response > from mysite.polls.model import Poll > def index(request): >latest_poll_list = Poll.objects.all() > > > What is 'latest_poll_list'? I assume it is a list, but a list of what? > Records? Can I cycle through that list (for X

Model unique case insensitive

2008-03-31 Thread Tourneur Henry-Nicolas
Hello all, I would like to make a field in a model unique but in a insenstitive way. Eg: Car(name='CAR'), Car(name='car') The second car should be blocked. Any idea ? TIA. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: howto display table data in html?

2008-03-31 Thread Jaap
I read there: from django.shortcuts import render_to_response from mysite.polls.model import Poll def index(request): latest_poll_list = Poll.objects.all() What is 'latest_poll_list'? I assume it is a list, but a list of what? Records? Can I cycle through that list (for X in

Complicated relations

2008-03-31 Thread R. Akerman
I'm co-writing a site for a student nation ( http://en.wikipedia.org/wiki/Nations_at_Swedish_universities ) and I've run into some issues in the first step of creating the site, making the models. I have a model called Person that describes personal information about a person; name, adress,

Re: synchronization problem

2008-03-31 Thread PENPEN
But I think the increment of the version column is the same with the example of Poll I mentioned in the previous post. If the transaction is not used, the read action is separated with the write action by default. The problem still can happen. Or do you have some special method to update this

Re: howto display table data in html?

2008-03-31 Thread Evert Rol
> Probably another stupid question (sigh), but looking at views.py and > having read just about all the documentation I could find (including > the Django book), I still do not see how I can get data from a > database into a web page. The Django book explains how it is done > using the live

to_template filter

2008-03-31 Thread glopglop
Hi, here is a simple filter I use sometimes when I want to templatize the presentation of a given model through several pages, such as a paagraph showing a person the same way in several pages, without resorting to inclusion (not always the same obnject name, could be included in a loop, ..) or

Re: Optional else block in for

2008-03-31 Thread Evert Rol
Perhaps this is useful: http://www.djangosnippets.org/snippets/546/ It even has a ticket: http://code.djangoproject.com/ticket/6398 with, of course, ensuing discussion. > > I was looking at jinja[1] and there was one feature which I really > liked > "for loops have an optional else block

howto display table data in html?

2008-03-31 Thread Jaap
Probably another stupid question (sigh), but looking at views.py and having read just about all the documentation I could find (including the Django book), I still do not see how I can get data from a database into a web page. The Django book explains how it is done using the live interpreter -

Optional else block in for

2008-03-31 Thread shabda
I was looking at jinja[1] and there was one feature which I really liked "for loops have an optional else block executed if there was no iteration." Right now most of my for loops are like, {% if comments %} {% for comment in comments %} {{comment}} {% endfor %} {% else %} There are no

Re: Custom ID field with random string

2008-03-31 Thread Julien
I found an example here, which works really well: http://www.ibm.com/developerworks/blogs/page/johnston?entry=cool_django However, I've also seen on several forums and groups that having UUID as primary key is not good at all for performance, especially when executing inner joints and so on. So

Re: permalink decorator

2008-03-31 Thread Panos Laganakos
You're right Jonathan, that was it. Don't know why I left it there in the first place (no reason to match one or more char's for the slash `/?$` anyway). I hadn't noticed it since I was using the get_absolute_url in the templates. Thanks. On Mar 31, 2:51 pm, "Jonathan Buchanan" <[EMAIL

Re: mark_safe for a html field

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 06:50 -0500, James Bennett wrote: > On Mon, Mar 31, 2008 at 6:46 AM, James Bennett <[EMAIL PROTECTED]> wrote: > > Since subclassing Field to create your own custom model fields is easy > > and documented, why not write an "HTMLField" class which calls > > mark_safe()

Re: permalink decorator

2008-03-31 Thread Jonathan Buchanan
On Mon, Mar 31, 2008 at 12:35 PM, Panos Laganakos <[EMAIL PROTECTED]> wrote: > > I've switched my code from: > def get_absolute_url(self): > return '/store/products/%s' % self.slug > > to: > @models.permalink > def get_absolute_url(self): >

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:46 AM, James Bennett <[EMAIL PROTECTED]> wrote: > Since subclassing Field to create your own custom model fields is easy > and documented, why not write an "HTMLField" class which calls > mark_safe() before returning a value? And though I may be wrong, I think it'd

Re: mark_safe for a html field

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 04:40 -0700, Marc Garcia wrote: > I was thinking in giving a option on field definition, to make it safe > on all templates at same time. Anyway using safe filter as you > proposed is clearer than my initial solution. The slight problem you're running up against here is

Re: mark_safe for a html field

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 6:40 AM, Marc Garcia <[EMAIL PROTECTED]> wrote: > I was thinking in giving a option on field definition, to make it safe > on all templates at same time. Anyway using safe filter as you > proposed is clearer than my initial solution. Since subclassing Field to create

[Newforms] "clever" fields

2008-03-31 Thread Grupo Django
Hi! I'm trying to create a generic form template for a custom admin zone. I'm doing it this way: http://www.djangoproject.com/documentation/newforms/#complex-template-output But I need to modify the output depending of the field type. It's easy to add a javascript calendar in a DateField if you

Re: mark_safe for a html field

2008-03-31 Thread Marc Garcia
I was thinking in giving a option on field definition, to make it safe on all templates at same time. Anyway using safe filter as you proposed is clearer than my initial solution. Thanks Kenneth On Mar 31, 4:01 am, Kenneth Gonsalves <[EMAIL PROTECTED]> wrote: > On 31-Mar-08, at 7:20 AM, Marc

permalink decorator

2008-03-31 Thread Panos Laganakos
I've switched my code from: def get_absolute_url(self): return '/store/products/%s' % self.slug to: @models.permalink def get_absolute_url(self): return ('django.views.generic.list_detail.object_detail', (), {

DOYOULIKECOMPUTER

2008-03-31 Thread nishanthy012
http://myprofile0116.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 from this group, send email to

Re: some help with urls

2008-03-31 Thread Rishabh Manocha
Thanks, That works :). Are there any good (django specific) resources to learn up on regexp's??I have looked through the regexp page on wikipedia and the python website itself, but i'm still as bad at them as I was before. Anyways, thanks again for your help, R On Mon, Mar 31, 2008 at 3:46

Re: Language code as part of URL

2008-03-31 Thread Panos Laganakos
We had some discussion about this on django-multilingual. Take a look here: http://groups.google.com/group/django-multilingual/browse_thread/thread/c394d3aed317a19a/b25464fa1f2aea4e#b25464fa1f2aea4e and yml's implementation (which is actually usuable):

Re: some help with urls

2008-03-31 Thread Ronny Haryanto
Try: r'^test/fullpath/(?P[\w/]+) Ronny On Mon, Mar 31, 2008 at 4:08 PM, Rishabh Manocha <[EMAIL PROTECTED]> wrote: > > Hey guys, > > I'm trying to setup my urls.py file and am having trouble getting the > args to be passed correctly to my view. I basically have something > link this: >

Re: Custom ID field with random string

2008-03-31 Thread Julien
I agree slugs are a lot nicer. In fact, I already have implemented those, so you can choose to refer to your project by a slug, given that slug hasn't already been taken by someonelse, in which case you need to choose another one. But by default projects don't have slugs, just an ID. I'll give a

Re: Multiple sites on shared host

2008-03-31 Thread Lyubomir Petrov
Maybe somekind of offtopic, but trying to run django on cPanel shared account, got a lot of problems with finalizing crash with error on splitting an empty request ('host.name','') Used the same method posted above, any ideas from where is the problem? Also additionally the htaccess or direct

Re: Django Admin WAP

2008-03-31 Thread Ben Ford
That's the one!! :-) Ben On 31/03/2008, Brot <[EMAIL PROTECTED]> wrote: > > > this could be useful: > http://code.google.com/p/django-mobileadmin/ > > Bernd > > > On 31 Mrz., 10:40, "Ben Ford" <[EMAIL PROTECTED]> wrote: > > I'm pretty sure that someone's put together a django admin type thing >

Re: Custom ID field with random string

2008-03-31 Thread Bram de Jong
why not use slugs then? http://www.example.com/projects/username/my-cool-project/ sounds a lot nice than http://www.example.com/projects/0sdf0s463sdg0/ - bram On Mon, Mar 31, 2008 at 11:21 AM, Julien <[EMAIL PROTECTED]> wrote: > > One reason is because I believe string allows to store

JSON serializers.serialize raises DoesNotExist on recursive data structures

2008-03-31 Thread Legioneer
Hi All, I'm trying to serialize recursive model (a category which refers to itself) and get a 'DoesNotExist: Category matching query does not exist', while other models work fine. Does anyone know a clue for this? I'm doing like this: from django.core import serializers; from newproject.models

Re: Problem with django unit testing

2008-03-31 Thread [EMAIL PROTECTED]
Firstly, thanks for your suggestions! I change the apps and class name then turn on the verbosity mode to test, but I can't see nothing abnormal output. Today I run the same unit test of this project on another computer and they all passed, so I think there are some problem with my development

Re: more study case on django

2008-03-31 Thread Stewart
I have found the Django project web site has been the best resource so far. It's fantastic, there is so much detail and everything I have needed to know is covered simple and clear way. Is there anything you are looking to specifically do? On Mar 31, 7:37 pm, Marco <[EMAIL PROTECTED]> wrote: >

Re: Custom ID field with random string

2008-03-31 Thread James Bennett
On Mon, Mar 31, 2008 at 4:00 AM, Julien <[EMAIL PROTECTED]> wrote: > I just thought I'd try to make it clearer what I'm after. Instead of > having numbers as ID for my objects, I'd like to have random strings > (e.g. "sadfwetbtyvt32452" or "fd70982876adhfd"...). Those strings have > to be

Re: Creating Custom Admin Views

2008-03-31 Thread Brot
does nobody have some helpful input? On 30 Mrz., 17:13, Bernd <[EMAIL PROTECTED]> wrote: > Hello, > > I followed the documentationhttp://www.djangobook.com/en/1.0/chapter17/ > in the section "Creating Custom Admin Views". I try to override the > change_list.html for one of my models. > > I only

Re: Django Admin WAP

2008-03-31 Thread Brot
this could be useful: http://code.google.com/p/django-mobileadmin/ Bernd On 31 Mrz., 10:40, "Ben Ford" <[EMAIL PROTECTED]> wrote: > I'm pretty sure that someone's put together a django admin type thing for > smaller form factor devices... I can't remember where I saw it though, > sorry! > Ben >

Re: Custom ID field with random string

2008-03-31 Thread Kenneth Gonsalves
On 31-Mar-08, at 2:30 PM, Julien wrote: > I just thought I'd try to make it clearer what I'm after. Instead of > having numbers as ID for my objects, I'd like to have random strings > (e.g. "sadfwetbtyvt32452" or "fd70982876adhfd"...). Those strings have > to be unique across the table. > Is

Re: Custom ID field with random string

2008-03-31 Thread Julien
Hello again, I just thought I'd try to make it clearer what I'm after. Instead of having numbers as ID for my objects, I'd like to have random strings (e.g. "sadfwetbtyvt32452" or "fd70982876adhfd"...). Those strings have to be unique across the table. Is that easily achievable? Am I on the

Re: Model Absolute URL

2008-03-31 Thread jurian
I'm using this URL as a value in a select box. The select box lists all related models which can be added to the current object. I want to be able to get the absolute 'add' page URL for each model. On Mar 31, 10:17 am, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Mon, 2008-03-31 at 01:01

Re: more study case on django

2008-03-31 Thread Eric Abrahamsen
You can start with the www.djangoproject.com website itself! http://code.djangoproject.com/browser/djangoproject.com Eric On Mar 31, 2008, at 4:37 PM, Marco wrote: > > Hi, all > > I'm a beginner on Django. I wanna know are there some studycase > website core for learning? > > Thank you! >

Re: Django Admin WAP

2008-03-31 Thread Ben Ford
I'm pretty sure that someone's put together a django admin type thing for smaller form factor devices... I can't remember where I saw it though, sorry! Ben On 31/03/2008, David Marquis <[EMAIL PROTECTED]> wrote: > > > Using the Django admin on a WAP browser would involve serious > usability

more study case on django

2008-03-31 Thread Marco
Hi, all I'm a beginner on Django. I wanna know are there some studycase website core for learning? Thank you! -- LinuX Violin Canon EOS --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: Reloading projects on FCGI

2008-03-31 Thread Steingrim Dovland
On Mon, Mar 31, 2008 at 9:46 AM, James Matthews <[EMAIL PROTECTED]> wrote: > What is a quick way to reload your project (for example you want to make a > quick code change) under fastcgi? It depends on your setup, but I find the fastest way is to kill the fastcgi process. I'm using Daemontools

Re: render_to_response syntax

2008-03-31 Thread Jaap
Absolutely right - thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to

Re: many to many field problem

2008-03-31 Thread Evert Rol
> the transparency is inside class tableSlot, when i'm looping > tableSlot, it works fine... but when i add the columnsetup or > querysetup, i got the error.. maybe my query is wrong? :( Sorry, no idea so far, but there's probably still information lacking: > > >ds =

Re: Localizing URLs

2008-03-31 Thread Malcolm Tredinnick
On Mon, 2008-03-31 at 05:12 -0300, Marinho Brandao wrote: > Malcolm and Alex, > > thanks, but I gave up. This was not a good idea :) I realise what you're trying to do, but personally, if you want a URL per locale, I'd shove a locale identifier into the URL, rather than trying to translate the

  1   2   >