Re: Passing arguments on redirect (Django 1.1)

2009-09-30 Thread Daniel Roseman
On Sep 30, 5:05 pm, Matt wrote: > I'm using the redirect() function provided in Django > 1.1:http://docs.djangoproject.com/en/dev/topics/http/shortcuts/#django.sh... > > I have a view: > my_editing_view(request, id, args={}) > > for which the URL is: > url(r'^/edit/(?P.+)$', 'views.my_editing_vi

Re: Pass a non-pickable object in between pages without using the session

2009-09-30 Thread Daniel Roseman
On Sep 30, 4:59 pm, Gabriel Rossetti wrote: > Hello everyone, > > how can I pass an object in between pages without using the session? The > problem is that the object can be pickled so it can be put in a session, > any ideas? > > Thank you, > Gabriel Why can't it be pickled? Clearly, since ever

Re: Queryset.delete() - docs missing?

2009-09-30 Thread Daniel Roseman
On Sep 30, 9:17 pm, ringemup wrote: > From [1]: > > "You can also delete objects in bulk. Every QuerySet has a delete() > method, which deletes all members of that QuerySet." > > This suggests that there is a Queryset.delete() method for bulk > deletion, but this method is not documented at [2].

Re: {% for articles in article_list %}

2009-10-01 Thread Daniel Roseman
On Oct 1, 11:56 am, Matt wrote: > How do you add an article to that? I mean put some python and django > code down so I can understand it but, here's what I think it might be: > > example.py > > #!C:/Python/python > > import datetime > > today = datetime.datetime.today() > > class article_list():

Re: form and related inline formset on same page

2009-10-01 Thread Daniel Roseman
On Oct 1, 3:09 pm, kurak wrote: > Hello, > How can I render new form for object X and inline formset for model Y > (with foreign key to X) on the same- the same way it's done in django- > admin. > > I've been struggling with it for a while, I tried to render form and > formset separately but it w

Re: select_related() and Additional keywords

2009-10-02 Thread Daniel Roseman
On Oct 2, 11:45 am, Maksymus007 wrote: > I used query in form > > a = X.objects.select_related('gate__keywords_set').filter(field=value) > > and then tried to get elements from related > a[x].gate.keywords_set - there is a RelatedManager object which forces > me to call all() method to get elemen

Re: Exception while rendering after installing contrib.comments

2009-10-03 Thread Daniel Roseman
On Oct 3, 6:23 pm, guillermooo wrote: > Inside django.contrib.comments there is: > > 1) a folder named "url" with an __init__.pyc file > 2) a file named "url" with a few urls > > I've solved the problem renaming the "url" folder to "url_". > > Maybe this is a bug? > > Regards, > > Guillermo This

Re: decoupled url confs- can't reach admin page now

2009-10-04 Thread Daniel Roseman
On Oct 5, 2:27 am, Christophe Pettus wrote: > On Oct 4, 2009, at 6:21 PM, Ross wrote: > > > Could the problem be > > that I have not written views for everything that the urlconf > > references? > > Precisely.  The documentation that Karen Tracey mentions discusses this: > >        http://docs.dj

Re: accessing media_url in javascript

2009-10-05 Thread Daniel Roseman
On Oct 5, 10:34 pm, "neri...@gmail.com" wrote: > I was interested in finding out how I would go about accessing django > vars in my javascript file i.e., media_url within javascript. Do I > need to use a serializer to achieve this? > > Thanks, > > Jason Just put a script element in your Django t

Re: Architecture with multiple applications, context processors, utility methods

2009-10-05 Thread Daniel Roseman
On Oct 5, 9:58 pm, davisd wrote: > I have a question concerning django architecture with multiple > applications and combined views. > > A View accepts an HttpRequest and returns an HttpResponse. > > The flow for a view is: HttpRequest in from the visitor -> process -> > HttpResponse out to visit

Re: Unit Testing in Django.

2009-10-06 Thread Daniel Roseman
On Oct 6, 11:55 am, veasna bunhor wrote: > Do you know how to use unit testing in django ? Could you please give me an > example? > > Thanks in advanced, http://docs.djangoproject.com/en/dev/topics/testing/ -- DR --~--~-~--~~~---~--~~ You received this message bec

Re: Getting model's ID in save() method

2009-10-06 Thread Daniel Roseman
On Oct 6, 6:28 pm, Aaron wrote: > On Oct 6, 2:09 pm, Karen Tracey wrote: > > > Yes, you'll have to save the change to the DB.  But note if you were called > > with force_insert=True you do not want to call the superclass save with > > force_insert=True twice. > > OK.  Would calling "super(MyMode

