Re: PyDev create new project wizard creates two folders in Aptana Studio 3?

2010-10-05 Thread Brandon Taylor
Hi Guys, Yeah, I've just been creating projects by hand instead of using the new PyDev Django actions. Fabio said it's because the project you create has to be added to the Python Path, and it can't add a folder that is above the path for some reason. Annoying. Cheers, Brandon On Oct 5, 3:35 

Confused about testing a page protected with @login_required

2010-10-05 Thread Brandon Taylor
Hi everyone, I set up a bare-bones project with one view decorated with @login_required. I created an initial_data.json fixture with a user. I called self.client.login(username='foobar', passowrd='foobar') and it returned True. I assigned a response variable from self.client.get('/protected/')

Getting to manytomany objects from a form in the view, before saving to the database

2010-10-05 Thread chefsmart
(FYI - this is also on stackoverflow, awaiting answers) For the following models: - class Item(models.Model): name = models.CharField(max_length=150) value = models.DecimalField(max_digits=12,decimal_places=2) class Organization(models.Model): name = models.CharField(max_length=150)

unit test :how to call a single test method alone

2010-10-05 Thread jimgardener
hi In my application,I have the following structure for tests myapp---__init__.py | | tests- __init__.py #contains from functional import * from utility import * | | functional - __init__.py | -utility__init__.py #from myutil_tests import *

Re: Where to create a Mezzanine project

2010-10-05 Thread Stephen McDonald
For anyone who comes along at a later point looking for an answer to this, it was provided on the mezzanine-users mailing list. http://groups.google.com/group/mezzanine-users/browse_thread/thread/c8b13c41a3168c94 Cheers, Steve On Oct 5, 7:37 am, Sithembewena Lloyd Dube

inner join and only method

2010-10-05 Thread refreegrata
Hello list. I'm have a questio. if I have an "inner join" query an use an "only" restriction, how can i put a field of the second table in the "only" tuple? Example: Model - class Abc(models.Model): fk_user = models.ForeignKey(User, related_name='user_pp') fk_ee =

Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
Ok, so I'm pretty sure this has to do with the fact that the post_reset_redirect argument defaults to the django.contrib.auth.views.password_reset_done if no post_reset_redirect is passed to the view. I am using django- registration and it seems like there would be a better way to deal with

Re: admin site not working, problem with urls.py?

2010-10-05 Thread Sandro Dutra
You have to check if you enable the "admin" application on your settings.py. 2010/10/5 Sithembewena Lloyd Dube > Hey Lisa, > > Look at this line (supplied by you): > > > # (r'^ccu/', include('ccu.foo.urls')), > > ^^ the line above is correct. > > Now, the line that's giving

Re: admin site not working, problem with urls.py?

2010-10-05 Thread Sithembewena Lloyd Dube
Hey Lisa, Look at this line (supplied by you): # (r'^ccu/', include('ccu.foo.urls')), ^^ the line above is correct. Now, the line that's giving you trouble is: (r'^admin/', include(admin.site.urls)), ^^ spot the difference? I think you should use quotes around your argument to the include

Re: admin site not working, problem with urls.py?

2010-10-05 Thread Tran Cao Thai
hope this helps : http://botland.oebfare.com/logger/django/2009/2/14/15/ The conversation is very funny also :D On Wed, Oct 6, 2010 at 9:01 AM, Lisa wrote: > Hi all, > I'm sure I have a pretty simple problem... > here's my url.py file > > from

admin site not working, problem with urls.py?

2010-10-05 Thread Lisa
Hi all, I'm sure I have a pretty simple problem... here's my url.py file from django.conf.urls.defaults import * # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() urlpatterns = patterns('', # Example: # (r'^ccu/',

Re: What's the best way to implement project permissions in a project management app?

2010-10-05 Thread tracul
On Oct 5, 3:32 am, Stodge wrote: >  What's the best way to implement project permissions in a project > management app? Should I just create the concept of membership and > have a function is_member on the project model? You could create a group for each project , and include

Re: Django Registration password reset problem

2010-10-05 Thread Steve Holden
On 10/5/2010 4:45 PM, Joel Klabo wrote: > Need to bump this, sorry. I don't get it. > > On Oct 5, 1:04 pm, Joel Klabo wrote: >> This is the error and location of the problem:http://gist.github.com/612210, >> I can't see what it's looking for. It seems like I could hard code

Re: Django Registration password reset problem

2010-10-05 Thread Joel Klabo
Need to bump this, sorry. I don't get it. On Oct 5, 1:04 pm, Joel Klabo wrote: > This is the error and location of the problem:http://gist.github.com/612210, > I can't see what it's looking for. It seems like I could hard code the > arguments it wants into the reverse() but

Re: PyDev create new project wizard creates two folders in Aptana Studio 3?

