Re: Creating a multi-column index

2009-03-09 Thread Matt Doran
Hi Alex + Malcolm, On Mar 9, 4:03 pm, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 21:58 -0700, Matt Doran wrote: > > Hi there, > > > I'm porting another system across to Django, and I need to create a > > multi-column unique index.  I previously used SQLObject

How to create new User with Profile in elegant way

2009-03-09 Thread myst3rious
Hi, Working on a Django app, which requires profile for each subscribing user, I created a Profile model: class Profile(models.model): user = models.ForeignKey(User, unique=True) middlename = models.CharField(max_length=32, blank=True) gender = models.CharField(max_length=1,

Re: How to create new User with Profile in elegant way

2009-03-09 Thread Malcolm Tredinnick
On Sun, 2009-03-08 at 23:30 -0700, myst3rious wrote: > Hi, > Working on a Django app, which requires profile for each subscribing > user, I created a Profile model: > class Profile(models.model): > user = models.ForeignKey(User, unique=True) > middlename = models.CharField(max_length=32,

How to create such a model?

2009-03-09 Thread khsing
I want create a model that contain two field and there is one of two field can not be blank. how to do it? thanks. -- A man live in jail and want to break. http://blog.khsing.net --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: How to create new User with Profile in elegant way

2009-03-09 Thread myst3rious
> If you're setting all these things in the User object, then reverse the > logic slightly: > >         new_user = User.objects.create(username=username, >             email=email, >             is_active=True, >             first_name=firstname, >             last_name=lastname) >        

Re: How to create new User with Profile in elegant way

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 01:06 -0700, myst3rious wrote: > > > If you're setting all these things in the User object, then reverse the > > logic slightly: > > > > new_user = User.objects.create(username=username, > > email=email, > > is_active=True, > >

Needed: a tidy model for varying numbers of multiple numerical values (page number refs)?

2009-03-09 Thread Dave E
I have some data (page number references) that looks like this: 320, 387..90, 410, 500 or (sustituting numerical .. ranges for conventional dashes) 320, 387-90, 410, 500, 634 I'd just like to know the most Django-esque way of creating a model for these? The requirements are: 1. they're all

Re: Where to put jquery/dojo js files

2009-03-09 Thread Wolfram Kriesing
Did you try dojango? http://code.google.com/p/dojango/ Dojango is a reusable django application that helps you to use the client-side framework dojo within your django project. * It provides capabilites to easily switch between several dojo versions and sources (e.g. aol, google, local) *

Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread K*K
I'm porting a old system to Django architecture. The database schema can not be modified because the data was existed. The new system will running with the old system at the beginning but will run standalone in the future. The system have two tables, which one is plan and another is plan_text,

Re: Needed: a tidy model for varying numbers of multiple numerical values (page number refs)?

2009-03-09 Thread Tim Chase
Dave E wrote: > I have some data (page number references) that looks like this: > > 320, 387..90, 410, 500 > > or (sustituting numerical .. ranges for conventional dashes) > > 320, 387-90, 410, 500, 634 > > I'd just like to know the most Django-esque way of creating a model > for these? > >

Django and SEO activities

2009-03-09 Thread adam.abbo...@gmail.com
Hi, I'm currently looking at developing a major project in Django. I'll be working with a team (2) developers on the project, however I wanted to get an idea for how search engine friendly Django is? I'm really not too sure about Django and hence I need advice. Thanks for your time.

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 02:47 -0700, K*K wrote: > I'm porting a old system to Django architecture. The database schema > can not be modified because the data was existed. The new system will > running with the old system at the beginning but will run standalone > in the future. > > The system have

Re: Django and SEO activities

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 01:57 -0700, adam.abbo...@gmail.com wrote: > Hi, > > I'm currently looking at developing a major project in Django. I'll be > working with a team (2) developers on the project, however I wanted to > get an idea for how search engine friendly Django is? I'm really not > too

How to get the value of ForeignKey

2009-03-09 Thread guptha
hi gp, In models.py class BankerCategory(models.Model): name = models.CharField(max_length=125,unique=True) class Banker(models.Model): bankercategory = models.ForeignKey(BankerCategory) class Homeloan(models.Model): banker =

Re: Does Django 1.1 support mulitple primary_key ?

2009-03-09 Thread James Bennett
On Mon, Mar 9, 2009 at 4:47 AM, K*K wrote: > Because the > requirements wrote all of database code should implemented with ORM > code and can not use RAW SQL, and the interactive designer do not want > to make concession. The person responsible for this decision should be

Re: How to get the value of ForeignKey

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 03:54 -0700, guptha wrote: > hi gp, > In models.py > > class BankerCategory(models.Model): > name = models.CharField(max_length=125,unique=True) > > class Banker(models.Model): > bankercategory = models.ForeignKey(BankerCategory) >

Re: [slightly OT] Web deployment certification

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 1:51 PM, Kenneth Gonsalves wrote: > > Hi, > > I work with a Government department with a mandate to spread FOSS/OSS in both > formal and non-formal education sector. We are planning to introduce a web > deployment certification. A person may be a

Re: [slightly OT] Web deployment certification

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 8:23 PM, Russell Keith-Magee wrote: > On Mon, Mar 9, 2009 at 1:51 PM, Kenneth Gonsalves > wrote: >> >> Hi, >> >> I work with a Government department with a mandate to spread FOSS/OSS in both >> formal and non-formal

Re: IntegrityError: columns app_label, model are not unique

2009-03-09 Thread Russell Keith-Magee
On Mon, Mar 9, 2009 at 4:00 AM, He Jibo wrote: > Thank you so much for your detailed explanation. I have tried your > suggestion of "The relatively simple solution that _might_ work (depending > on the details of your project) is to remove references to contrib.auth and >

Re: How to create such a model?

2009-03-09 Thread Reiner
Hi, have a look at the documentation of field options in models: http://docs.djangoproject.com/en/dev/ref/models/fields/#blank class Foo(models.Model): this_is_required = models.CharField(...) this_not = models.CharField(..., blank=True) Regards, Reiner On Mar 9, 8:37 am, khsing

Re: Django and SEO activities

2009-03-09 Thread Reiner
Additionally django comes with a sitemap application in contrib.sitemaps. See http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/ for more information. This should make indexing your website a lot easier for bots, you can even ask google for reindexing when your sitemap changes for

Re: How to get the value of ForeignKey

2009-03-09 Thread guptha
thanks for your reply but i cannot solve my problem i will make my question clear this time class BankerCategory(models.Model): name = models.CharField(max_length=125,unique=True) created_on = models.DateTimeField(auto_now_add=True) class Banker(models.Model): name =

Problem with uploading a ImageField through ModelForm

2009-03-09 Thread Marek Wawrzyczek
Hi, I've got the code like this: class Photo(models.Model): image = models.ImageField(upload_to='photos') class PhotoForm(ModelForm): class Meta: model = Photo View function fragment: if request.method == 'POST': post = request.POST.copy() print 'post:

Re: Problem with uploading a ImageField through ModelForm

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 13:34 +0100, Marek Wawrzyczek wrote: [..] > When I try to use FileField it works the same. How can I slove this > problem ? You need to add a bit extra to the HTML form when file uploads are involved. Essentially, telling the browser that the response should be encoded

config dev server for static media

2009-03-09 Thread Serdar T.
Hey everyone, Yes, this is yet another plea for help on configuring the dev server for static media. [insert disclaimer here about reading (and re-reading) docs, countless tutorials, etc.] I believe I have everything set up correctly, yet I can't seem to get Django to serve static media on my

Re: Problem with uploading a ImageField through ModelForm

2009-03-09 Thread Marek Wawrzyczek
Malcolm Tredinnick wrote: > On Mon, 2009-03-09 at 13:34 +0100, Marek Wawrzyczek wrote: > [..] > > >> When I try to use FileField it works the same. How can I slove this >> problem ? >> > > You need to add a bit extra to the HTML form when file uploads are > involved. Essentially, telling

Caching and logged-in users

2009-03-09 Thread Håkan W
Hi all, I'm a bit confused about the caching. I've started using per-view caching with the @cache_page decorator. Now, if I add this to pages that return private content to logged-in users, will it do the right thing and not show information for one logged-in user to another? And it must not

Re: python + rrdtool?

2009-03-09 Thread Karan
I'd be interested in a response to this as well. Thanks. On Mar 6, 9:49 pm, Jeremy Dunck wrote: > Does anyone use a python interface to rrdtool?  I've looked around, > and it seems there are several interfaces, but non have been updated > recently. > > If someone could report

Re: pip install error for pinax 0.7.0

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 12:51 AM, over.nine.k wrote: > > after getting easy_install, git, bzr, and pip running in my windows > environment, i run the code to download the pinax external apps > > C:\pinax-0.7.0>pip install --requirement requirements/ > external_apps.txt > > and

Re: Needed: a tidy model for varying numbers of multiple numerical values (page number refs)?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 5:02 AM, Tim Chase wrote: > > Dave E wrote: > > I have some data (page number references) that looks like this: > > > > 320, 387..90, 410, 500 > > > > or (sustituting numerical .. ranges for conventional dashes) > > > > 320, 387-90, 410, 500,

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 7:17 AM, Reiner wrote: > > Hi, > > have a look at the documentation of field options in models: > http://docs.djangoproject.com/en/dev/ref/models/fields/#blank > > class Foo(models.Model): >this_is_required = models.CharField(...) >

Re: Django and SEO activities

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 7:22 AM, Reiner wrote: > > Additionally django comes with a sitemap application in > contrib.sitemaps. > See http://docs.djangoproject.com/en/dev/ref/contrib/sitemaps/ for > more information. > > This should make indexing your website a lot easier

Re: How to get the value of ForeignKey

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 7:24 AM, guptha wrote: > > thanks for your reply > but i cannot solve my problem i will make my question clear this time > > > class BankerCategory(models.Model): >name = models.CharField(max_length=125,unique=True) > created_on =

Re: How to get the value of ForeignKey

2009-03-09 Thread uprising
I don't know if it can be done without extra, maybe something like this (I have not tested it): Homeloan.objects.extra( select={"banker_category": "appname_bankercategory.name"}, tables = ["appname_bankercategory", "appname_banker"], where = ["appname_bankercategory.id =

pyjamas django model/forms integration

2009-03-09 Thread lkcl
i note that there is interest in GWT Django Models / Forms integration, which is something presently being experimented on in pyjamas by some of the users. following on from this:

Re: How to create such a model?

2009-03-09 Thread uprising
Just reminded of a problem by this post, how can I validate a unique pair of nodes like this: class Edge(models.Model): node_a: models.ForeignKey(Node) node_b: models.ForeignKey(Node) I mean if I already have {"node_a": 1, "node_b": 2}, I can't add {"node_a": 2, "node_b": 1} How

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 8:52 AM, uprising wrote: > > Just reminded of a problem by this post, how can I validate a unique > pair of nodes like this: > > class Edge(models.Model): >node_a: models.ForeignKey(Node) >node_b: models.ForeignKey(Node) > > I mean if I

Different Database object behavior on Production and Development servers.

2009-03-09 Thread NoviceSortOf
On the command line I'm unable to get a coherent return on my data object filters or fetches, Instead of getting any detail I get a dictionary with nothing but the words UserProfile, UserProfile object where Field name and value should be. ie. >>>g = UserProfile.objects.filter(email =

Re: Different Database object behavior on Production and Development servers.

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 9:03 AM, NoviceSortOf wrote: > > > On the command line I'm unable to get a coherent return on my data > object filters or fetches, > > Instead of getting any detail I get a dictionary with nothing but the > words UserProfile, > UserProfile object

Re: Different Database object behavior on Production and Development servers.

2009-03-09 Thread Ramiro Morales
On Mon, Mar 9, 2009 at 12:03 PM, NoviceSortOf wrote: > > > On the command line I'm unable to get a coherent return on my data > object filters or fetches, > > Instead of getting any detail I get a dictionary with nothing but the > words UserProfile, > UserProfile object

Re: How to create such a model?

2009-03-09 Thread uprising
Thanks for your fast reply.. You mean unique_together=(node_a, node_b)? No, that's not what I meant. I want to make sure if someone has created Edge(node_a=x, node_b=y).save() he can't add Edge(node_a=y, node_b=x).save() because edge is a set of two distinct nodes. On Mar 9, 8:54 pm, Alex

Re: How to create such a model?

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 9:09 AM, uprising wrote: > > Thanks for your fast reply.. > You mean unique_together=(node_a, node_b)? > No, that's not what I meant. > > I want to make sure if someone has created > Edge(node_a=x, node_b=y).save() > he can't add > Edge(node_a=y,

Re: multiple S3 buckets using David Larlet's S3Storage.py

2009-03-09 Thread David Larlet
Le 7 mars 09 à 05:33, wynfred a écrit : > > David Larlet's Amazon S3 wrapper for Django seems widely used, and I'm > inclined to use it. However, there's something in the documentation > that confuses me: > http://code.welldev.org/django-storages/wiki/S3Storage > > It seems as though one can

Re: ManyToOne : cannot form a proper query :(

2009-03-09 Thread [CPR]-AL.exe
Thanks, but i thought that there's some django-way to do such a thing... is there a way i can add raw SQL query to Q object? That will (perhaps) solve my code design problem On 6 мар, 01:06, creecode wrote: > You can always perform raw SQL queries >

import settings problem

2009-03-09 Thread knight
Hi, I am trying to install django application on CentOS 5 and I'm getting this error, when I go to the admin page: ImportError: Could not import settings 'mx30.settings' (Is it on sys.path? Does it have syntax errors?): No module named mx30.settings my httpd.conf looks like this: LoadModule

Re: Trouble with accents when passing tranlsated string with newforms

2009-03-09 Thread Tipan
> Do you mean they are inserted into the source as "oacute;" and so > the user sees, literally, ""? > Yes. The string has the html code for the accent as you show above. > This could be a bug. Any strings provided by Django itself (and this > includes translated strings, although we don't make

Re: Different Database object behavior on Production and Development servers.

2009-03-09 Thread NoviceSortOf
Ramiro: You put me onto something, the only model that returns coherent data on the command line has str defined for model ie. class Book(models.Model): title = models.CharField(max_length=100) authors = models.ManyToManyField(Author) publisher = models.ForeignKey(Publisher)

Re: forms.ModelForm

2009-03-09 Thread mike171562
thanks malcolm, thats doesnt seem to work though class UserModelForm(forms.ModelForm): class Meta: model = User account = forms.CharField(max_length=50) fields = ('username','email','first_name','last_name','account') adding the 'account' field as extra is not

Re: forms.ModelForm

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 10:10 AM, mike171562 wrote: > > thanks malcolm, thats doesnt seem to work though > > class UserModelForm(forms.ModelForm): >class Meta: >model = User > account = forms.CharField(max_length=50) >fields = >

Overlapping date range test

2009-03-09 Thread gnijholt
Hello django-users, I'm having some trouble with a date-range filter. My goal is to prevent a model from being saved when it's date-range overlaps with existing records. Apparently, the math is quite straightforward: ( start1 <= end2 and start2 <= end1 ) if TRUE, the ranges overlap (*)

With inheritance extended User Model + admin.ModelAdmin = Change Password does not work

2009-03-09 Thread johan.uhIe
Hi, i'm having some problems with the following. Set-Up: I am extending the User Model with inheritance just as descirbed here: http://scottbarnham.com/blog/2008/08/21/extending-the-django-user-model-with-inheritance/ I think it is working pretty well since it is pretty powerfull and

Re: ManyToOne : cannot form a proper query :(

2009-03-09 Thread [CPR]-AL.exe
Oh, nevermind, i figured out how to make nested joins only with q objects! On 9 мар, 17:26, "[CPR]-AL.exe" wrote: > Thanks, but i thought that there's some django-way to do such a > thing... is there a way i can add raw SQL query to Q object? That will > (perhaps) solve my

Re: TemplateSyntaxError on unicode strings

2009-03-09 Thread juanefren
Thanks for your replies, It worked. On Mar 8, 6:16 pm, Malcolm Tredinnick wrote: > On Sun, 2009-03-08 at 18:01 -0700, juanefren wrote: > > Right I would mean 1.1 alpha. Looking with more details I found that > > error only appears when I use my class __str__ method,

Re: forms.ModelForm

2009-03-09 Thread mike171562
Thanks alex, that worked, I have the extra field, and now to figure out how to to tie it in to the main form and my user model. On Mar 9, 10:12 am, Alex Gaynor wrote: > On Mon, Mar 9, 2009 at 10:10 AM, mike171562 wrote: > > > > > > > thanks

Re: forms.ModelForm

2009-03-09 Thread mike171562
To display and edit my extension of the user model in the admin interface I simply add class Admin: list_display = ('account_number','userfield') how can i get this to display in my ModelForm fields? On Mar 9, 10:51 am, mike171562 wrote: > Thanks

Re: forms.ModelForm

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 10:57 AM, mike171562 wrote: > > To display and edit my extension of the user model in the admin > interface I simply add > >class Admin: >list_display = ('account_number','userfield') > > how can i get this to display in my ModelForm

Re: radio button assignment as filter in search

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 11:04 AM, Jesse wrote: > > Hello, > > I have a radio button in template for a search "AND" or "OR" > selection, with the name andor1 values 1 (or) and 2 (and) > > > > In the views.py: > def Bypub(request): >andor1 = request.POST['andor1'] >

a little help on creating a 'global' file

2009-03-09 Thread Julián C . Pérez
hi everyone from colimbia i'm new on django... so far, i love it... i'm very used to php, but the solution with django/python is just awesome i have started a project and i've been catching up with the basics... right now i have 2 doubts... 1. i created a file called 'globalValues.py' in the

Re: a little help on creating a 'global' file

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 11:11 AM, Julián C. Pérez wrote: > > hi everyone from colimbia > i'm new on django... so far, i love it... i'm very used to php, but > the solution with django/python is just awesome > i have started a project and i've been catching up with the basics...

Re: radio button assignment as filter in search

2009-03-09 Thread Jesse
Template: {% for pathology in pathology_list %} {{ pathology.pathology }} {% endfor %} There are actually three search selects(pathology, commodity, technology) The user can do and/or for a mix or match of the three, which is why I need the and/or option in the views.py.

Re: a little help on creating a 'global' file

2009-03-09 Thread Julián C . Pérez
ok alex -and thank for your so quick assistance let's see if i get it -i guess not, because have an syntax error having this in settings.py file: # -- ... TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.auth', 'django.core.context_processors.debug',

Re: a little help on creating a 'global' file

2009-03-09 Thread Briel
Hi and welcome to django. In regards to question 1, it looks like you are missing something. The request object, that you have as parameter in your function, is used in the views.py file. The object has a lot of the info that you need, like the user, the post data if any ect. If you want to make

Need help with combined feed

2009-03-09 Thread bax...@gretschpages.com
I'm trying to build a combined feed, and not having much luck. Here's what I have: class CombinedFeed(Feed): title = site.name +" combined feed" link = "/" description = "Latest updates from all "+site.name +" feeds" description_template = 'feeds/combined.html' def

Re: Overlapping date range test

2009-03-09 Thread Briel
You have a problem with your calculation, if you dont want any overlap at all. The above code will only be true when the intire range of start/end 2 is within start/end 1. what you need to check if you dont want any overlap is these two statements: (start1 <= start2 and end1 >= start2) (start1 <=

Get Current User

2009-03-09 Thread Adam Schmitz
Hey All, I just setup my webapp to use the django user authentication and everything works smoothly so far. The one thing I'm wondering is: after the user logs in, how do you access the user object from another app? The main thing I'm trying to accomplish is I want to save a model with one of

Re: Get Current User

2009-03-09 Thread Briel
You can get the current user through the request object: request.user. If that fails, you need to have if you have AuthenticationMiddleware installed probably. ~Briel On 9 Mar., 17:48, Adam Schmitz wrote: > Hey All, > > I just setup my webapp to use the django user

Re: Get Current User

2009-03-09 Thread Rajesh D
On Mar 9, 12:48 pm, Adam Schmitz wrote: > Hey All, > > I just setup my webapp to use the django user authentication and everything > works smoothly so far. The one thing I'm wondering is: after the user logs > in, how do you access the user object from another app? > > The

Re: Get Current User

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 12:03 PM, Rajesh D wrote: > > > > On Mar 9, 12:48 pm, Adam Schmitz wrote: > > Hey All, > > > > I just setup my webapp to use the django user authentication and > everything > > works smoothly so far. The one thing I'm

Re: radio button assignment as filter in search

2009-03-09 Thread Jesse
The problem is that the python converts the andor value to a character, even though the radio button is presenting it as numeric. I needed to place quotes around the number: if andor == '1' and then it works. Hope this helps someone else. --~--~-~--~~~---~--~~ You

Re: radio button assignment as filter in search

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 12:10 PM, Jesse wrote: > > The problem is that the python converts the andor value to a > character, even though the radio button is presenting it as numeric. > I needed to place quotes around the number: > if andor == '1' and then it works. Hope this

Re: Overlapping date range test

2009-03-09 Thread Rajesh D
On Mar 9, 11:28 am, gnijholt wrote: > Hello django-users, > > I'm having some trouble with a date-range filter. > My goal is to prevent a model from being saved when it's date-range > overlaps with existing records. > > Apparently, the math is quite straightforward: > >

Re: Overlapping date range test

2009-03-09 Thread Rajesh D
On Mar 9, 11:28 am, gnijholt wrote: > Hello django-users, > > I'm having some trouble with a date-range filter. > My goal is to prevent a model from being saved when it's date-range > overlaps with existing records. > > Apparently, the math is quite straightforward: > >

Re: Where to put jquery/dojo js files

2009-03-09 Thread rajeesh
For the time being, I'm using the previous suggestion. I've just heard about dojango earlier and I hope I can try it later. Thanks. On Mar 9, 2:43 pm, Wolfram Kriesing wrote: > Did you try dojango?http://code.google.com/p/dojango/ > Dojango is a reusable django

Re: Caching and logged-in users

2009-03-09 Thread Rajesh D
On Mar 9, 9:11 am, Håkan W wrote: > Hi all, > > I'm a bit confused about the caching. I've started using per-view > caching with the @cache_page decorator. > > Now, if I add this to pages that return private content to logged-in > users, will it do the right thing and not

Re: config dev server for static media

2009-03-09 Thread Serdar T.
So I'm continuing to look for the source of bugs on this front, and wanted to add a note on a strange PYTHONPATH issue that I've encountered. When I fire up ipython from my project directory (using ./manage.py shell) , the PYTHONPATH includes the following paths for my project:

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 1:06 PM, Serdar T. wrote: > > So I'm continuing to look for the source of bugs on this front, and > wanted to add a note on a strange PYTHONPATH issue that I've > encountered. > > When I fire up ipython from my project directory (using ./manage.py >

Re: a little help on creating a 'global' file

2009-03-09 Thread Julián C . Pérez
ok briel, maybe i should explain myself better you're right about the function with that innecesary 'request' object... but i'd need it for any other function -yet to be implemented -by the way, i use the shortcut render_to_response regarding the html stuff, with the function defined early if i

Not able to select from Oracle view

2009-03-09 Thread Brandon Taylor
Hi everyone, Is there something special I need to know in order to select records from a view in Oracle? My user has select permissions on the schema in question. When I output the SQL from the connection, everything looks in order. I'm using Django trunk, Python 2.6.1 and cx_Oracle-5.0.1 TIA,

Re: a little help on creating a 'global' file

2009-03-09 Thread Briel
The problem you are seeing regarding the link i mentioned briefly in my last post. Django does auto escapingbe default of all template vars and values. In your case that means that you see the html you wrote because the <>" has been converted to a code that will display the signs but disable the

Re: Not able to select from Oracle view

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 2:38 PM, Brandon Taylor wrote: > > Hi everyone, > > Is there something special I need to know in order to select records > from a view in Oracle? My user has select permissions on the schema in > question. > > When I output the SQL from the

Re: Not able to select from Oracle view

2009-03-09 Thread Brandon Taylor
Hi Alex, thanks for the response. I see that Django is trying to select a property that doesn't exist from this view... SELECT "LU_CSU_CODE"."ID", "LU_CSU_CODE"."DEPARTMENT", "LU_CSU_CODE"."TITLE" FROM "LU_CSU_CODE" ORDER BY "LU_CSU_CODE"."DEPARTMENT" ASC There is no field LU_CSU_CODE.ID Here

Re: Not able to select from Oracle view

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 3:06 PM, Brandon Taylor wrote: > > Hi Alex, thanks for the response. > > I see that Django is trying to select a property that doesn't exist > from this view... > > SELECT "LU_CSU_CODE"."ID", "LU_CSU_CODE"."DEPARTMENT", > "LU_CSU_CODE"."TITLE" FROM

Re: config dev server for static media

2009-03-09 Thread Serdar T.
Ok. So are the additional dotted paths being added by the shell in order to search the child directories of my project? It occurred to me after I posted that the second of the three paths ( '/home/user/web/ project/..', ) might map to my static/ or templates/ directories, for instance. The third

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 3:12 PM, Serdar T. wrote: > > Ok. So are the additional dotted paths being added by the shell in > order to search the child directories of my project? It occurred to me > after I posted that the second of the three paths ( '/home/user/web/ >

Admin datetime widgets for non-admin users

2009-03-09 Thread jeffhg58
I am in the process of upgrading my site to Django version 1.1. In the previous version of 0.97 I was using the datetime widgets from the admin. But, since I have upgrade the widgets no longer display if the user does not have access to the admin site. When I login as a user who has admin

Re: Caching and logged-in users

2009-03-09 Thread Håkan W
Rajesh, Thanks a lot for taking the time to explain, it helps a lot. /Håkan On Mar 9, 7:02 pm, Rajesh D wrote: > On Mar 9, 9:11 am, Håkan W wrote: > > > Hi all, > > > I'm a bit confused about the caching. I've started using per-view > > caching with

Multiple Select Check Boxes - newbie...

2009-03-09 Thread Mitch Anderson
Hi, I'm new to django and python in general so, I'm not sure if the way I'm doing this is the most correct way. But I'm writing a manager application for FTP... I keep the user accounts in a database and I'm writing the django app to manage it. Anyway, I have three models more or less like

Re: Multiple Select Check Boxes - newbie...

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 4:03 PM, Mitch Anderson wrote: > > Hi, > > I'm new to django and python in general so, I'm not sure if the way > I'm doing this is the most correct way. But I'm writing a manager > application for FTP... I keep the user accounts in a database and I'm

Django session's pickling problem

2009-03-09 Thread Frank.F.Z
Hi there, I've just encountered a strange problem with my django application, wondering if anyone has seen it before. I tried to store an instance of model into session in one of my view functions and got this error:

Re: admin outperforms my view, why?

2009-03-09 Thread rtelep
Oh yeah, Transactions. django.db.transaction.commit_on_success http://docs.djangoproject.com/en/dev/topics/db/transactions/?from=olddocs#django-db-transaction-commit-on-success --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

Re: I can't decide on a migration framework

2009-03-09 Thread Ben Davis
are you saying that django-evolution does not support migrating between "versions" (ie up and down)? I'm mostly trying to get an idea of what migration frameworks django devopers use, and why they prefer it. On Mar 7, 2009 5:31 PM, "Briel" wrote: A fixed migration is the

Re: I can't decide on a migration framework

2009-03-09 Thread Kenneth Gonsalves
On Tuesday 10 March 2009 04:53:25 Ben Davis wrote: > are you saying that django-evolution does not support migrating between > "versions"  (ie up and down)? no > > I'm mostly trying to get an idea of what migration frameworks django > devopers use, and why they prefer it. most do not use

creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-09 Thread Mario Zorz
Hi all Thanks in advance to whomever reads this :) Is it possible in a django view, to take objects from 2 different models, which are related one to the other through a ForeignKey (primary key of one model is foreign key in the other model), make something similar to an SQL JOIN and have the

Dynamically Changing Cache Settings

2009-03-09 Thread Dave Fowler
I'm running Django with memcached on EC2. We frequently turn on or off different servers with memcached running on each. To configure your memcached the docs suggest you list them in your settings file: CACHE_BACKEND = 'memcached://172.19.26.240:11211;172.19.26.242:11211/' The only problem

Re: creating a join of 2 models in a view, and accessing such an object collection in a template

2009-03-09 Thread Malcolm Tredinnick
On Mon, 2009-03-09 at 18:04 -0700, Mario Zorz wrote: > Hi all > > Thanks in advance to whomever reads this :) > > Is it possible in a django view, to take objects from 2 different > models, which are related one to the other through a ForeignKey > (primary key of one model is foreign key in the

Re: Dynamically Changing Cache Settings

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 8:31 PM, Dave Fowler wrote: > > I'm running Django with memcached on EC2. We frequently turn on or > off different servers with memcached running on each. > > To configure your memcached the docs suggest you list them in your > settings file: > >

Re: config dev server for static media

2009-03-09 Thread Serdar T.
OK. So for posterity's sake, I wanted to note that I solved this problem, and it was completely my own embarrassingly stupid oversight (is there a Jargon acronym for telling yourself to read your own source more closely?). The problem was not the project layout or Django code, but the link in

Re: Dynamically Changing Cache Settings

2009-03-09 Thread Dave Fowler
Thanks, I'm currently under mod_python... maybe I should switch. On Mar 9, 8:33 pm, Alex Gaynor wrote: > On Mon, Mar 9, 2009 at 8:31 PM, Dave Fowler wrote: > > > I'm running Django with memcached on EC2.  We frequently turn on or > > off different

Re: config dev server for static media

2009-03-09 Thread Alex Gaynor
On Mon, Mar 9, 2009 at 8:43 PM, Serdar T. wrote: > > OK. So for posterity's sake, I wanted to note that I solved this > problem, and it was completely my own embarrassingly stupid oversight > (is there a Jargon acronym for telling yourself to read your own > source more

Re: I can't decide on a migration framework

2009-03-09 Thread Russell Keith-Magee
On Tue, Mar 10, 2009 at 8:23 AM, Ben Davis wrote: > are you saying that django-evolution does not support migrating between > "versions"  (ie up and down)? Django Evolution doesn't currently support down-migrations. This isn't due to any particular technical limitation -

  1   2   >