Re: Does the django admin support the Group?

2007-09-03 Thread BearXu
Thanks:) 2007/9/4, Greg Donald <[EMAIL PROTECTED]>: > > > On Tue, Sep 04, 2007 at 04:56:47AM -, Bear wrote: > > For instance, Group A can access all the tables but Group B just > > access some of them? > > http://www.djangobook.com/en/beta/chapter06/ > > There's a small section "Users,

Re: Does the django admin support the Group?

2007-09-03 Thread Greg Donald
On Tue, Sep 04, 2007 at 04:56:47AM -, Bear wrote: > For instance, Group A can access all the tables but Group B just > access some of them? http://www.djangobook.com/en/beta/chapter06/ There's a small section "Users, groups, and permissions", about halfway down the page. -- Greg Donald

Re: Help needed with forms (newbie)

2007-09-03 Thread Russell Keith-Magee
On 9/4/07, AniNair <[EMAIL PROTECTED]> wrote: > > Hi... > This might be incredibly simple. BUT.. I am trying to learn python > and django and have been trying to do some form submission (entering a > data on one page and accessing it).. I cannot find a way to do that > using django... Can anyone

Does the django admin support the Group?

2007-09-03 Thread Bear
For instance, Group A can access all the tables but Group B just access some of them? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: How to add a non database item to a python model

2007-09-03 Thread Ben Ford
If you want to add things to an instance in a view you could just use setattr. Is this what you're asking? Ben On 04/09/07, shabda <[EMAIL PROTECTED]> wrote: > > > I have a python model > > class MyModel(models.Model): > fld1 = models.TextField() > fld1 = models.TextField() > > I

Re: How to use Django with 2 legacy databases

2007-09-03 Thread Ben Ford
Hi there, I use multiple-db-support extensively, and I've also bought it relatively up to date. There are still a few problems with getting the updates into the django repo, and to be honest I've been so busy lately that I haven't really had time to follow up on that. Another thing to consider,

How to add a non database item to a python model

2007-09-03 Thread shabda
I have a python model class MyModel(models.Model): fld1 = models.TextField() fld1 = models.TextField() I want to have a non database item in this model class, which I can populate in the views. What is the recommended way to do this.

MultiValueDict and cache

2007-09-03 Thread Doug B
This is long, but my primary question is "How the heck do I save a picklable copy of POST data, specifically to cache it for use in a inclusion tag, without manually extracting the data into a normal dict?" My tag has a form that posts to a single view that may not be the current one. I want

Re: .latest() view not showing latest entry

2007-09-03 Thread synthrabbit
> To work around the "problem" (it's an evaluation-timing thing, so > Python/Django is doing the "right" thing...just not what you > expected), you need to simply pass Page.objects to your dict as, > say "objects". Then, in your view template, you need to > reference "objects.latest.slug" which

Re: Parents and Childrens in the same table

2007-09-03 Thread qwerty
Thanks! 2007/9/3, Ramiro Morales <[EMAIL PROTECTED]>: > > > On 9/3/07, qwerty <[EMAIL PROTECTED]> wrote: > > Hi, > > > > I've a category table, where a category can be related as a "child" to > > another, and a "parent" to others. > > > > Is there any django-way of doing this, where I've methods

Re: Parents and Childrens in the same table

2007-09-03 Thread Ramiro Morales
On 9/3/07, qwerty <[EMAIL PROTECTED]> wrote: > Hi, > > I've a category table, where a category can be related as a "child" to > another, and a "parent" to others. > > Is there any django-way of doing this, where I've methods like > modelinstance.childrens () and modelinstance.parent()? > There

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 8:37 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Yes you can try to play with custom template tags or with context > processorshttp://www.djangoproject.com/documentation/templates_python/#subclass... OK, excellent. Thanks for your help Alex, much appreciated.

Re: How to use Django with 2 legacy databases

2007-09-03 Thread Russell Keith-Magee
On 9/4/07, nubis <[EMAIL PROTECTED]> wrote: > > Hi all, I think I got this wrong, are you saying that: > > Django supports connecting to several databases at the same time? > Where do you configure each database connection? how do you tell a > model which one to use? I think the original

Unable to connect to SQLite db in tutorial

2007-09-03 Thread eoc
Hello- First of all, this is on OS X and Python 2.4. I'm able to import django, and import pysqlite2 from the python command line, and create a project and start a server. But I'm unable to proceed with doing a syncdb - My settings.py has 'sqlite3' as the DATABASE_ENGINE and a path of

Re: .latest() view not showing latest entry

2007-09-03 Thread Tim Chase
> particular table. I've got it working like this in my urls.py: > > latest_info_dict = { > 'queryset': Page.objects.all(), > 'slug': Page.objects.latest().slug, > } At this point, your urls.py has a semi-static dict in it...most importantly, latest_info_dict['slug'] is set to a

Re: .latest() view not showing latest entry

2007-09-03 Thread James Bennett
On 9/3/07, synthrabbit <[EMAIL PROTECTED]> wrote: > latest_info_dict = { > 'queryset': Page.objects.all(), > 'slug': Page.objects.latest().slug, > } The bit which calls latest() here is evaluated exactly once: when your URLs module is first loaded into memory. Hence, whichever object is

Parents and Childrens in the same table

2007-09-03 Thread qwerty
Hi, I've a category table, where a category can be related as a "child" to another, and a "parent" to others. Is there any django-way of doing this, where I've methods like modelinstance.childrens() and modelinstance.parent()? Thanks, Angel --~--~-~--~~~---~--~~

Re: How to use Django with 2 legacy databases

2007-09-03 Thread nubis
Hi all, I think I got this wrong, are you saying that: Django supports connecting to several databases at the same time? Where do you configure each database connection? how do you tell a model which one to use? maybe I got it all wrong best regards nubis :) On Sep 3, 2007, at 8:38 PM,