2010-10-05 Thread Sandro Dutra
When you try to create a project, Aptana duplicates the root directory automatically. A issue... To correct this, you only have to observe the path when you're creating the Django project. 2010/10/2 payala > > Check if you are in the python perspective > > On 1 oct, 19:34,

django accounts/login page looping

2010-10-05 Thread Cesar Devera
hi, I'm using django' standard auth system, and decorating my views with @user_passes_test(lambda u: u.is_staff) or something alike. everything works fine 99% of the time, but sometimes, one day when I get back to my application, I go to the login page, type my correct username and correct

Django Registration password reset problem

2010-10-05 Thread Joel Klabo
This is the error and location of the problem: http://gist.github.com/612210, I can't see what it's looking for. It seems like I could hard code the arguments it wants into the reverse() but that doesn't seem like the correct way to do it. Any advice? -- You received this message because you are

Django regroup not working as expected

2010-10-05 Thread Gath
Guys I have the following view in my django application def ViewSale( request ): salecur = Sale.objects.filter(user=2).order_by('sale_date') return render_to_response('myapp/sale.html',{'salecur':salecur}) my template looks like this {% regroup salecur by sale_date as sale_list %}

Re: treating different versions of website urls as one

2010-10-05 Thread Steve Holden
On 10/5/2010 1:35 PM, harryos wrote: > The user can enter a website address which will be tracked by the > program for certain info and then a message is sent to the user's > mail.The user can enter many such addresses.The problem is that he > may accidently enter different variations of the

Re: treating different versions of website urls as one

2010-10-05 Thread ringemup
Part of your problem will be that there is no way to consistently determine whether the addresses are duplicate. In most cases, yes, www.example.com and example.com are the same site -- but in some they're not. Ditto for index.html, index.php, etc. (yes, I've seen sites where index.html and

Re: What's the best way to implement project permissions in a project management app?

2010-10-05 Thread Stodge
Thanks. I just found django-authority. That might work. http://packages.python.org/django-authority/ On Oct 5, 11:47 am, Godshall wrote: > I would recommend looking at the projects app in Pinax for a good > approach for >

Re: treating different versions of website urls as one

2010-10-05 Thread harryos
The user can enter a website address which will be tracked by the program for certain info and then a message is sent to the user's mail.The user can enter many such addresses.The problem is that he may accidently enter different variations of the url..and if I don't validate it for duplicates

Re: treating different versions of website urls as one

2010-10-05 Thread ringemup
Is this for request routing, or for data input processing? On Oct 5, 12:17 pm, harryos wrote: > hi > I am trying out a web app where it needs to process user given website > addresses .My problem is that ,I need to treat >  http://mysite.com,www.mysite.com, >

Re: treating different versions of website urls as one

2010-10-05 Thread Steve Holden
What about www.mysite.com/default.asp? It might be helpful if you could give us a little more insight into the real requirement here, rather than a technical question based on some interpretation of the requirement. regards Steve On 10/5/2010 12:57 PM, Alec Shaner wrote: > Definitely sounds

Re: treating different versions of website urls as one

2010-10-05 Thread Alec Shaner
Definitely sounds like a regular expression is what you need. Not sure what you mean by etcare you saying any variation of a web address for mysite.com, i.e., with or without www prefix, with our without protocol http://, and with our without the index page, which itself could be any

Re: treating different versions of website urls as one

2010-10-05 Thread Michel Thadeu Sabchuk
Why not redirect all variants to http://mysite.com/? Nginx could do the job for you ;) Best regards. On 5 out, 13:17, harryos wrote: > hi > I am trying out a web app where it needs to process user given website > addresses .My problem is that ,I need to treat >  

treating different versions of website urls as one

2010-10-05 Thread harryos
hi I am trying out a web app where it needs to process user given website addresses .My problem is that ,I need to treat http://mysite.com , www.mysite.com, mysite.com, www.mysite.com/index.html, www.mysite.com/index.php ...etc as the same and not different urls.How can I do the validation in

Re: What's the best way to implement project permissions in a project management app?

2010-10-05 Thread Godshall
I would recommend looking at the projects app in Pinax for a good approach for this: http://github.com/pinax/pinax/blob/master/pinax/apps/projects/models.py Basically, it uses a ManyToMany "members" field that you can add and remove users to/from the project. That particular example uses an

Re: unique constraint

2010-10-05 Thread Shawn Milochik
I think your model should have a foreign key to User, and the user field in your model should be set by the time you're doing this validation. That makes more sense and is also a lot easier to do. Shawn -- You received this message because you are subscribed to the Google Groups "Django

Re: unique constraint

2010-10-05 Thread mark jason
thanks for the reply Shawn, the reason why I am not using ModelForm is in the clean_url() I am using this validation url=self.cleaned_data['url'] user_given_urls=[x.url for x in MyModel.objects.filter(creator_of_entry=self.instance.creator_of_entry)] if url in user_given_urls: raise