Re: Form processing using bash script

2009-10-06 Thread Daniel Roseman
On Oct 6, 6:01 pm, Carlos Gustavo wrote: > Hi Everyone, > > I am Django newbie and the experience has been exciting. > > I want some help with the ff. challenge I am now facing: > > How can I get a Django form to process a bash script executing a bunch of C > programs running on linux. > > Any po

Re: How to wrap SQL in Django ORM

2009-10-06 Thread Daniel Roseman
On Oct 6, 4:49 pm, Geobase Isoscale wrote: > Hi all, > Firstly, I'm looking  for modules and folders that supports ORM (object > relation mapper ) that will enable me to extend the functionality of Django > to enable me wrap SQL statements to result with database triggers and > views. Not sure w

Re: problems subclassing models

2009-10-08 Thread Daniel Roseman
On Oct 8, 4:05 pm, Chris Withers wrote: > Hi All, > > I have a set of models that all have the same implementation for a > method, so I thought I'd create a base class for these: > > class UrlModel(models.Model): >      def get_absolute_url(self): >          return reverse(index,kwargs=dict(fk=se

Re: Quick syntax query - translating a piece of API code for use in a django view

2009-10-09 Thread Daniel Roseman
On Oct 9, 9:06 am, Eva Hamilton wrote: > Oops, sorry, that's a typo in the post - but not present in the actual > code. > > It should have read... > > world = Species.objects.all.select_related() No, it shouldn't. Compare your original: > > > >>> world = Species.objects.all().select_related()

Re: Subclassing RegistrationForm in django-registration

2009-10-09 Thread Daniel Roseman
On Oct 9, 11:03 am, "british.assassin" wrote: > Hi, > > I am trying to add some more fields for new members to fill in on > registration to my site by subclassing the RegistrationForm from the > django-registration app. My question is: is there away to do > something like this for saving: > > cl

Re: Cannot import other model

2009-10-09 Thread Daniel Roseman
On Oct 9, 1:01 pm, Christian Wittwer wrote: > > from shcbelpa.season.models import Game > > This is the line of code that generates the error right? > > Is myapp = shcbelpa ? > > Yes, exactly. I forgot to replace.. > Any idea why the import doesn't work? Most likely you have a circular dependenc

Re: Xampp and django

2009-10-10 Thread Daniel Roseman
On Oct 10, 3:43 pm, djbahati wrote: > Hi All, > Am new to django, > am developing application but i face a problem in displaying template. > The browser does not display any template it just display plain text. > am using django 1.1 and xampp 1.7.1. Any idea? http://docs.djangoproject.com/en/dev

Re: Newbie: Trouble getting "import django" to run on Mac OSX 10.5.8

2009-10-10 Thread Daniel Roseman
On Oct 10, 4:01 pm, dbakerweb wrote: > I have gotten to the point where I want to test my install of Django. > I run "import django" and get the "No module named django" error. I > suspect it is a path issue but I've not been able to understand any > googled results for fixing path issues. I am a

Re: Paging, 0-50, 51-100, 101-132

2009-10-11 Thread Daniel Roseman
On Oct 11, 9:22 am, The Danny Bos wrote: > Heya, thanks for all the help of late, I'm about four late nights from > finishing my first big app I'm guessing. > > Anyway, > I'm working on paging in my app and am completely stuck (again), > here's what I'm trying for: >          eg:http://www.domain

Re: Xampp and django

2009-10-11 Thread Daniel Roseman
On Oct 11, 9:05 am, Denis Bahati wrote: > Thanx a lot for the information, but i managed to get it working before this > information. > I have another problem that the __unicode()__ is not working. It just gives > me Poll object instead of the name of data from the database, i put the > function

Re: Require reverse foreign key

2009-10-11 Thread Daniel Roseman
On Oct 11, 12:38 pm, Kristaps Kūlis wrote: > There can be multiple associated Model2 objects to Model1, but without one > Model2  Model1 cannot exist. > > Kristaps Kūlis The best bet is to define custom validation for your inline formset, to ensure that there's at least one valid entry. class

Re: admin url error

2009-10-12 Thread Daniel Roseman
On Oct 12, 11:28 am, A_Swtos wrote: > I'm new in django and i try to do what tutorial says about activating > the admin site but i take the following error: > > IndentationError at /admin/ > ('unexpected indent', ('/home/sotathan/mysite/../mysite/urls.py', 4, > 1, ' from django.contrib import adm

Re: Commercial Photo App?

2009-10-12 Thread Daniel Roseman
On Oct 12, 10:33 am, phoebebright wrote: > Are there any django apps suitable for a events photographer who wants > to sell their photos online? I believe Satchmo has the facility to sell downloads as well as physical products. -- DR. --~--~-~--~~~---~--~~ You rec