.latest() view not showing latest entry

2007-09-03 Thread synthrabbit
I'm trying to create a view that shows the 1 most recent entry in a particular table. I've got it working like this in my urls.py: latest_info_dict = { 'queryset': Page.objects.all(), 'slug': Page.objects.latest().slug, } urlpatterns = patterns('', (r'^$',

Re: How to use Django with 2 legacy databases

2007-09-03 Thread Iapain
> We have a customer management application written in Zope2 which talks > to a sql-ledger database. I'd like to convert this to Django but > would need to talk to two separate postgres databases. Not a problem with Django, multiple dbs are supported > Can I get some comments on the

How to use Django with 2 legacy databases

2007-09-03 Thread neillc
I'm an absolute newbie, with a newbie question. We have a customer management application written in Zope2 which talks to a sql-ledger database. I'd like to convert this to Django but would need to talk to two separate postgres databases. Can I get some comments on the practicality of this?

Re: Calling User data from within templates

2007-09-03 Thread Alex Koshelev
Yes. You have to use RequestContext. If you don't use it django will not execute context processors and user variable never be passed into context On 4 сент, 00:41, Robert <[EMAIL PROTECTED]> wrote: > I'm not sure that requestContext was what i needed... I need simply to > be able to get user

Re: Calling User data from within templates

2007-09-03 Thread Robert
I'm not sure that requestContext was what i needed... I need simply to be able to get user data from inside my base template... the django tutorial says that you should by default, be able to do so, but I'm finding this to not be the case. Do you have any other ideas as to why it's not working

Re: Calling User data from within templates

2007-09-03 Thread eXt
On 3 Wrz, 21:50, Robert <[EMAIL PROTECTED]> wrote: > Shouldn't that automatically be "Turned on"? You're right here., it's turned on by default. > How can I check to see if > it is, and if it's not, how can I install it? You can always check this setting (and other too) in:

Re: Calling User data from within templates

2007-09-03 Thread Robert
Shouldn't that automatically be "Turned on"? How can I check to see if it is, and if it's not, how can I install it? Thanks, sorry for such a dumb question -Robert On Sep 3, 2:20 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Check your TEMPLATE_CONTEXT_PROCESSOR setting. auth TCP must be >

Re: Help installing Psycopg2 and/or MySQL-python on OS X

2007-09-03 Thread jfagnani
I used to install and compile all my components by hand, but I recently switched to using MacPorts, and I highly recommend it. I installed everything: Apache 2, MySQL, Python 2.5, mod_python, py- mysql from macports and it just works together. Macports has a psycopg2 package. On Sep 2, 4:04 pm,

Re: Calling User data from within templates

2007-09-03 Thread Alex Koshelev
Check your TEMPLATE_CONTEXT_PROCESSOR setting. auth TCP must be installed http://www.djangoproject.com/documentation/templates_python/#django-core-context-processors-auth On 3 сент, 22:33, Robert <[EMAIL PROTECTED]> wrote: > Hi all, I'm new to Django and python in general, so please overlook my

Storing Lookup Data

2007-09-03 Thread Lee Hinde
This may be more a database question than a Django question, but... How do you store lookup data? By this I mean the data that might populate a pick list. Like, a list of states or counties or person prefixes. Or medal choices in a competition. It seems to be between a single table per choice.

Re: newsform question

2007-09-03 Thread Doug B
I think what you want is the newforms 'prefix' option. I can't seem to find it in the docs though, so here is an example. It seems a little strange to be saving forms in the session, and I can't see how your quantity updates can happen if you don't access POST in the update_quantity view at

Calling User data from within templates

2007-09-03 Thread Robert
Hi all, I'm new to Django and python in general, so please overlook my faulty nomenclature, and if something isn't quite clear, please let me know. I'm working with a project that needs to use user data as part of the template. In a "base.html" file (the base template, I suppose), when I try to

Re: so wierd problem?

2007-09-03 Thread jake
hi kevin - it sounds like your PythonPath is not being set properly in your project's apache configuration. there are some instructions about that here: http://www.djangoproject.com/documentation/modpython/#basic-configuration -jake [EMAIL PROTECTED] wrote: > i used the development server to

Re: using defaultdict on django

2007-09-03 Thread Aidas Bendoraitis
Try iterating through the keys only and get the values from the dictionary or multi-value dictionary by the keys: items = # ... your custom dict or request.POST for k in items: v = items[k] # should be a string instead of a list with one value # ... do whatever you want to do with the

Re: how to select posts in this situation?

2007-09-03 Thread Jonathan Buchanan
On 9/3/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > there are many users and submit many posts, user1, user2,user3 etc. > are my friends, now i want to select all posts which submitted by my > friends? > can somebody gelp me, thx! Try this: Post.objects.filter(user__in=[user1,

Re: how to select posts in this situation?

2007-09-03 Thread Alex Koshelev
Something like this: from django.db.models import Q import operator query_set = Post.objects.all() users = [ Q( user = user) for user in [ user1, user2, user3 ] ] query_set = query_set.filter( reduce(operator.or_, users ) ) --~--~-~--~~~---~--~~ You received

how to select posts in this situation?

2007-09-03 Thread [EMAIL PROTECTED]
there are many users and submit many posts, user1, user2,user3 etc. are my friends, now i want to select all posts which submitted by my friends? can somebody gelp me, thx! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: so wierd problem?

2007-09-03 Thread [EMAIL PROTECTED]
thx Graham. and this is key point: PythonPath "['/path/to/parent','/path/to/parent/mysite1'] +sys.path" On 9月3日, 下午6时50分, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > See: > > http://code.djangoproject.com/ticket/5299 > > and the reference mailing list thread. > > If you do not reference

Re: Look at my city!

2007-09-03 Thread David Larlet
2007/9/3, Sylvain <[EMAIL PROTECTED]>: > > Hi everyone! > > I've just created my city, in France. > You can visit it here : > http://val-daxance.miniville.fr/ > > Let you be welcome in Val d'Axance! > > The Mayor, > Sylvain > For english users, sorry for the noise. Sylvain, ces liens à boulets

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Alex Koshelev
Yes you can try to play with custom template tags or with context processors http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: Signals Question - Firing off an email after a save

2007-09-03 Thread Jeremy Dunck
On 9/3/07, Alex Koshelev <[EMAIL PROTECTED]> wrote: > > save() is method, so it must get at least one parameter - self. > def save( self ): >... Sorry, I was sloppy. :-/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: How to convert a Django model item to the underlying python object

2007-09-03 Thread Jeremy Dunck
On 9/3/07, shabda <[EMAIL PROTECTED]> wrote: > > I need to convert a models.datefield to a python type. How can I do > this. In general what is the way to convert the django model data type > to a pure python data type? I'm not sure what you're asking here. If your model is like this: class

Re: How to convert a Django model item to the underlying python object

2007-09-03 Thread Alex Koshelev
Each field class has to_python() method: class MyModel( models.Model ): date = models.DateField() # field = MyModel._meta.get_field( "date" ) date_obj = field.to_python( "2007-09-03" )#date_obj is python Date instance --~--~-~--~~~---~--~~ You received

Look at my city!

2007-09-03 Thread Sylvain
Hi everyone! I've just created my city, in France. You can visit it here : http://val-daxance.miniville.fr/ Let you be welcome in Val d'Axance! The Mayor, Sylvain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Look at my city!

2007-09-03 Thread Sylvain
Hi everyone! I've just created my city, in France. You can visit it here : http://val-daxance.miniville.fr/ Let you be welcome in Val d'Axance! The Mayor, Sylvain --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Andrey Khavryuchenko
C> I'm curious, is there a way to do this without regenerating all of C> the code inside of the views.py file? C> I've been reading about setting up templatetags, would this work for C> what I want to do, and if so would it be better? Regenerating? The polls or latest_poll_list should

Re: alternative to model inheritance?

2007-09-03 Thread [EMAIL PROTECTED]
Overriding your save() Method may help. Insted of having to manually define a "Project" everytime, you could let it be created everytime a new Instance of "...project" is created. i also would change the "type" Field to a CharField. Then the save() Method can also set the Type of Depending

using querysets to populate a form

2007-09-03 Thread David Reynolds
Hi, I have a requirement to use querysets as choices in various elements of a form, and as the data grows this is clearly going to have a big hit on the database every time this form is loaded. Can anyone think of a way around this? Is there a way to cache the query set and only update

Re: so wierd problem?

2007-09-03 Thread Graham Dumpleton
See: http://code.djangoproject.com/ticket/5299 and the reference mailing list thread. If you do not reference through the site name, you need to add the directory for the site to PythonPath. Graham On Sep 3, 6:14 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > i used the development

Re: alternative to model inheritance?

2007-09-03 Thread Doug
I guess my issue is that I only want to have to enter the project once. I don't want to create a Project and then have to create a StudentProject and link them via a foreign key. I'm having trouble visualizing how this would look/work in the admin. Ideally, I would have a select box that asked

Re: alternative to model inheritance?

2007-09-03 Thread Stefan Rimaila
I don't think you need to create this kind of inheritance, but instead, you could create projects with ForeignKeys that point to a certain project type. This would of course then require some additional tweaking or customising on your models (such as the client, discipline, etc.), as Django,

alternative to model inheritance?

2007-09-03 Thread Doug
I m creating new models for a portfolio application. I am creating a Project class and one of the fieldsof this class will be "type". There will be four types of Projects: Student, Professional, Competition, Personal. Each of these types will share most fields but some types will have addtional

Re: Django & postgresql schemata

2007-09-03 Thread eXt
On 3 Wrz, 10:53, "Giuseppe Ciotta" <[EMAIL PROTECTED]> wrote: > Does Django support postgresql schema different from the default (public)? You may find this ticket useful: http://code.djangoproject.com/ticket/1051 regards Jakub Wiśniowski --~--~-~--~~~---~--~~

Re: django checkout doesn't work..

2007-09-03 Thread Nis Jørgensen
Devi skrev: > Hi, > > I was trying to get the developement version of django and that > doesn't work by this.. > svn co http://code.djangoproject.com/svn/django/trunk/ > What happens when you run that command? "Does not work" is not very specific ... > I'm able to see the files in the

Re: send_mail error with a dot in the email-address

2007-09-03 Thread patrickk
ok, this is not displayed correctly. send_mail works, if there´s no "dot" before the "@". otherwise it throws an error. On 3 Sep., 11:02, patrickk <[EMAIL PROTECTED]> wrote: > it´s strange, but registering on our site with "[EMAIL PROTECTED]" works > while "[EMAIL PROTECTED]" doesn´t. > the

Re: Django & postgresql schemata

2007-09-03 Thread James Bennett
On 9/3/07, Giuseppe Ciotta <[EMAIL PROTECTED]> wrote: > Does Django support postgresql schema different from the default (public)? No. Patches would be welcome. -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: django checkout doesn't work..

2007-09-03 Thread James Bennett
On 9/3/07, Devi <[EMAIL PROTECTED]> wrote: > I was trying to get the developement version of django and that > doesn't work by this.. > svn co http://code.djangoproject.com/svn/django/trunk/ > > I'm able to see the files in the browser. Any ideas of what can be > done? Without knowing what sort

send_mail error with a dot in the email-address

2007-09-03 Thread patrickk
it´s strange, but registering on our site with "[EMAIL PROTECTED]" works while "[EMAIL PROTECTED]" doesn´t. the error is, that this mailbox doesn´t exist. is that django-related or do I have to check something else? thanks, patrick --~--~-~--~~~---~--~~ You

Re: Django & postgresql schemata

2007-09-03 Thread Giuseppe Ciotta
> class Box(models.Model): > serial = models.CharField(max_length=25, primary_key=True) > > class Meta: > db_table = u'boxes.box' > verbose_name_plural = "Boxes" Well, I should add that inspecting the raw sql reveals that django is using this kind of query: 'select field

Django & postgresql schemata

2007-09-03 Thread Giuseppe Ciotta
Does Django support postgresql schema different from the default (public)? I'm interfacing with a legacy database, using this model definition: class Box(models.Model): serial = models.CharField(max_length=25, primary_key=True) class Meta: db_table = u'boxes.box'

django checkout doesn't work..

2007-09-03 Thread Devi
Hi, I was trying to get the developement version of django and that doesn't work by this.. svn co http://code.djangoproject.com/svn/django/trunk/ I'm able to see the files in the browser. Any ideas of what can be done? Thanks, Devi --~--~-~--~~~---~--~~ You

Re: Another UnicodeError: django-registration or send_mail

2007-09-03 Thread patrickk
sh**, that´s embarrassing. thanks for the answer. On Sep 3, 4:08 am, "James Bennett" <[EMAIL PROTECTED]> wrote: > On 9/2/07, patrickk <[EMAIL PROTECTED]> wrote: > > > I´m using django-registration and changed line 80 of models.py from > > subject = "Account activation for %s" % current_domain >

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 1:10 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > In list_events view you have to pass your polls list into context to. > > ... > from mysite.polls.models import Poll > ... > def list_events(request): > latest_event_list = Event.objects.all() > latest_poll_list =

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
On Sep 3, 1:00 am, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Please show your views code or tell what you pass into template > context. Sure thing, here's my views code for the events app. from mysite.events.models import Event from django.shortcuts import render_to_response,

Re: Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Alex Koshelev
Please show your views code or tell what you pass into template context. --~--~-~--~~~---~--~~ 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

Re: Signals Question - Firing off an email after a save

2007-09-03 Thread Alex Koshelev
save() is method, so it must get at least one parameter - self. def save( self ): ... > > TypeError at /admin/envwork/environment/12/ > save() takes no arguments (1 given) > > Any thoughts? > --~--~-~--~~~---~--~~ You received this message because you are

Re: newforms and DateField

2007-09-03 Thread Pigletto
You may also try: http://www.djangosnippets.org/snippets/391/ --~--~-~--~~~---~--~~ 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

Unable to get Django to output variables when calling from a different app

2007-09-03 Thread Catalyst
I'm having trouble getting variables to output from a different Django app. For example, I have two apps installed in Django (besides the default stuff), events and polls. Here's my template code that's mapped to the events URL. {% for event in latest_event_list %} {{

Re: Signals Question - Firing off an email after a save

2007-09-03 Thread Jack E. Wilkinson
Thank you for the response Jeremy! Your solution seems the most graceful and efficient. However it looks like I may be doing something wrong... :-( Here is the modification... ... class Environment(models.Model): short_name = models.CharField("Short Name", maxlength=8, blank=False,

Re: newforms and DateField

2007-09-03 Thread Alex Koshelev
There is no way to use admin's calendar into regular pages with newforms. You have to implement it by yourself. On 3 сент, 11:07, picky <[EMAIL PROTECTED]> wrote: > That's what I was thinking. I try it but I don't fuind how to display > calendar button. > I don't see anything in http code of an

Re: newforms and DateField

2007-09-03 Thread picky
That's what I was thinking. I try it but I don't find how to display calendar button. I don't see anything in http code of an admin page which contains a DateField. Mathieu On Sep 1, 11:47 pm, "Peter Melvyn" <[EMAIL PROTECTED]> wrote: > On 8/31/07, picky <[EMAIL PROTECTED]> wrote: > > > I try

Re: truncating posts with markdown

2007-09-03 Thread Ross Poulton
On Sep 3, 4:31 pm, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Markdown wraps all text in tag so truncate_html doesn't work I haven't seen that either... It wraps the paragraphs in tags through, which makes sense. To truncate it, why not change the order of your filters? {{

Re: Sharing models between applications

2007-09-03 Thread Alex Koshelev
Just put the full import path to your app in INSTALLED_APPS. It's no mater where this application lies. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: truncating posts with markdown

2007-09-03 Thread James Bennett
On 9/3/07, Alex Koshelev <[EMAIL PROTECTED]> wrote: > Markdown wraps all text in tag so truncate_html doesn't work ? I'm using Markdown and I've *never* seen it do that... -- "Bureaucrat Conrad, you are technically correct -- the best kind of correct."

Re: truncating posts with markdown

2007-09-03 Thread Alex Koshelev
Markdown wraps all text in tag so truncate_html doesn't work --~--~-~--~~~---~--~~ 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