Re: Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
I've made as minimal a complete demonstration of this as possible, to try and work out where I'm going wrong: http://github.com/philgyford/django-commentstest/ It works fine: comments can successfully be disabled on a per-Entry basis. But, if you add "from weblog.models import Entry" to either

Re: newbie error

2010-10-05 Thread Daniel Roseman
On Oct 5, 12:52 pm, chocolatero wrote: > Hi Friends! I'm working with django and i have this error: > > Request Method:         GET > Request URL:    http://127.0.0.1:8000/myapp/New_page/ > Django Version:         1.2.3 > Exception Type:         ValueError > Exception Value: > >

Re: Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
I've investigated further and... it's very strange. I've got a version of my custom comments framework, with enable_comments moderation, working fine. Here are the contents of my working customcomments/forms.py and customcomments/models.py: http://dpaste.com/253382/ However, if I add "from

Re: unique constraint

2010-10-05 Thread Shawn Milochik
Why not just use a ModelForm? You can override the form's clean() or add a clean_url() method. You'll be able to use self.instance to get the model instance of the model form, and from that you can get the previously-used URLs. Shawn -- You received this message because you are subscribed

Re: newbie error

2010-10-05 Thread Xavier Ordoquy
Hi, New_page isn't a valid ID. By default, the id field is a number. Regards, Xavier. Le 5 oct. 2010 à 13:52, chocolatero a écrit : > Hi Friends! I'm working with django and i have this error: > > Request Method: GET > Request URL: http://127.0.0.1:8000/myapp/New_page/ > Django

Re: What's the best way to implement project permissions in a project management app?

2010-10-05 Thread Stodge
That looks like what I need. Thanks. Though I also need per-project permissions; so user 'bob' can access tickets on Project A but not on Project B. I'll have to re-read django-todo's code when I have more time to see if they implement per group permissions. On Oct 4, 9:03 pm, Mike Dewhirst

newbie error

2010-10-05 Thread chocolatero
Hi Friends! I'm working with django and i have this error: Request Method: GET Request URL:http://127.0.0.1:8000/myapp/New_page/ Django Version: 1.2.3 Exception Type: ValueError Exception Value: invalid literal for int() with base 10: 'New_page' Exception Location:

Re: Django Tutorial

2010-10-05 Thread Paul Msegeya
[image: Learning Website Development with Django (From Technologies to Solutions)] [image: Buy] *Learning Website Development with Django (From Technologies to

Re: Where to create a Mezzanine project

2010-10-05 Thread Sithembewena Lloyd Dube
Hi Ken, Thought so too. I guess I am trying to figure out if I could have a nested project (mezzanine) inside my Django project? On Tue, Oct 5, 2010 at 1:04 PM, Kenneth Gonsalves wrote: > On Tue, 2010-10-05 at 12:43 +0200, Sithembewena Lloyd Dube wrote: > > I have installed

Re: Where to create a Mezzanine project

2010-10-05 Thread Kenneth Gonsalves
On Tue, 2010-10-05 at 12:43 +0200, Sithembewena Lloyd Dube wrote: > I have installed Mezzanine and would like to know where in my main > Django > project I should run mezzanine-project. Is it recommended to create > the > mezzanine-project inside the Django project, or outside it? > > The

Where to create a Mezzanine project

2010-10-05 Thread Sithembewena Lloyd Dube
Hi all, I have installed Mezzanine and would like to know where in my main Django project I should run mezzanine-project. Is it recommended to create the mezzanine-project inside the Django project, or outside it? The mezzanine project will integrate blogs in the main Django project. Thanks,

Customising comment framework and keeping moderation working

2010-10-05 Thread Phil Gyford
Hi, I can't get my extended version of django.contrib.comments to take notice of moderation. If I use the standard comments framework, then my subclass of CommentModerator does the job - I've just used it to define enable_field, and this allows or prohibits comments as expected. But if I switch

Re: convert list into a comma separated string

2010-10-05 Thread Sam Lai
On 4 October 2010 21:41, ashy wrote: > Hi All, > > I am writing a django function in which I have a following list: > li = ['a','b','c'] > I want to create a string from the list which should look like > str = 'a,b,c' > > I plan to pass this string to not in () function of

Re: unique constraint

2010-10-05 Thread mark jason
I tried this by making a separate form and adding clean_field() method. class MyDataForm(forms.Form): url=forms.URLField() def __init__(self,formdata,request,*args,**kwargs): forms.Form.__init__(self,formdata, *args, **kwargs) self.user=request.user def

Re: urls and form

2010-10-05 Thread Tonton
On Mon, Oct 4, 2010 at 3:20 PM, Tonton wrote: > hello > > i use this form to have a choice list and change to another on select > > > > {{carte.titre}} > {% for carte in latest_carte_list %} > {{carte.titre}} >