Re: Rendering - too many values to unpack

2009-10-13 Thread Daniel Roseman
On Oct 13, 3:09 am, LuisC wrote: > Hi!!! > > I am having some trouble trying to output a database record to a > form > > **My form: > class ClientesFIForm(forms.Form): >     ClienteCodigo = forms.IntegerField(label='Codigo Cliente') >     ClienteNombre = forms.CharField(label='Nombre Cliente'

Re: authorization

2009-10-13 Thread Daniel Roseman
On Oct 13, 11:42 am, elminio wrote: > Hi, > > By admin I can choose what users can do with model objects. And what > about certain pages. Do I have to write if in everyone view method (to > check is current user may access given view ? > > Or is there any built in tool that makes it possible to r

Re: django.admin custom action registration not working

2009-10-13 Thread Daniel Roseman
On Oct 13, 11:55 am, DrKJam wrote: > Hi, > > I'm following the advice here :- > > http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/ > > to try and add a custom action to the list display of one of my models in > the admin interface. > > Sadly, as hard as I try, the option is not app

Re: Rendering - too many values to unpack

2009-10-13 Thread Daniel Roseman
On Oct 13, 9:41 pm, LuisC wrote: > Daniel, > .get() was one of the several options I tried before with no > results...  When I use .get() the form only displays the submit > button...  I am asuming that that is because the template is specting > a dictionary and I am only supplying a value... Wh

Re: request.META['REMOTE_USER']

2009-10-14 Thread Daniel Roseman
On Oct 14, 10:29 am, luca72 wrote: > Hello if i use request.META['REMOTE_USER'] i get key error, but if i > use 'REMOTE_HOST' not > can you tell me how to get the user that is authenticate > I use the decorator @login_required and so the user is authenticated > correct? > > Regards > > Luca requ

Re: request.META['REMOTE_USER']

2009-10-14 Thread Daniel Roseman
On Oct 14, 10:39 am, luca72 wrote: > Thanks but have you got idea why i get this error, request.user return > the correct value, but for my understanding also the META > ['REMOTE_USER'] has to give the same value. No, that's not true, and the documentation doesn't say it does. The values in META

Re: check if user has already saved link

2009-10-14 Thread Daniel Roseman
On Oct 14, 10:38 am, grimmus wrote: > Hi, > > I have 2 Models, Link and SaveLink. > > Link allows URL's with title's and descripions to be added to the > site. > SaveLink allows the logged in user to save their favourite links. > > When i output all the links on the page i would like to check if

Re: newbie. need help in validation

2009-10-14 Thread Daniel Roseman
On Oct 14, 10:42 am, Kenneth Gonsalves wrote: > On Wednesday 14 Oct 2009 3:08:00 pm robin nanola wrote: > > > try reading this > >http://www.cotellese.net/2007/12/11/adding-model-field-validation-to-... > >ango-admin-page/ > > I do not think validators exist in django now - that blog post was don

Re: check if user has already saved link

2009-10-14 Thread Daniel Roseman
#x27; from > 'user.has_saved_link:object' > > I think it's an issue with how the objects are being passed to the > tag ? > > I'm a bit of a Noob with all this (as you can probably tell !!) > > Thanks > > On Oct 14, 12:16 pm, Daniel Roseman wrote: &g

Re: Field that's unique across several tables

2009-10-14 Thread Daniel Roseman
On Oct 14, 2:26 pm, Aaron wrote: > I have a bunch of models that each have a field X. I want this X to be > unique not just within a particular model (table) but unique across > several models. So, a model of type A can't have a value for its X if > that value is already in the X of a model of ty

Re: displaying tree data in admin

2009-10-15 Thread Daniel Roseman
On Oct 15, 8:16 am, ev wrote: > May be there were developers solutions? Where should I look for? > Look at the django-mptt project. It implements an efficient algorithm for tree access, and also has some useful libraries that help with displaying trees. You might be able to use one of them. Alt

Re: question about foreign key

2009-10-15 Thread Daniel Roseman
On Oct 15, 1:46 pm, bruno desthuilliers wrote: > On 15 oct, 13:51, jul wrote: > > > Hi, > > > I've got the two models Country and Restaurant shown below. Is there a > > way to directly set a country by instanciating a restaurant with a > > Country instance? Something like: > > > r=Restaurant(nam

Re: ModelAdmin.save_model Not being called

2009-10-15 Thread Daniel Roseman
On Oct 15, 2:58 pm, eka wrote: > Hi all > > I need to override the ModelAdmin save_model and I found out that is > not being called. I checked the documentation where it says how to use > it and the searched around the code to see if there is a call to that > method and can't find any call to sav

Re: validation error depending on widget

2009-10-16 Thread Daniel Roseman
On Oct 16, 2:18 pm, wmstudio wrote: > Hi, > > I have a model containing: > > class Book(models.Model): >     title = models.CharField(max_length=128) >     price = models.DecimalField(max_digits=8, decimal_places=2, > help_text='Please enter the price in $') >     summary = models.TextField(blank

Re: How do I add an incrementing numeric field to a generic list?

2009-10-18 Thread Daniel Roseman
On Oct 18, 3:11 am, jeffself wrote: > I've got a view that returns a generic list. It contains the following > fields: > school, wins, losses, pf, pa, rating > > I want to add a field called rank that assigns the values 1 through > whatever for each of the records returned. Is this possible using

Re: Django production set up woes [Please Help]

2009-10-18 Thread Daniel Roseman
On Oct 18, 6:54 pm, DjangoRocks wrote: > Hi all, > The environment i am using to set up my django project/app on a > production server is as follows: > Ubuntu 9.04, Django 1.02, Python version 2.6.2. > > Mysql, mysqldb, apache2 and php is all set up and good to go. > > I have followed the tutoria

Re: About Django Notify

2009-10-19 Thread Daniel Roseman
On Oct 19, 6:12 am, aju wrote: > Hi > > I installed django-notify. But in that django-notify folder it does > not contain the file notify_user.py. I need this file. Plese send me > the file notify_user.py What do you think this file is supposed to do? What makes you think you need it? -- DR. --~

Re: Best way to generate a local file from a models + views ?

2009-10-19 Thread Daniel Roseman
On Oct 19, 9:41 am, Nicolas Steinmetz wrote: > Re, > > Anybody for helping me in my quest ? > > Nicolas > > On 16 oct, 21:58, Nicolas Steinmetz wrote: > > > > > Hello, > > > I'm building a django app to manage the reverse proxies of my firm. I'm > > at the step where I want to generate configura

Re: Add Request Parameters

2009-10-19 Thread Daniel Roseman
On Oct 19, 5:20 am, Keith wrote: > I'm writing some code that does something like... > > 1. check url for specific information > 2. do some logic based on named group > 3. pass results along on request > > It is easy for me to do this through urls.py for a single request. > However, i want to per

Re: About Django Notify

2009-10-19 Thread Daniel Roseman
On Oct 19, 10:17 am, aju mathew wrote: > Hi Daniel, > > I want to create a forum application using djangobb. > > For this it need django-notify, openauth etc. > > I install all these and specified in the INSTALLED_APPS in settings.py > > Inside openauth views.py It calls the methods in notify_use

Re: JOINs with Django ORM

2009-10-19 Thread Daniel Roseman
On Oct 19, 4:17 pm, Tomasz Zieliński wrote: > Say I have Object model, which has ObjectRevision-s (ObjectRevision > has ForeignKey to Object). I want to fetch from database all latest > ObjectRevision-s. In SQL I can do it like this: > > SELECT r1.some_data > FROM objectrevision r1 > LEFT OUTER J

Re: JOINs with Django ORM

2009-10-19 Thread Daniel Roseman
On Oct 19, 5:25 pm, Tomasz Zieliński wrote: > On 19 Paź, 17:52, Daniel Roseman wrote: > > > On Oct 19, 4:17 pm, Tomasz Zieliński > > > It's not clear what you mean by 'all latest ObjectRevisions'. Do you > > mean all Obje

Re: concurrency and threading question

2009-10-21 Thread Daniel Roseman
On Oct 21, 9:28 am, Mike Thon wrote: > I'm new to web programming and I have a basic question about the > design of my Django application.  my application will do some number > crunching on data files uploaded by users.  The data processing will > take from minutes to hours for each job.  I don't

Re: installing Django on Mac OS 10.6

2009-10-21 Thread Daniel Roseman
On Oct 21, 11:56 am, robin wrote: > I have installed Django on my mac with OS 10.6. It installed just fine > and I was setting up my first project. I then ran python manage.py > syncdb as I am using MySQL, but I got the following errors: > > Traceback (most recent call last): >   File "manage.py"

Re: More than one stackedinline in admin

2009-10-21 Thread Daniel Roseman
On Oct 21, 2:42 pm, Caisys wrote: > Hi, > Suppose i have 3 model classes: > > class model1(model.Models): >     fields . > > class child1(models.Model): >      model1 = models.ForeignKey(model1) > > class child2(models.Model): >      model1 = models.ForeignKey(model1) > > ---

Re: Dreamhost PS installation problems.

2009-10-22 Thread Daniel Roseman
On Oct 20, 2:04 pm, wonderfullyrich wrote: > I'm trying to use a mix between thehttp://wiki.dreamhost.com/Django#Setup > andhttp://webhostingreal.com/content/view/18/1/(which looks slightly > more recent then the wiki) to setup django on a PS server with > Dreamhost.  I'm stuck at the easy_instal

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 6:20 pm, Dhruv Adhia wrote: > Hello, > > Quite a basic question.. I am posting data from Unity, its like name > and score. I want to read the posted data and display it. > > Here is the code that I currently have inside views.py > > def add_score(request): >    response_dict ={} >    i

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 7:19 pm, Dhruv Adhia wrote: > oops that was a typo.. thanks for pointing that out... Yep I see atleast the > html elements getting displayed like those arrows... > > on the views side I didnt get what f4nt meant.. can you show me an example? > You had it right in your reply to him: re

Re: displaying posted data

2009-10-22 Thread Daniel Roseman
On Oct 22, 7:35 pm, Dhruv Adhia wrote: > Allright, I see some progress, so now my views looks like this with that > little modification > > def add_score(request): >    response_dict ={} >    if request.POST: >        name = request.POST['name'] >        score = request.POST['score'] >        has

Re: problem with test client

2009-10-23 Thread Daniel Roseman
On Oct 23, 4:16 pm, Ralph wrote: > I am using Django 1.1 with Python 2.6.1 and have a problem with > testing > views that require a login. I was hoping someone could enlighten me > were > it all goes wrong > > in the setup function of a unit test i am adding a user and create a > test client

Re: Db migration

2009-10-26 Thread Daniel Roseman
On Oct 26, 10:39 am, aju mathew wrote: > Hi > > How can I populate values from a python file to database. > > Is it any commands their for db migration from command prompt. > > -- > Thanks & Regards, > Aju P Mathew What do you mean a 'Python file'? If it's in a Python file, you can use ORM comma

Re: ModelForm - how to post primary key to update existing record?

2009-10-26 Thread Daniel Roseman
On Oct 26, 5:19 am, robinne wrote: > I am noticing that when I load an existing ModelForm into a template, > and I save (POST), I can't seem to get the primary key back in order > to update that specific record. I am starting to head down the path of > formsets...but that is not what I need. I am

Re: Model design

2009-10-26 Thread Daniel Roseman
On Oct 25, 11:47 pm, Caisys wrote: > Thanks but I am not very familiar with forms yet I barely managed to > override the default form. > However, I thought that its ok for the time being since places and > subplaces are not changed frequently so i can live with it for the > time being and move to

Re: static models methods

2009-10-26 Thread Daniel Roseman
On Oct 26, 4:22 pm, Alessandro Ronchi wrote: > I need to create a static method for a model class like this. The line > Settore.objects.all()[0].id gives error  ( > psycopg2.InternalError: current transaction is aborted) when creating > the tables at first syncdb. What's the correct way to do tha

Re: syntax error what am i doing wrong???

2009-10-26 Thread Daniel Roseman
On Oct 26, 10:35 pm, "jon...@cox.net" wrote: > SyntaxError at / > > ('invalid syntax', ('c:\\Users\\Vincent\\Documents\\django_bookmarks\ > \..\\django_bookmarks\\bookmarks\\views.py', 15, 20, 'return Http > Response(output)\n')) > > SCRIPT FROM VIEWS.PY > > from django.http import HttpResponse >

Re: query with field name only known at runtime

2009-10-27 Thread Daniel Roseman
On Oct 27, 10:48 am, James Harrison Fisher wrote: > Hi, > > I've recently come across something that's stumped me.  I am creating > a 'shortcut' function for easier creation of add/edit views.  This > function needs to make a query on a model in the simple form: > > model.objects.get(field_name=v

Re: models.py - __unicode() - Access related object's attributes?

2009-10-27 Thread Daniel Roseman
On Oct 27, 2:49 pm, Victor Hooi wrote: > heya, > > In my models.py, I've got an "Address", as well as an abstract "Trip" > object, and then a "ToTrip", and "ReturnTrip" object that derive from > that. ToTrip and ReturnTrip both contain references to two Address > objects (models.ForeignKey). > >

Re: manage.py syncdb over web?

2009-10-28 Thread Daniel Roseman
On Oct 28, 8:45 am, zayatzz wrote: > Hi. > > I have a problem with django project that is beeing hosting in a > server where i have no shell access... so how can i do syncdb there. > doing mysql dumps in development db and updating hosting mysql is > kinda slow.. > > Is it possible do this run sy

Re: Using django form

2009-10-29 Thread Daniel Roseman
On Oct 29, 6:38 am, Denis Bahati wrote: > Hi all, > I've gone through and successfully made the poll application and I've > begun to play around and tried to change a few things. The first thing > I would like to do is have the user vote without login to django admin. ie > creating my own form wh

Re: Interrelated form fields

2009-10-29 Thread Daniel Roseman
On Oct 29, 4:42 pm, bruno desthuilliers wrote: > (FWIW and IIRC, the appropriate english term is 'Customer' - please > someone correct me if I'm wrong) OK... the French word 'client' maps to both 'client' and 'customer'. A lawyer, doctor, accountant etc would have clients; a shop has customers.

Re: Trouble accessing session data from a template

2009-10-29 Thread Daniel Roseman
On Oct 29, 5:32 pm, Marco wrote: > Hi all, > > I going a little bit crazy that's why I'm posting here ... > > I have a view : > > def index(request): >    request.session['hello'] = 'world !!!' >    print "hello!!!" >    return render_to_response('index.html') > > in this page index.html I have >

Re: debug toolbar problem

2009-11-02 Thread Daniel Roseman
On Nov 1, 9:27 pm, "bax...@gretschpages.com" wrote: > I finally installed the django debug toolbar, which looks like a very > nice piece of work, but it's not reporting sql queries for me. Every > page: 0 queries, 0 seconds. > > Any suggestions on where the problem may lie? Have you added the De

Re: Django Admin Template Directory

2009-11-03 Thread Daniel Roseman
On Nov 3, 11:38 am, sridharpandu wrote: > Hi > > I am reading the second part of the Django tutorial on the Django > website. The Tutorial mentions that I should copy the base_site.html > page from "django/contrib/admin/templates" to an Admin directory under > my HOME directory. The problem is I

Re: Deploying Django to production environment

2009-11-04 Thread Daniel Roseman
On Nov 4, 4:19 am, JohnL wrote: > Hi All, > > I just joined linode and followed there instructions in setting up > Django athttp://library.linode.com/lamp-guides/ubuntu-9.10-karmic/. > > >      ServerAdmin squ...@bucknell.net >      ServerName bucknell.net >      ServerAliaswww.bucknell.net >  

Re: User Login in django

2009-11-04 Thread Daniel Roseman
On Nov 4, 4:26 am, Denis Bahati wrote: > Am real need to reinvent the wheel because i have a project which needs to > define some user roles, and enable users to update the status of their own > properties and not the other property. Thanks in advance for any help you > give me. > Then use a Use

Re: uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-04 Thread Daniel Roseman
On Nov 4, 9:50 am, NMarcu wrote: > Hello all, > >    I got an error, and I don't know how to pass on it. I got this > error when I try to use ajax from django templates. > I use this, from jquery: > $('#create-user').click(function() { >                 $( '#test_div' ).load( "{% url test_ajax %}

Re: filter_horizontal

2009-11-04 Thread Daniel Roseman
On Nov 4, 2:50 pm, DavodM wrote: > Hello, > > I have a many to many relationship between 'Projects' and 'Tags' in my > app. > > In the admin screen I would like to be able to use the > filter_horizontal interface for adding/editing from both sides of the > relationship but I can only seem to get

Re: Checkboxes checked when editing a form

2009-11-04 Thread Daniel Roseman
On Nov 4, 3:58 pm, chewynougat wrote: > Hi > > When I want a user to edit a form, I would like previously checked > checkboxes to show as checked. However, they are not showing (just > unchecked checkboxes). Can anyone explain to me why this is? > > Model: > > class GroupOption(models.Model): >  

Re: urls.py generic views and foreign keys

2009-11-04 Thread Daniel Roseman
On Nov 4, 3:34 pm, David wrote: > Hello > > I have just started to learn Django. > > I have setup a Blog model, and an Entry model. I would like to use a > generic view to list all of the entries in a given blog. The url to > this should be /blog-slug/. > > I am unclear how I can bring up all of

Re: Preventing JOIN while checking if a self referencing FK is null

2009-11-04 Thread Daniel Roseman
On Nov 4, 7:22 pm, John Boxall wrote: > Both of these will raise a FieldError: > > people_with_bffs = Person.objects.filter(bbf_id__isnull=False) > people_with_bffs = Person.objects.filter(bbf_pk__isnull=False) > > Cannot resolve keyword 'bbf_pk' into field. Choices are 'bbf'. > > Thanks for the

Re: Collapsible fields

2009-11-09 Thread Daniel Roseman
On Nov 9, 8:47 am, Lars Stavholm wrote: > Hi All, > > I'm looking to implement collapsible fields in a django powered > page, so far with no luck. > > Any hints on the best way of doing it? > > In the mean time, I checked out how it's done in the admin interface, > and came up with a simple test

Re: how to create a faceted browser with Django

2009-11-09 Thread Daniel Roseman
On Nov 9, 4:24 am, SeanB wrote: > Many web sites offer faceted browsing such that a series of categories > can be selected to narrow a large set of records down to a few (or > one). Such interfaces often show how many records match the various > category values, which sometimes helps direct the s

Re: MySQL and 'NoneType object is unsubscriptable' error

2009-11-10 Thread Daniel Roseman
On Nov 10, 1:36 am, Julien Phalip wrote: > Hi, > > I've tried to install MySQL for an existing project, and I'm getting a > strange error (see traceback below). Apparently "self.converter" is > None, but I can't see why. > > I can access the database just fine using the 'mysql' command in the > t

Re: TemplateSyntaxError

2009-11-10 Thread Daniel Roseman
On Nov 10, 12:57 pm, Zeynel wrote: > Hi Tim, > > Yes, I syncdb several times. > > C:\sw\sw>manage.py syncdb > > C:\sw\sw>manage.py sql wkw > > BEGIN; > CREATE TABLE "wkw_school" ( >     "id" integer NOT NULL PRIMARY KEY, >     "school" varchar(200) NOT NULL > ) > ; > CREATE TABLE "wkw_lawyer" ( >

Re: TemplateSyntaxError

2009-11-10 Thread Daniel Roseman
On Nov 10, 3:02 pm, Zeynel wrote: > Thanks. I will try what you suggested. But I am almost there with the > admin, the only thing is I need to change the date format so that it > takes only the year. Now DateField requires month, day and year. I > tried this > > year_graduated = models.DateField(

Re: name 'request' is not defined

2009-11-10 Thread Daniel Roseman
On Nov 10, 7:34 pm, nash wrote: > hi i have defined a function in my view.py > > from django.http import HttpResponse > > class work(request): >         def get(self): >                 return HttpResponse("its working") > > but when i browse to mysite/work i am getting "name 'request' is not > d

Re: name 'request' is not defined

2009-11-10 Thread Daniel Roseman
On Nov 10, 9:32 pm, nash wrote: > hi thanks for the reply i am trying to get django up and running with > googleapp engine as. i understand in django correct me if i am wrong > return is a global variable when a url is matched as defined in the > url.py it calls the class that is matched in views

Re: flatpages not finding site_media

2009-11-11 Thread Daniel Roseman
On Nov 11, 7:50 am, neridaj wrote: > I'm trying to use some flatpages for static content and I don''t > understand why they keep failing to load media files. I have my > template_dirs defined, media_root and media_url - when used in > template does not resolve to media_root i.e., template contain

Re: ModelForm usage

2009-11-11 Thread Daniel Roseman
On Nov 11, 10:04 am, gerhard.oe...@ogersoft.at wrote: > Hello > > I am new to django and try to use the ModelForm paradigma, but can't get the > point ;-(( As the documentation says, the point of a modelform is firstly to validate input from a user and save it to the database, and secondly to dis

Re: flatpages not finding site_media

2009-11-11 Thread Daniel Roseman
On Nov 11, 3:48 pm, neridaj wrote: > On Nov 11, 12:07 am, Daniel Roseman wrote: > > > > Have you set anything up to serve media files? > I have a symbolic link named site_media in my project directory. How does that answer the question? What is serving the

Re: URLs and masking of private objects

2009-11-12 Thread Daniel Roseman
On Nov 12, 9:51 am, Steinar Rune Eriksen wrote: > I have not used Django in external environments before, just Intranet > applications. > > I am wondering how to mask URLs so that object IDs are not shown? > Obviously one would create security on the server to check if a user > has access to view

Re: Problem with ModelFormSet

2009-11-13 Thread Daniel Roseman
On Nov 13, 2:18 pm, ses1984 wrote: > In short, I have been having a hard time getting a ModelFormSet to > save. The formset is created from a queryset, and it's only intended > to edit one field of existing objects. > > After a long string of mistakes and fixes, I'm finally stumped. The > followin

Re: Questions about ContentType generic relations

2009-11-14 Thread Daniel Roseman
On Nov 14, 12:04 am, Continuation wrote: > How do I do queries when ContentType is involved? > > Using the example in the doc > (http://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/#id1 > ) > > class TaggedItem(models.Model): >     tag = models.SlugField() >     content_type = models.Fo

Re: django-tagging causing str error

2009-11-14 Thread Daniel Roseman
On Nov 14, 4:42 am, neridaj wrote: > I'm using django-tagging and I think it's causing an error when I try > to access the admin page. If I comment out the urls that reference > django-tagging views the error goes away. > > from django.conf.urls.defaults import * > from blog.models import Entry, L

Re: Questions about ContentType generic relations

2009-11-15 Thread Daniel Roseman
On Nov 15, 8:13 am, Continuation wrote: > > As the docs show, when you've defined a GenericRelation, querying is > > exactly the same as with a reverse foreign key. So: > > Bookmark.objects.get(tags__tag='django') > > I don't quite understand your use of tags__tag='django' in retrieving > the obje

Re: Questions about ContentType generic relations

2009-11-16 Thread Daniel Roseman
On Nov 16, 8:12 am, Continuation wrote: > > As the docs show, when you've defined a GenericRelation, querying is > > exactly the same as with a reverse foreign key. So: > > Bookmark.objects.get(tags__tag='django') > > A somewhat related question: > > What if instead of having a ForeignKey to Conte

Re: Confirm email by matching on form

2009-11-16 Thread Daniel Roseman
On Nov 16, 2:06 pm, Andy wrote: > Thank you all for your replies.  Karen, both good points.  pjrharley, > I agree with Dennis.  If the user is required to re-type their email > address, then that in combination with Django's simple built in email > validation should be sufficient. > > I am using a

Re: Default sort order in admin

2009-11-16 Thread Daniel Roseman
On Nov 16, 4:31 pm, Zeynel wrote: > Thanks! > > I noticed that using > > class Lawyer(models.Model): >     ... >     ordering = ('last',) > > did not work. > > But this worked > > class Lawyer(models.Model): >     ... >     class Meta: >         ordering = ('last',) > > copied fromhttp://www.djang

Re: problems accessing markdown comments

2009-11-17 Thread Daniel Roseman
On Nov 17, 9:28 am, neridaj wrote: > I can't figure out why my comment vars aren't available in my > template. I'm using django.contrib.markup and when I try to preview > the comments nothing is displayed, however, the comment var is > available in {{ comment|linebreaks }} but not in > {{ comment.

Re: How to use subqueries in django

2009-11-17 Thread Daniel Roseman
On Nov 17, 10:26 am, Radhikavk wrote: > Hi , > > I have 2 tables room_types and room > > the table structure > > class room_types(models.Model): >     room_type_id = models.AutoField(primary_key=True,null=False,blank=False) >     room_type_name = > models.CharField(max_length=100,unique=True,null=

Re: Inline admin objects question

2009-11-18 Thread Daniel Roseman
On Nov 18, 6:46 pm, Wayne wrote: > Hi, > > I am working with a legacy database which does not set foreign key > constraints at all between tables. I am wondering if I can still > create Inline admin interface by relating two objects through > different methods. If it is doable, what is the best wa

Re: Inline admin objects question

2009-11-18 Thread Daniel Roseman
On Nov 18, 10:50 pm, Wayne wrote: > Thanks for your reply. > > My situation is a little bit more tricky. I have table A and table B. > Table B has several columns, two of which are tableID and resourceID. > Table B is related to table A in the following way: > select * from table B where b.tableID

Re: Good way to modify admin list_filter based on is_superuser?

2009-11-20 Thread Daniel Roseman
On Nov 20, 3:26 pm, JHeasly wrote: > In using Simon W.'s "simple example of row-level permissions in the > admin"  (http://www.djangosnippets.org/snippets/1054/), I'm trying to > extend the concept by modifying the 'list_filter' tuple of the > subclassed ModelAdmin based upon the request.user.is_s

Re: Missing attribute on User

2009-11-23 Thread Daniel Roseman
On Nov 23, 8:34 am, Hanne Moa wrote: > On Mon, Nov 23, 2009 at 00:46, Russell Keith-Magee > > > > > > wrote: > > On Mon, Nov 23, 2009 at 1:59 AM, Hanne Moa wrote: > >> I have models M, N, which both have a foreignkey to User. When in the > >> shell/runserver, User has attributes for both M and N

Re: Shortcut to create and update a model object?

2009-11-23 Thread Daniel Roseman
On Nov 20, 8:31 am, "Boris Schaeling" wrote: > Is there a shortcut to create and update a model object from a form? For   > example I'd like to write something like: > > MyModel.objects.create(mymodel_form.cleaned_data) > > or > > model_obj = get_object_or_404(MyModel, pk=id) > model_obj.update(my

<    4   5   6   7   8   9   10   11   12   13   >