Re: IDE for Python/django

2010-09-27 Thread bedros
I'm pretty happy with openkomodo.org Edit.

my favorite feature is allowing me to open and edit file on a remote
server using ssh transparently.

Bedros


On Sep 27, 9:59 pm, girish shabadimath 
wrote:
> Hi all,
>
> Thanks for the replies,,i got bunch of IDEs.. will figure out which is best
> for my work environment
>
> On Tue, Sep 28, 2010 at 7:51 AM, Brandon Taylor 
> wrote:
>
>
>
> > Aptana Studio 2 & 3 Beta + PyDev on Linux makes a great dev
> > environment for Django. You can create runtimes for debugging, add
> > modules to the Python path for your project, like the site-packages
> > folder from a virtualenv.
>
> > You'll get code assist for Python, HTML, CSS and JavaScript. A number
> > of JavaScript libraries like jQuery are also supported. This IDE has
> > served me very well for the past 4 years. It might not have every bell
> > or whistle that PyCharm has, but I feel it has a very well balanced
> > set of features that are easy to customize.
>
> > My $0.02,
> > Brandon
>
> > On Sep 27, 7:01 pm, tayfur yilmaz  wrote:
> > > pycharm is very slow ı think for pycharm is wrote java programming
> > > language..wing ide is best..
>
> > > 2010/9/28 Jason 
>
> > > > PyCharm is pretty amazing but it costs $ after its out of beta. Best
> > > > code completion I've seen for Django.
>
> > > > My ONLY complaint is you can't open up a python console during debug.
> > > > It has a pretty good debugger but seeing as other IDEs have no problem
> > > > here I don't know why they left it out.
>
> > > > Still, I think it's head and shoulders above the rest.
>
> > > > --
> > > > You received this message because you are subscribed to the Google
> > Groups
> > > > "Django users" group.
> > > > To post to this group, send email to django-us...@googlegroups.com.
> > > > To unsubscribe from this group, send email to
> > > > django-users+unsubscr...@googlegroups.com
> > 
>
> > > > .
> > > > For more options, visit this group at
> > > >http://groups.google.com/group/django-users?hl=en.
>
> > > --www.tayfuryilmaz.com
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: possible bug in models using db_column

2010-09-27 Thread Xavier Ordoquy
Hi tom,

There are no reason why your code should work.

>>> shrubentry = shrub(uid_string_id = rootentry.uid_string)
>>> treeentry = tree(uid_string = rootentry.uid_string) 
I hardly see why you are using uid_string_id on the first while using 
uid_string (without the _id) on the second.
If you remove the _id then you'll have to pass a rootentry instead of a string.
So this should be:

>>> treeentry = tree(uid_string_id = rootentry.uid_string) 

Regards,
Xavier.

Le 27 sept. 2010 à 18:21, t...@eyesonic.net a écrit :

> Today, I stumbled over an at first sight strange behaviour using
> models (db). It looks like a bug. I posted the code on stackoverflow:
> 
> http://stackoverflow.com/questions/3805752/possible-bug-in-django-models
> 
> greetings,
> tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Kenneth Gonsalves
On Mon, 2010-09-27 at 22:51 -0400, Steve Holden wrote:
> I'd just like to briefly report back on the inquiries Nancy and I have
> been making into East coast venues for DjangoCon 2011. 

just curious - why a hotel? In India we hold such conferences in
universities/colleges - they provide all facilities free of cost (except
accomodation - although some make their guest houses available for the
VIPs), and in fact, compete with each other to offer hosting. We have
just finished Pycon India where we got three state of art auditoriums
free of cost.
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Kenneth Gonsalves
On Mon, 2010-09-27 at 15:07 +0200, bagheera wrote:
> Dnia 27-09-2010 o 15:00:51 girish shabadimath
>   
> napisał(a):
> 
> > actually i use vim for writing python scripts , i wanted IDE to easy
> my  
> > tasks of writing script (like auto-completion) ,,,i dont want GUI  
> > based,,i prefer  editor like vim which supports python scripts
> 
> GUI based, but lightweight "Geany" IDE is. :) 

geany rocks
-- 
regards
Kenneth Gonsalves

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread girish shabadimath
Hi all,

Thanks for the replies,,i got bunch of IDEs.. will figure out which is best
for my work environment


On Tue, Sep 28, 2010 at 7:51 AM, Brandon Taylor wrote:

> Aptana Studio 2 & 3 Beta + PyDev on Linux makes a great dev
> environment for Django. You can create runtimes for debugging, add
> modules to the Python path for your project, like the site-packages
> folder from a virtualenv.
>
> You'll get code assist for Python, HTML, CSS and JavaScript. A number
> of JavaScript libraries like jQuery are also supported. This IDE has
> served me very well for the past 4 years. It might not have every bell
> or whistle that PyCharm has, but I feel it has a very well balanced
> set of features that are easy to customize.
>
> My $0.02,
> Brandon
>
> On Sep 27, 7:01 pm, tayfur yilmaz  wrote:
> > pycharm is very slow ı think for pycharm is wrote java programming
> > language..wing ide is best..
> >
> > 2010/9/28 Jason 
> >
> >
> >
> > > PyCharm is pretty amazing but it costs $ after its out of beta. Best
> > > code completion I've seen for Django.
> >
> > > My ONLY complaint is you can't open up a python console during debug.
> > > It has a pretty good debugger but seeing as other IDEs have no problem
> > > here I don't know why they left it out.
> >
> > > Still, I think it's head and shoulders above the rest.
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Django users" group.
> > > To post to this group, send email to django-us...@googlegroups.com.
> > > To unsubscribe from this group, send email to
> > > django-users+unsubscr...@googlegroups.com
> 
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/django-users?hl=en.
> >
> > --www.tayfuryilmaz.com
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Олег Корсак
Make conference in eastern europe :)
- Исходное сообщение -
> I'd just like to briefly report back on the inquiries Nancy and I have
> been making into East coast venues for DjangoCon 2011. This is not a
> final answer, simply reassurance that things have actually been
> happening.
> 
> Sadly, New York is out for 2011. Those (very few) venues whose costs are
> low enough are already booked up. Those with space are *much* too
> expensive. If we want to look at a New York DjangoCon US we should
> probably plan at least two years ahead, and still expect it to be quite
> a lot more expensive than Portland (even without factoring in the higher
> cost of eating out and so on in New York).
> 
> Chicago is also quite a lot more expensive than Portland for 2011, so we
> have had to rule that out too. Again, a longer planning time frame
> *might* help.
> 
> We did receive responses from a couple of hotels close to Dulles airport
> where the costs might be acceptable and they do have space for next
> year. Sadly both facilities (and particularly the one whose costs are
> closest to the Doubletree in Portland) are quite isolated (i.e. anything
> else is a cab ride away). This doesn't seem like it would fit with a
> group that enjoys visiting local bars and restaurants.
> 
> We are currently waiting for replies from one or two more hotels more
> "in the thick of things" in the DC area. This would probably mean a bit
> more difficulty getting to the venue from the airports, but it would
> mean that Djangonauts who want to venture out from the hotel would find
> more facilities close by.
> 
> I will let you know more when I hear more. In the meantime, I am
> wondering whether it might be more practical to have a third year at the
> Doubletree in Portland, and adopt a longer time frame for 2012 planning
> for an East coast conference. Feedback on that question would be welcome.
> 
> regards
>   Steve
> 
> PS: When is @alex_gaynor's birthday?
> -- 
> DjangoCon US 2010 September 7-9 http://djangocon.us/
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Django users" group. To post to this group, send email to
> django-us...@googlegroups.com. To unsubscribe from this group, send
> email to django-users+unsubscr...@googlegroups.com. For more options,
> visit this group at http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread David Zhou
Is the bay area right out for cost reasons?

dz

Sent from my iPhone

On Sep 27, 2010, at 8:48 PM, Samuel Baldwin  wrote:

> 2010/9/27 Franklin Einspruch :
>> May I humbly suggest Boston?
>
> Another for Boston.
> --
> Samuel Baldwin - logik.li
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Samuel Baldwin
2010/9/27 Franklin Einspruch :
> May I humbly suggest Boston?

Another for Boston.
-- 
Samuel Baldwin - logik.li

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Steve Holden
On 9/27/2010 11:02 PM, Shawn Milochik wrote:
> > I live on the east coast, but the past two DjangoCons have caused me
> > to fall in love with Portland. It would be a treat for me to get to
> > go there again in 2011.
> >
> > In fact, if it's in Portland next year I plan to make a family
> > vacation of it.
> >
> > So, that's my vote, for whatever it's worth. Hope to see everyone in
> > Portland next year!
On 9/27/2010 11:04 PM, Russell Keith-Magee wrote:
> > I don't have any objections to another year in Portland. It's a great
> > city with great transport and nightlife. If another year in Portland
> > will give us the breathing room to secure better options on the east
> > coast, I'm all for it. It's certainly a more attractive option than a
> > week in an airport Hilton with a cab ride needed for every restaurant
> > trip.
> >
That was my reasoning too. It's not all over yet (there are still
options in Arlington, which is rather more cosmopolitan, that we are
still awaiting replies from) but in the absence of some alternative
which allows us to keep the price within 5-10% of this year it does seem
attractive.

We could then take the opportunity to plan an East coast venue with a
longer time frame, giving us more chance of meeting the community's
parameters.

Atlanta, Orlando and Boston have also been suggested. It will never be
Orlando for me (sorry, I just can't bring myself to like the place as a
conference venue, great as it may be for a family vacation). While the
other two cities might be possibilities for future years I don't think
they are any more likely to be practical for 2011 than Chicago or New
York, and for much the same reasons.

regards
 Steve
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Franklin Einspruch
May I humbly suggest Boston?

- a Bostonian


On Mon, Sep 27, 2010 at 11:00 PM, Joe Casper  wrote:
> How about Atlanta or Orlando?
>
> Sent from my iPhone
>
> On Sep 27, 2010, at 10:51 PM, Steve Holden  wrote:
>
>> I'd just like to briefly report back on the inquiries Nancy and I have
>> been making into East coast venues for DjangoCon 2011. This is not a
>> final answer, simply reassurance that things have actually been happening.
>>
>> Sadly, New York is out for 2011. Those (very few) venues whose costs are
>> low enough are already booked up. Those with space are *much* too
>> expensive. If we want to look at a New York DjangoCon US we should
>> probably plan at least two years ahead, and still expect it to be quite
>> a lot more expensive than Portland (even without factoring in the higher
>> cost of eating out and so on in New York).
>>
>> Chicago is also quite a lot more expensive than Portland for 2011, so we
>> have had to rule that out too. Again, a longer planning time frame
>> *might* help.
>>
>> We did receive responses from a couple of hotels close to Dulles airport
>> where the costs might be acceptable and they do have space for next
>> year. Sadly both facilities (and particularly the one whose costs are
>> closest to the Doubletree in Portland) are quite isolated (i.e. anything
>> else is a cab ride away). This doesn't seem like it would fit with a
>> group that enjoys visiting local bars and restaurants.
>>
>> We are currently waiting for replies from one or two more hotels more
>> "in the thick of things" in the DC area. This would probably mean a bit
>> more difficulty getting to the venue from the airports, but it would
>> mean that Djangonauts who want to venture out from the hotel would find
>> more facilities close by.
>>
>> I will let you know more when I hear more. In the meantime, I am
>> wondering whether it might be more practical to have a third year at the
>> Doubletree in Portland, and adopt a longer time frame for 2012 planning
>> for an East coast conference. Feedback on that question would be welcome.
>>
>> regards
>> Steve
>>
>> PS: When is @alex_gaynor's birthday?
>> --
>> DjangoCon US 2010 September 7-9 http://djangocon.us/
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Art, writing, journal: http://einspruch.com
Comics: http://themoonfellonme.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Russell Keith-Magee
On Tue, Sep 28, 2010 at 10:51 AM, Steve Holden  wrote:
> I'd just like to briefly report back on the inquiries Nancy and I have
> been making into East coast venues for DjangoCon 2011. This is not a
> final answer, simply reassurance that things have actually been happening.
>
> Sadly, New York is out for 2011. Those (very few) venues whose costs are
> low enough are already booked up. Those with space are *much* too
> expensive. If we want to look at a New York DjangoCon US we should
> probably plan at least two years ahead, and still expect it to be quite
> a lot more expensive than Portland (even without factoring in the higher
> cost of eating out and so on in New York).
>
> Chicago is also quite a lot more expensive than Portland for 2011, so we
> have had to rule that out too. Again, a longer planning time frame
> *might* help.
>
> We did receive responses from a couple of hotels close to Dulles airport
> where the costs might be acceptable and they do have space for next
> year. Sadly both facilities (and particularly the one whose costs are
> closest to the Doubletree in Portland) are quite isolated (i.e. anything
> else is a cab ride away). This doesn't seem like it would fit with a
> group that enjoys visiting local bars and restaurants.
>
> We are currently waiting for replies from one or two more hotels more
> "in the thick of things" in the DC area. This would probably mean a bit
> more difficulty getting to the venue from the airports, but it would
> mean that Djangonauts who want to venture out from the hotel would find
> more facilities close by.
>
> I will let you know more when I hear more. In the meantime, I am
> wondering whether it might be more practical to have a third year at the
> Doubletree in Portland, and adopt a longer time frame for 2012 planning
> for an East coast conference. Feedback on that question would be welcome.

I don't have any objections to another year in Portland. It's a great
city with great transport and nightlife. If another year in Portland
will give us the breathing room to secure better options on the east
coast, I'm all for it. It's certainly a more attractive option than a
week in an airport Hilton with a cab ride needed for every restaurant
trip.

Yours
Russ Magee %-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: DjangoCon 2011

2010-09-27 Thread Shawn Milochik
I live on the east coast, but the past two DjangoCons have caused me to fall in 
love with Portland. It would be a treat for me to get to go there again in 
2011. 

In fact, if it's in Portland next year I plan to make a family vacation of it. 

So, that's my vote, for whatever it's worth. Hope to see everyone in Portland 
next year!

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



DjangoCon 2011

2010-09-27 Thread Steve Holden
I'd just like to briefly report back on the inquiries Nancy and I have
been making into East coast venues for DjangoCon 2011. This is not a
final answer, simply reassurance that things have actually been happening.

Sadly, New York is out for 2011. Those (very few) venues whose costs are
low enough are already booked up. Those with space are *much* too
expensive. If we want to look at a New York DjangoCon US we should
probably plan at least two years ahead, and still expect it to be quite
a lot more expensive than Portland (even without factoring in the higher
cost of eating out and so on in New York).

Chicago is also quite a lot more expensive than Portland for 2011, so we
have had to rule that out too. Again, a longer planning time frame
*might* help.

We did receive responses from a couple of hotels close to Dulles airport
where the costs might be acceptable and they do have space for next
year. Sadly both facilities (and particularly the one whose costs are
closest to the Doubletree in Portland) are quite isolated (i.e. anything
else is a cab ride away). This doesn't seem like it would fit with a
group that enjoys visiting local bars and restaurants.

We are currently waiting for replies from one or two more hotels more
"in the thick of things" in the DC area. This would probably mean a bit
more difficulty getting to the venue from the airports, but it would
mean that Djangonauts who want to venture out from the hotel would find
more facilities close by.

I will let you know more when I hear more. In the meantime, I am
wondering whether it might be more practical to have a third year at the
Doubletree in Portland, and adopt a longer time frame for 2012 planning
for an East coast conference. Feedback on that question would be welcome.

regards
 Steve

PS: When is @alex_gaynor's birthday?
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Removing the 'site' (not the website/url) field from django-comments

2010-09-27 Thread EJ
Hi all,

I'm trying to have comments on my sites shown on all other sites, as I
have a 'mobile' skin for my site on a separate domain and site_id.

So for example:
Joe posts a comment on http://www.site1.mydomain.com

Mary goes to http://www.mobilesite.mydomain.com and can see and
respond to Joe's comment.

I'm not highly experienced in Django or programming in general, it
looks like I will need to override some functions and classes such as
BaseCommentNode and some template tags, and remove 'site__pk =  but
I'm not sure which ones or how to do it.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Brandon Taylor
Aptana Studio 2 & 3 Beta + PyDev on Linux makes a great dev
environment for Django. You can create runtimes for debugging, add
modules to the Python path for your project, like the site-packages
folder from a virtualenv.

You'll get code assist for Python, HTML, CSS and JavaScript. A number
of JavaScript libraries like jQuery are also supported. This IDE has
served me very well for the past 4 years. It might not have every bell
or whistle that PyCharm has, but I feel it has a very well balanced
set of features that are easy to customize.

My $0.02,
Brandon

On Sep 27, 7:01 pm, tayfur yilmaz  wrote:
> pycharm is very slow ı think for pycharm is wrote java programming
> language..wing ide is best..
>
> 2010/9/28 Jason 
>
>
>
> > PyCharm is pretty amazing but it costs $ after its out of beta. Best
> > code completion I've seen for Django.
>
> > My ONLY complaint is you can't open up a python console during debug.
> > It has a pretty good debugger but seeing as other IDEs have no problem
> > here I don't know why they left it out.
>
> > Still, I think it's head and shoulders above the rest.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --www.tayfuryilmaz.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Diederik van der Boor
Op maandag 27 september 2010 09:08:53 schreef MrMuffin:
> Where do you put your business logic in django? In my project I`ve put
> it into the models.py, but that file soon become huge and hard to
> maintain. Of course I can just stuff it into whatever file I like, but
> I`d like to have some standard way of doing this. There seems to be
> something missing in django when it comes to business logic. It`s all
> model, views and templates and that`s all great for small projects,
> but both the models.py and views.py very soon gets huge and how do you
> re-organize your project when that happens? Splitting views and models
> into seperate files is only a partial solution and that requires some
> hackish code in __init__.py to make syncdb etc work. And then there`s
> urls.py.

I'm surprised no one mentioned manager classes yet. This is an example for 
models.py:

  from django.db import models
  from yourapp.managers import SomeObjectManager

  class SomeObject(models.Model):
objects = SomeObjectManager()


Now you can do things like: SomeObject.objects.foo() which is defined in your 
manager class. This allows a much better separation of logic and models.

 
> Should there be a better and standardized way to organize huge
> projects in django?

Yes. Making multiple applications. I highly recommend watching this DjangoCon 
video by James Bennett: http://www.youtube.com/watch?v=A-S0tqpPga4

It explains how apps can be made reusable. For example a "blog" application is 
actually not 1 monolythic application, but 8+ tiny apps. User registration and 
account management can also be written as 4+ little apps.

SInce watching that video, my projects are composed by default of 2 apps. A 
"projectname" for the core backend stuff, and a "projectname-site" with the 
templates, settings, and frontend media. This is imho a nicer base to start 
"hooking in" more applications.

More functionality (tagging, rating, accounts, etc.. will all become separate 
apps) which will be hooked in the "projectname-site" project. In case you 
wonder, http://www.djangopackages.com/ gives you quite a wealth of small 
reusable parts that can be hooked in directly.

Greetings,

Diederik

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: is there any certification for Django developers?

2010-09-27 Thread Samuel Baldwin
2010/9/27 nyambaa :
> Is there any certification for Django developers?

Experience.

-- 
Samuel Baldwin - logik.li

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



is there any certification for Django developers?

2010-09-27 Thread nyambaa
Hello dear,

Is there any certification for Django developers?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread tayfur yilmaz
pycharm is very slow ı think for pycharm is wrote java programming
language..wing ide is best..


2010/9/28 Jason 

> PyCharm is pretty amazing but it costs $ after its out of beta. Best
> code completion I've seen for Django.
>
> My ONLY complaint is you can't open up a python console during debug.
> It has a pretty good debugger but seeing as other IDEs have no problem
> here I don't know why they left it out.
>
> Still, I think it's head and shoulders above the rest.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
www.tayfuryilmaz.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Jason
PyCharm is pretty amazing but it costs $ after its out of beta. Best
code completion I've seen for Django.

My ONLY complaint is you can't open up a python console during debug.
It has a pretty good debugger but seeing as other IDEs have no problem
here I don't know why they left it out.

Still, I think it's head and shoulders above the rest.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread bruno desthuilliers


On 27 sep, 17:31, Thomas Weholt  wrote:
> On Mon, Sep 27, 2010 at 4:52 PM, bruno desthuilliers
>

>> ??? Which "django specific magic" ???
>
> I was referring to syncdb. As far as I know, models defined outside
> any models.py or models module won`t be picked up by syncdb, but I
> might be wrong.

s/module/package/ !-)

but there's no "magic" involved here - just a naming convention - and
startapp has nothing to do with it.

> >> It`s obviously not clear to all django users
> >> how to best handle growing projects, split into modules etc
>
> > I can only second Steve on this : time for "Python for Djangonauts"
> > class then. FWIW, I'm amazed at how many persons seem to pick up
> > django without any background in Python.
>
> Hmmm ... do you or Steven know anything about my programming
> background?

Nope, and neither Steve nor I did question your competence. The above
remark was not specifically about you, and was not intended as
criticism FWIW, quite on the contrary. Now I don't think there's that
much Django-specific knowldege involved when it comes to managing a
growing code base, and Django's manual is about Django, not about
Python.

(snip the remaining - Steve already answered better than I could do)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread rafael.nu...@gmail.com
On Linux(Ubuntu) I am loving Aptana Studio 3.

Good performance, and form me that used Eclipse for almost 7 years, it fits
perfectly.

On Mon, Sep 27, 2010 at 3:40 PM, Masklinn  wrote:

> On 2010-09-27, at 16:29 , fcaldera wrote:
> > On 27 Set, 14:52, Masklinn  wrote:
> >> On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
> >>
> >>> is there any IDE for Python/Django ?
> >>
> >> Yes.
> >
> > Could you be less specific, please?
> Probably.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Vim for Python and Django

2010-09-27 Thread flebber
OKay thanks for the tortoisehg link.I get an error when trying to use
the hg command


C:\>hg clone https://trespams-vim.googlecode.com/hg/ trespams-vim
requesting all changes
adding changesets
adding manifests
adding file changes
added 13 changesets with 223 changes to 197 files
updating to branch default
abort: case-folding collision between .vim/syntax/cvsannotate.vim
and .vim/syntax/CVSAnnotate.vim


On Sep 27, 9:46 am, Tran Cao Thai  wrote:
> @flebber: try thishttp://tortoisehg.bitbucket.org/
>
> On Mon, Sep 27, 2010 at 9:28 AM, Mathieu Leduc-Hamel  
> wrote:
> > Anybody know of there's the same kind of resources for emacs ?
>
> > On Sun, Sep 26, 2010 at 7:22 PM, flebber  wrote:
> >> Do the instructions herehttp://code.google.com/p/trespams-vim/wiki/readme
> >> only work on linux ? I tried to follow it on Windows as i wanted to
> >> download and try your version but received this error.
>
> >> C:\>hg clonehttps://trespams-vim.googlecode.com/hg/trespams-vim
> >> 'hg' is not recognized as an internal or external command,
> >> operable program or batch file.
>
> >> C:\>
>
> >> On Sep 27, 2:55 am, ionut cristian cucu  wrote:
> >>> Very helpful, thanks alot!
>
> >>> 2010/9/26 Piotr Zalewa :
>
> >>> >  Hi Antoni,
>
> >>> > Thanks for that!
>
> >>> > zalun
>
> >>> > On 09/26/10 10:36, Antoni Aloy wrote:
> >>> >> Hello all!
>
> >>> >> In this list we have a recurrent thread: "What'ts the best IDE for
> >>> >> Django and Python development?" trespams-vim is my try to answer this
> >>> >> question for people who likes to have a very powerful editor and needs
> >>> >> to have an editor which is able to run in the desktop as well as in a
> >>> >> remote session. I have updated the previous version with delimMate and
> >>> >> easytags, so actually you'll find:
>
> >>> >> * Syntax highlight
> >>> >> * Python autocompletion
> >>> >> * Smart tabbing
> >>> >> * Templates for Python, Django, js, html, ... (just try to edit a
> >>> >> python file and press sbu + tab as an example)
> >>> >> * Add/remove comments on multiple lines
> >>> >> * Tabs
> >>> >> * Surround
> >>> >> * marks
>
> >>> >> etc. etc. :
>
> >>> >> This is a list of my favorite shortcuts
>
> >>> >>http://code.google.com/p/trespams-vim/wiki/readme
>
> >>> >> So, you'll find a collection of plugins and .vimrc settings that I
> >>> >> have found very useful in my day-by-day work in Python and Django.
>
> >>> >>http://code.google.com/p/trespams-vim/
>
> >>> >> Happy coding!
>
> >>> > --
> >>> > blog  http://piotr.zalewa.info
> >>> > jobs  http://webdev.zalewa.info
> >>> > twit  http://twitter.com/zalun
> >>> > face  http://facebook.com/zaloon
>
> >>> > --
> >>> > You received this message because you are subscribed to the Google 
> >>> > Groups "Django users" group.
> >>> > To post to this group, send email to django-us...@googlegroups.com.
> >>> > To unsubscribe from this group, send email to 
> >>> > django-users+unsubscr...@googlegroups.com.
> >>> > For more options, visit this group 
> >>> > athttp://groups.google.com/group/django-users?hl=en.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "Django users" group.
> >> To post to this group, send email to django-us...@googlegroups.com.
> >> To unsubscribe from this group, send email to 
> >> django-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group 
> >> athttp://groups.google.com/group/django-users?hl=en.
>
> > --
> > Mathieu Leduc-Hamel
>
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > django-users+unsubscr...@googlegroups.com.
> > For more options, visit this group 
> > athttp://groups.google.com/group/django-users?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



using both SQL and NonSql (MondoDB) in same project?

2010-09-27 Thread Bill Seitz
I know Django will support multiple SQL databases by just having a
tuple of DATABASES entries in settings.py.

But can I put a single item in DATABASES for a SQL part, and a 'from
mongoengine import connect' section in as well?

I'd like to have users/accounts/payments in SQL, and all my main/
messier stuff in MongoDB

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Client#post returns None for response

2010-09-27 Thread Aljoša Mohorović
i'm trying to test post request using Client from django.test.client
(v1.1.2) but it returns None for response.
target url is a django-piston resource and i can test it normally from
django shell:
>>> h.request(url, "POST", urlencode(data)) # h is httplib2.Http object

but when i try to use Client#post(url, data) i get this:

  File 
"/home/aljosa/Projects/Sites/ozujsko.com/env/lib/python2.6/site-packages/django/test/client.py",
line 317, in post
response = self.request(**r)
  File 
"/home/aljosa/Projects/Sites/ozujsko.com/env/lib/python2.6/site-packages/django/test/client.py",
line 225, in request
response = self.handler(environ)
  File 
"/home/aljosa/Projects/Sites/ozujsko.com/env/lib/python2.6/site-packages/django/test/client.py",
line 73, in __call__
response = middleware_method(request, response)
  File 
"/home/aljosa/Projects/Sites/ozujsko.com/env/lib/python2.6/site-packages/django/middleware/common.py",
line 84, in process_response
if response.status_code == 404:
AttributeError: 'NoneType' object has no attribute 'status_code'


url is relative path (url = "/some/path/") and i can't figure out why
is this happening.
any idea?

Aljosa Mohorovic

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Is this safe? (django.utils.translation.activate)

2010-09-27 Thread ringemup
I picked up a tip on dynamic translation here:

http://fseoane.net/blog/2009/django-change-language-settings-dynamically

Basically, you import "activate" from django.utils.translation, and
use that as necessary to change your active language on the fly
(something I need to do in order to store user languages in the
database because requests are coming from an API that doesn't store
session -- and therefore language -- data).

Does activating a language this way affect *only* the current request,
or can it spill over into other requests?

Is there a better / safer way to do this?

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Makemessages with Templates - Not Working

2010-09-27 Thread Katrina
I am currently translating a project, and many of the strings needing
translation are located in my templates. Unfortunately, the .po files
are not being created when I run makemessages, which I am doing from
my project home using:

./manage.py makemessages -l es -e html,shtml

Makemessages is working for other parts of my project, just not the
templates.

My templates directory is located outside of my project home, but I
have created a locale folder within templates and added it to my
LOCALE_PATHS setting.

I have prepared the templates for translation using the {% load i18n
%} and {% blocktrans %} tags.

What else do I need to do for makemessages to work with my templates?

Thanks,
Katrina

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: problem with saving a form

2010-09-27 Thread Nick Serra
You're just all around doing it wrong. A ModelForm is used so that you
don't have to individually list all the fields you need, it is based
off the model. What is the code for your Model? And also, I'd reread
the form reference from the start.

On Sep 26, 5:25 pm, Marc Aymerich  wrote:
> On Sun, Sep 26, 2010 at 10:15 PM, Marc Aymerich  wrote:
>
> > On Sun, Sep 26, 2010 at 8:51 PM, Marc Aymerich wrote:
>
> >> I'm trying to make a ModelForm in order to edit an existing object of the
> >> class 'member'. So I followed this documentation:
>
> >>http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-sav...
>
> >> # Create a form to edit an existing Article.
> >> >>> a = Article.objects.get(pk=1)
> >> >>> f = ArticleForm(instance=a)
> >> >>> f.save()
>
> >> The form is displayed correctly, however it doesn't work properly, as it
> >> does not save the data neither validate the fields (for instance it does 
> >> not
> >> check the e-mail is an e-mail). It doesn't report any error though, so im
> >> not sure what could have gone wrong.
> >> Can anyone enlighten me?
>
> >> This is my view:
>
> >> @login_required()
> >> def edit_member(request):
> >>     """ edit member information """
>
> >>     Member=member.objects.get(id=request.user.id)
> >>     title = "Edit member " + Member.name
>
> >>     if request.method == 'POST':
> >>         form = MemberForm(request.POST, instance=Member)
> >>         if form.is_valid():
> >>             form.save()
> >>             return HttpResponseRedirect(reverse('list_member'))
> >>     else:
> >>         form = MemberForm(instance=Member)
>
> >>     if request.user.is_authenticated():
> >>         return render_to_response('generic_form.html', locals(),
> >>             context_instance=RequestContext(request))
> >>     return render_to_response('list_member.html', locals())
>
> > It seems that the condition request.method == 'POST' is never true :(
> > whyy??
>
> I tried with a generic view, but it does not save the object nor validates
> the form :( just redirect to post_save_redirect.
>
>     return update_object(request,
>         form_class=MemberForm,
>         object_id=request.user.member.id,
>         template_name='generic_form.html',
>         post_save_redirect=reverse('list_member'),
>         extra_context=dict(title="Edit Memmber " ),
>         login_required=True,)
> --
> Marc

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: notification in python

2010-09-27 Thread Erik Cederstrand

Den 27/09/2010 kl. 19.02 skrev harryos:

> thanks for the pointer
> I am trying to get something similar to changedetection  but with
> hourly updates.
> I need to get updates from a number of sites..So I was wondering how
> to implement an updating utility

You could also try looking at the HTTP headers for a request for e.g. 
"index.htm" using urllib. Specifically the "Expires" and "Last-Modified". This 
would let you ignore e.g. banners and flash content etc. as they are fetched in 
separate requests. If you want to go really lightweight and fast, do a HEAD 
request instead of a plain GET. It's easy to look at the headers a specific 
site is sending with e.g. the Firebug plugin for Firefox.

Using headers values requires that you can trust the site on the header 
content. Web servers and caching proxies can do all sorts of things with the 
headers. Otherwise, saving the hash of the raw HTML (without GIFs etc.) as 
suggested is a good approach. Depending on what your definition of "updated" is.

King regards,
Erik

smime.p7s
Description: S/MIME cryptographic signature


A custom "autoincrement" field type

2010-09-27 Thread Christophe Pettus
Hi,

I'd like to use a UUID as my primary key in a PostgreSQL-backed Django 
database.  As with a serial primary key, I'd like the database rather than 
Django to supply the initial value of the primary key; the primary key field in 
the DB is declared as DEFAULT uuid_generate_v4().  It *almost* works, except 
that Django attempts to INSERT a NULL value into that field, rather than just 
omitting it from the INSERT and getting the field value back.  What am I 
missing?

--
-- Christophe Pettus
   x...@thebuild.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Masklinn
On 2010-09-27, at 16:29 , fcaldera wrote:
> On 27 Set, 14:52, Masklinn  wrote:
>> On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
>> 
>>> is there any IDE for Python/Django ?
>> 
>> Yes.
> 
> Could you be less specific, please?
Probably.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Antoni Aloy
>>
>> 2010/9/27 João Rodrigues 
>>>
>>> http://code.google.com/p/trespams-vim/

Well I'm a little biased towards vim after all I try to mantain the
trespams-vim, but I have tested nearly all the IDEs that have been
posted in this thread, and my conclusion is that no exists such a
thing as the perfect IDE. It would depend on your work.

For me vim is perfect as I have to write code in the desktop and also
have to edit code in remote shells, so having just one common editor
is perfect for me, as it allows me to master in just one editor. If
you just need a desktop editor just try the one that fits better in
your daily work, it could be as simlpe as gedit o kate or as bloated
as Aptana. Just try and you'll find the best IDE *for you*.



-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread tayfur yilmaz
Wing ide is best.for qt programming and django..

2010/9/27 Sandro Dutra 

> I like Eric and Aptana.
>
> 2010/9/27 João Rodrigues 
>
> http://code.google.com/p/trespams-vim/
>>
>> On 27 September 2010 14:00, girish shabadimath 
>> wrote:
>> > actually i use vim for writing python scripts , i wanted IDE to easy my
>> > tasks of writing script (like auto-completion) ,,,i dont want GUI
>> based,,i
>> > prefer  editor like vim which supports python scripts
>> >
>> > On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube <
>> zebr...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Girish,
>> >>
>> >> I do not know what platform you work on, but on Windows try Jetbrains
>> >> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the
>> latter is
>> >> also available on Windows).
>> >>
>> >> What are you looking for in an IDE? Give more info to get a better
>> answer.
>> >>
>> >> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn 
>> wrote:
>> >>>
>> >>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>> >>> > hi all,
>> >>> >
>> >>> > is there any IDE for Python/Django ?
>> >>> Yes.
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> Groups
>> >>> "Django users" group.
>> >>> To post to this group, send email to django-us...@googlegroups.com.
>> >>> To unsubscribe from this group, send email to
>> >>> django-users+unsubscr...@googlegroups.com
>> .
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/django-users?hl=en.
>> >>>
>> >>
>> >>
>> >>
>> >> --
>> >> Regards,
>> >> Sithembewena Lloyd Dube
>> >> http://www.lloyddube.com
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> Groups
>> >> "Django users" group.
>> >> To post to this group, send email to django-us...@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> django-users+unsubscr...@googlegroups.com
>> .
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/django-users?hl=en.
>> >
>> >
>> >
>> > --
>> > Girish M S
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to
>> > django-users+unsubscr...@googlegroups.com
>> .
>> > For more options, visit this group at
>> > http://groups.google.com/group/django-users?hl=en.
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
www.tayfuryilmaz.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Josh
As far as I know I constructed the urls properly.  For example one of
them was /policy/ (that's how it looked in flatpages).  I did find
another work around though.
I removed the flatpages middleware from my settings.  And then I added
this to my urls:

urlpatterns += patterns('',
(r'^(?Ppages/(.*)/)$',
'django.contrib.flatpages.views.flatpage'),
)

Now as long as I make a flatpage of the pattern /pages/whatever/ it
finds it and otherwise the proper 404 is returned.
I got the idea here, just modified it a bit.
http://thisweekindjango.com/screencasts/episode/5/mapping-flatpage-urls/

-Josh

On Sep 27, 10:27 am, Piotr Kilczuk  wrote:
> 2010/9/27 Josh :
>
> > bump.  Does anyone have any ideas?
>
> Trailing slash issue?
>
> Just look into the middleware and see when the response code is modified.
>
> Regards,
> Piotr

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: notification in python

2010-09-27 Thread Shawn Milochik
I did a quick Google search and didn't find anything that was obviously solving 
this problem. I did see companies that sell this service, and probably with 
good reason.

Due to dynamic content such as ads, data from RSS feeds, and simply 
auto-generated content from server-side code, it seems that you'd almost have 
to customize the configuration on a site-by-site basis. It would be difficult 
to distinguish between changes to the content you're interested in monitoring 
and all the other stuff. 

On the other hand, it seems that this functionality is something that a lot of 
people might want, so don't stop looking. If you're sure there's no open-source 
solution out there, maybe you can create it and put out a call for contributors 
on this list.

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Piotr Kilczuk
2010/9/27 Josh :
> bump.  Does anyone have any ideas?

Trailing slash issue?

Just look into the middleware and see when the response code is modified.

Regards,
Piotr

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Sandro Dutra
I like Eric and Aptana.

2010/9/27 João Rodrigues 

> http://code.google.com/p/trespams-vim/
>
> On 27 September 2010 14:00, girish shabadimath 
> wrote:
> > actually i use vim for writing python scripts , i wanted IDE to easy my
> > tasks of writing script (like auto-completion) ,,,i dont want GUI
> based,,i
> > prefer  editor like vim which supports python scripts
> >
> > On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube <
> zebr...@gmail.com>
> > wrote:
> >>
> >> Hi Girish,
> >>
> >> I do not know what platform you work on, but on Windows try Jetbrains
> >> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter
> is
> >> also available on Windows).
> >>
> >> What are you looking for in an IDE? Give more info to get a better
> answer.
> >>
> >> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn 
> wrote:
> >>>
> >>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
> >>> > hi all,
> >>> >
> >>> > is there any IDE for Python/Django ?
> >>> Yes.
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Django users" group.
> >>> To post to this group, send email to django-us...@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> django-users+unsubscr...@googlegroups.com
> .
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/django-users?hl=en.
> >>>
> >>
> >>
> >>
> >> --
> >> Regards,
> >> Sithembewena Lloyd Dube
> >> http://www.lloyddube.com
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Django users" group.
> >> To post to this group, send email to django-us...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> django-users+unsubscr...@googlegroups.com
> .
> >> For more options, visit this group at
> >> http://groups.google.com/group/django-users?hl=en.
> >
> >
> >
> > --
> > Girish M S
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com
> .
> > For more options, visit this group at
> > http://groups.google.com/group/django-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread João Rodrigues
http://code.google.com/p/trespams-vim/

On 27 September 2010 14:00, girish shabadimath  wrote:
> actually i use vim for writing python scripts , i wanted IDE to easy my
> tasks of writing script (like auto-completion) ,,,i dont want GUI based,,i
> prefer  editor like vim which supports python scripts
>
> On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube 
> wrote:
>>
>> Hi Girish,
>>
>> I do not know what platform you work on, but on Windows try Jetbrains
>> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter is
>> also available on Windows).
>>
>> What are you looking for in an IDE? Give more info to get a better answer.
>>
>> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn  wrote:
>>>
>>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>>> > hi all,
>>> >
>>> > is there any IDE for Python/Django ?
>>> Yes.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
>
> --
> Girish M S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



django-treebeard: one tree per user?

2010-09-27 Thread João Rodrigues
Is it possible to have a tree for each user? I was trying something like this

# - models.py -- #
from django.db import Models
from django.contrib.auth.models import User
from treebeard.mp_tree import MP_Node

class MyTree(MP_Node):
user = models.ForeignKey(User)
desc = models.CharField(max_length=255)

def __unicode__(self):
return self.desc

class Meta:
unique_together = [('path', 'user')]

# - admin.py - #
from django.contrib import admin
from myProject.myApp.models import MyTree
from treebeard.admin import TreeAdmin

class MyTreeAdmin(TreeAdmin):
list_filter = (
'user',
)

admin,site.register(MyTree, MyTreeAdmin)

# - end of admin.py -- #

But the path gets kind of messed up and I get IntegrityErrors.
Also in the admin interface filtering by user is ignored by the tree interface.

What am I doing wrong here?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: notification in python

2010-09-27 Thread harryos
thanks for the pointer
I am trying to get something similar to changedetection  but with
hourly updates.
I need to get updates from a number of sites..So I was wondering how
to implement an updating utility
harry

On Sep 27, 9:16 pm, Shawn Milochik  wrote:
> If you're asking for functionality like this:http://www.changedetection.com/
>
> Or are you looking for something to embed in your own code to know when 
> something has happened on your own site?
>
> If the former, you can probably do it by scheduling a urlopen and saving its 
> hash, comparing it each time. If the latter, you can use the logging module.
>
> Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



form validation for empty checkboxes that are not required (and they are the only fields present)

2010-09-27 Thread Skylar Saveland
I have some modelforms within a .  Each form has one
checkboxselectmultiple that is not required.  If I post nothing (all
checkboxes are empty) then all of the forms are invalid.  If I post
anything then all of the forms are valid.  This anything could be that
one of the forms has a box checked, or that I add  to the form.


This constitutes a bug?  Is there already an issue?  Is there
something standard I can do to make it work without the hidden field
or is the hidden field a good way to go?


POSTing with no data:

Th[4320923648] 2010-09-27 12:13:48,689 cms.views [DEBUG   ] POSTing to
edit_assets with 
Th[4320923648] 2010-09-27 12:13:48,695 cms.forms [DEBUG   ] the
formset data is 
Th[4320923648] 2010-09-27 12:13:48,695 cms.forms [DEBUG   ] forms are:
[,
]
Th[4320923648] 2010-09-27 12:13:48,695 cms.forms [DEBUG   ] asset
metadata formset validation: [False, False]  (.is_valid() on the
forms)
Th[4320923648] 2010-09-27 12:13:48,695 cms.forms [DEBUG   ] errors?
[{}, {}]
[27/Sep/2010 12:13:48] "POST /portal/edit-assets/?collection=foobar
HTTP/1.1" 200 2434


if anything is in the POST, the forms are valid.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Flatpages soft 404

2010-09-27 Thread Josh
bump.  Does anyone have any ideas?

On Sep 24, 3:56 pm, Josh  wrote:
> I have a django project, its a satchmo store.  I have noticed that
> when the flatpages middleware is in my settings.py 404s seem to be
> handled incorrectly.  i.e. if a page really does not exist the server
> first sends a 302 response, then a 404.  When google crawls it only
> sees the 302 so it thinks that something is there even tho nothing is
> there.  Because of this combined with the fact that the structure of
> the site recently significantly changed google has a lot of broken
> links and none of them get fixed because the initial 302 makes google
> think something is there.
> I think this happens because the flatpages middleware intercepts 404s
> to see if there is a flatpage, but it seems incorrect.  If I remove
> the flatpages middleware 404 function correctly.  Has anyone else
> noticed this or does anyone know of a workaround?  I need flatpages,
> but I need 404s to behave correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Flatpages incorrect 302 to 404

2010-09-27 Thread Josh
bump.  Does anyone have any ideas?

On Sep 24, 3:56 pm, Josh  wrote:
> I have a django project, its a satchmo store.  I have noticed that
> when the flatpages middleware is in my settings.py 404s seem to be
> handled incorrectly.  i.e. if a page really does not exist the server
> first sends a 302 response, then a 404.  When google crawls it only
> sees the 302 so it thinks that something is there even tho nothing is
> there.  Because of this combined with the fact that the structure of
> the site recently significantly changed google has a lot of broken
> links and none of them get fixed because the initial 302 makes google
> think something is there.
> I think this happens because the flatpages middleware intercepts 404s
> to see if there is a flatpage, but it seems incorrect.  If I remove
> the flatpages middleware 404 function correctly.  Has anyone else
> noticed this or does anyone know of a workaround?  I need flatpages,
> but I need 404s to behave correctly.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Validation on a Many-to-Many Through model ( unique_together=[a, b, c=1] )

2010-09-27 Thread Heleen
I have the following models (simplified example):

class Book(models.Model):
 users = models.ManyToManyField(User, through=Permission)

class Permission(models.Model):
 user = models.ForeignKey(User)
 role = models.ForeignKey(Group)
 active = models.BooleanField()
 book = models.ForeignKey(Book)

What I need is that for a Book instance there cannot be more than one
User of with the same Role and Active. So this is allowed:

Alice, Admin, False (not active), BookA
Dick, Admin, True (active), BookA
Chris, Editor, False (not active), BookA
Matt, Editor, False (not active), BookA

But this is not allowed:

Alice, Admin, True (active), BookA
Dick, Admin, True (active), BookA

Now this cannot be done using unique_together, because it only counts
when active is True. I've tried to write a custom clean/
validate_unique method (like how I have done here:
http://stackoverflow.com/questions/3052427/validation-on-manytomanyfield-before-save-in-models-py/3266169#3266169).
But it seems that when you save a Book and it runs the validation on
each Permission, the already validated Permission instances aren't
saved until they've all been validated. This makes sense, because you
don't want them to be saved in case something doesn't validate.

Could anyone tell me if there is a way to perform the validation
described above?

P.S. I could imagine using the savepoint feature (http://
docs.djangoproject.com/en/1.2/topics/db/transactions/), but I only
really want to consider that as a last resort.

Note! I first posted this question on StackOverflow. I received a
response but the answer wouldn't work for me. Please have a look at
the response to avoid repeating the answer: 
http://stackoverflow.com/questions/3759687/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



possible bug in models using db_column

2010-09-27 Thread t...@eyesonic.net
Today, I stumbled over an at first sight strange behaviour using
models (db). It looks like a bug. I posted the code on stackoverflow:

http://stackoverflow.com/questions/3805752/possible-bug-in-django-models

greetings,
tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: notification in python

2010-09-27 Thread Shawn Milochik
If you're asking for functionality like this: http://www.changedetection.com/

Or are you looking for something to embed in your own code to know when 
something has happened on your own site?

If the former, you can probably do it by scheduling a urlopen and saving its 
hash, comparing it each time. If the latter, you can use the logging module.

Shawn

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Steve Holden
On 9/27/2010 11:31 AM, Thomas Weholt wrote:
> On Mon, Sep 27, 2010 at 4:52 PM, bruno desthuilliers
>  wrote:
>> On 27 sep, 12:55, Thomas Weholt  wrote:
>>> On Mon, Sep 27, 2010 at 12:40 PM, Steve Holden  wrote:
 I think the point is to learn enough Python that you don't need
 Django-specific advice.
>>>
 [Thinks: definitely time for a "Python for Djangonauts" class].
>>>
>>> I`m asking for a best-practice advice, and have gotten plenty of good
>>> examples of ways to solve this "problem", but I still think this
>>> should be covered by the standard django docs anyhow,
>>
>> What would you suggest exactly ?
> 
> I section under "The model layer -> Advanced" called "Organizing
> models and code in larger projects". Details on how to splitting
> models over several files, if and how you should seperate logic from
> models etc.
> 
>>> especially since
>>> there are some django specific magic related to the files generated by
>>> using manage.py startapp.
>>
>> ??? Which "django specific magic" ???
> 
> I was referring to syncdb. As far as I know, models defined outside
> any models.py or models module won`t be picked up by syncdb, but I
> might be wrong.
> 
An addition to the documentation about why your models may not be picked
up could well be useful.

>>
>>> It`s obviously not clear to all django users
>>> how to best handle growing projects, split into modules etc
>>
>> I can only second Steve on this : time for "Python for Djangonauts"
>> class then. FWIW, I'm amazed at how many persons seem to pick up
>> django without any background in Python.
> 
> Hmmm ... do you or Steven know anything about my programming
> background? My googling and even answers on this thread seem to
> indicate that I`m not alone pondering about how to organize my django
> code. I know how to structure my code in modules, but for
> re-usability`s sake for instance it would be nice to have some
> guidelines on how to structure your code in larger django projects and
> it would be nice to have those guidelines in the otherwise excellent
> django docs.
> 
Hold hard, there! That's Steve, not Steven, Thomas. And I was musing
about it being an opportunity to write and promote a new training class,
rather than specifically suggesting that you personally needed training.

>>
>>> and just
>>> taking some of the info in this thread, re-writing it and giving a few
>>> examples and then adding it to the std docs would be enough.
>>
>> Mmm... Not sure this would help. A pointer to Python's doc and a
>> strong emphasis on the fact that you definitly have to learn Python to
>> go any further would be more helpful in the long run IMHO. But well,
>> if you think you can contribute something useful, please go ahead and
>> submit your patch to the team - it's an OSS project, isn't it ?
> 
> I`m trying to contribute to the django community by writing code,
> reusable apps, being active on gropus like this etc. I could even try
> to help out writing docs, but if my questions are going to be answered
> by people who question my competence that wouldn`t be very motivating,
> would it?
> 
I don't think anyone's questioning your competence, and your desire to
help in a community-spirited way is very welcome. But you should realize
(and probably will if you think about it) that many people who do ask
questions on this list could use better Python knowledge than they
currently have. If you aren't in that position then fine.

> I`ll take all the hints and advice given in this thread and try to use
> it to organize my ongoing project. Thanks for your time, everyone.
> 
You are correct in saying that the Django docs are excellent, but
there's only so much they can do.

If you do come up with useful guidelines I am sure that nobody is going
to complain if you submit a patch to the docs. One of the issues is that
size is not the only metric of complexity, and it's difficult to frame
generic advice about the organization of large projects.

regards
 Steve
-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread werefr0g

 Hello,

The following is quite long but reflects a non developper point of view. 
I'll expose briefly that business analysis already splits logic and why 
I think you should follow previous recommandations. I'll finish "out of 
subject" commenting your documentation request.


> Split business logic

When you have to describe business logic to a dev, seperating business 
responsabilities is a good start. I think it's a thought orientation 
shared by "business analysts" (I'm not sure this is the right term in 
english) and developpers. The process often shows that a same object can 
be approached from different perspectives (for exemple, sales, 
comptability, logictic both work with orders but with different 
perspectives). You'd better keep this object as generic as possible and 
let each perspective set its own attributes at its very level. This 
mailing list shows multiple practical examples with the User notion.


In the process, you have to be consistent and a direct extra benefit is 
polishing each application interface. From a non developper point of 
view, I find far most easier to write applications when the semantic and 
the interfaces are clean. It helps your application's usability and it's 
documentation too.


As most developpers complain, business logic tends to change and it's 
implementation has to follow. Both at business and application levels, 
these changes should be kept at their perpective level (for example, a 
change in accounting should not compromise other fields and not be a 
revolution in actual business if possible).


My point is that it is a normal business analysis process to split 
responsabilities as far as possible and Django allows you to write 
multiple apps to implement that. Implementation problems are about the 
same that those brought while debatting applications reusability. If 
your project may have multiple dependencies, your app should keep them 
minimal at their level: this process is already part of business 
analysis when modeling "packages".


In business, a task can be reassigned: if you want something done, you 
must ask somewhere else. Putting that in Django, if you want to reach a 
ressource, you use an url and the url mapper will call the ressource for 
you. Django allows you to name your urls and you can implement 
get_absolute_url easily. I see the way Django handles urls as a great 
strength. I take the opportunity to state that url are part of a web 
application interface (browsers are only a part of available clients).


To rephrase all of that, splitting your project in multiple parts is 
already a business analysis requierement before reaching the 
developpement process.


> Documentation and guidelines

When speaking about Django's pro, the admin and the documentation come 
often. They reflect both a practical approach. Django's documentation 
show it's developpers philosophy and puts emphasis on good practices. 
Django's original design history and the framework's multiple actual 
fields of application tend to proove that team's member are not totally 
subject to delusion ;).


I found that adding guidelines on a subject to applications' 
documentation helps greatly: it summarise the concepts, reinforce 
consistency and puts the recent knowledge on another perspective, acting 
as a seal. It draws practical schemas and are good entry points to the 
"practical cases to concepts" learners and can bring "step by step" 
learners to a more self-implying approach. It reinforce pattern 
recognition during the analysis. They are often used for feedback. 
Writing them is time consumming, that's the bad part.


Ensuring that applications are designed to properly integrate into the 
framework helps to reinforce the framework. Extensions / plugins / 
adapters are considered when chosing a solution and for Django, they are 
the apps. Django is a practical solution by its extension ability. A pro 
often advanced in favor of frameworks usage is the standardisation of 
the developpement process.


Explicitly tell the direction is the most simple way to garanty that, as 
far I can tell.


While speaking of designing applications, I think that testing should be 
shown since the tutorial, at least in a minimal form. (by the way, 
testing advocates again a rationnal  spread of responsabilities into the 
project).


> Thanks

Sorry, I lied in the begining. I was quite long so if you reach this 
point, you'll don't mind if I thank both Django's team to brought me 
into the enjoyment of developpement and the community for its 
participation and its enthousiasm.


Regards,

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Thomas Weholt
On Mon, Sep 27, 2010 at 4:52 PM, bruno desthuilliers
 wrote:
> On 27 sep, 12:55, Thomas Weholt  wrote:
>> On Mon, Sep 27, 2010 at 12:40 PM, Steve Holden  wrote:
>> > I think the point is to learn enough Python that you don't need
>> > Django-specific advice.
>>
>> > [Thinks: definitely time for a "Python for Djangonauts" class].
>>
>> I`m asking for a best-practice advice, and have gotten plenty of good
>> examples of ways to solve this "problem", but I still think this
>> should be covered by the standard django docs anyhow,
>
> What would you suggest exactly ?

I section under "The model layer -> Advanced" called "Organizing
models and code in larger projects". Details on how to splitting
models over several files, if and how you should seperate logic from
models etc.

>> especially since
>> there are some django specific magic related to the files generated by
>> using manage.py startapp.
>
> ??? Which "django specific magic" ???

I was referring to syncdb. As far as I know, models defined outside
any models.py or models module won`t be picked up by syncdb, but I
might be wrong.

>
>> It`s obviously not clear to all django users
>> how to best handle growing projects, split into modules etc
>
> I can only second Steve on this : time for "Python for Djangonauts"
> class then. FWIW, I'm amazed at how many persons seem to pick up
> django without any background in Python.

Hmmm ... do you or Steven know anything about my programming
background? My googling and even answers on this thread seem to
indicate that I`m not alone pondering about how to organize my django
code. I know how to structure my code in modules, but for
re-usability`s sake for instance it would be nice to have some
guidelines on how to structure your code in larger django projects and
it would be nice to have those guidelines in the otherwise excellent
django docs.

>
>> and just
>> taking some of the info in this thread, re-writing it and giving a few
>> examples and then adding it to the std docs would be enough.
>
> Mmm... Not sure this would help. A pointer to Python's doc and a
> strong emphasis on the fact that you definitly have to learn Python to
> go any further would be more helpful in the long run IMHO. But well,
> if you think you can contribute something useful, please go ahead and
> submit your patch to the team - it's an OSS project, isn't it ?

I`m trying to contribute to the django community by writing code,
reusable apps, being active on gropus like this etc. I could even try
to help out writing docs, but if my questions are going to be answered
by people who question my competence that wouldn`t be very motivating,
would it?

I`ll take all the hints and advice given in this thread and try to use
it to organize my ongoing project.Thanks for your time, everyone.

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: In admin, is there a post-commit hook that is executed after all models and inlines are saved?

2010-09-27 Thread jonathan.morgan
Thank you for the tip!  I'll have to check this one out.  That does
look like it could have been helpful.  I missed it in going over the
documentation.  Do you have any good links to documentation on it?
The django admin page where it is mentioned is spartan, and I'd like
to see what the parent method does, so I understand what I am
potentially losing if I override that method.

Thanks,

Jonathan

On Sep 27, 2:46 am, Subhranath Chunder  wrote:
> Hi,
>
> Since you have already done what you required, I'm not going much into
> detail, but your process basically looks pretty lengthy.
>
> Normally, to do these sort of stuff I only override two ModelAdmin methods:
> - save_model()
> - save_formset()
>
> Using them together normally serves any kind of purpose, and the code looks
> cleaner too. Maybe you can try with experimenting them out sometime.
>
> Thanks,
> Subhranath Chunder.
>
> On Mon, Sep 27, 2010 at 8:19 AM, jonathan.morgan 
>  wrote:
> > Update:
>
> > Well, I cobbled together a few things to accomplish most of what I
> > needed to accomplish, and figured I'd write it down here so I can look
> > it up later and so others can learn from it (the doc on m2m_changed,
> > in particular, is not incomplete, but not detailed or particularly
> > precise, and I had trouble finding a good example).
>
> > The event to event_date relation was one-to-many, so there is a model
> > for event dates that contains the key to each date's related event.
> > For these, I overrode the save and delete methods for the event_dates
> > model so it notifies the related event when any related date is added,
> > changed, or deleted, after the actual save on insert, update, or
> > delete, so the related event (which is still present in the instance
> > even on delete, though the relation no longer exists in the database)
> > can invoke a method that accepts the date and checks if it potentially
> > needs to re-calculate its overall start and end dates from the
> > database based on where the date lies in relation to its current start
> > and end dates.  Part of the problem I was running into is that the
> > internal set of event_dates for an event were not getting updated as
> > updates from the admin screen were getting processed.  The database is
> > updated, though, and so the event can query the database for updated
> > dates and update its start and end date accurately even though its
> > internal Set representation of associated dates gets out of sync.
>
> > For the ManyToMany, I ended up being able to use the m2m_changed
> > signal combined with overriding the save and delete on the right-hand
> > side of the m2m relationship to let the event know that something had
> > changed, and so it should rebuild its cached list of series and
> > providers.  First, a few notes on what precisely the m2m_changed
> > signal passes:
>
> > - sender: Python new-class Type instance for the django-generated
> > "through" class that connects the two models (Event.presenters.through
> > and Event.series.through in this case).
>
> > - instance: an instance of the model that contains the ManyToManyField
> > relationship (Event, in this case).
>
> > - model: Python new-class Type instance for the class of the model
> > that is on the right side of the M2M relationship, joined by the
> > "through" class that is in the "sender" parameter (Series and
> > Presenter model classes in the two functions below).
>
> > - action - either "pre_add"/"post_add" or
> > "pre_clear"/"post_clear" ("pre_remove" and "post_remove" are never
> > sent by the admin, as far as I can tell, since it just clears all
> > relations each time a record is saved, then adds in relations again
> > that still are present - not perhaps how I would have done it, but
> > efficient).
>
> > Because of how django admin implements processing changes to m2m
> > relations (clear all, then re-add all that are present in form submit)
> > m2m_changed doesn't actually tell you how the relation changed (so no
> > signals for things getting removed, and no good signals on "add"
> > versus "still here"), so I had to just use these signals to let the
> > event know something had changed with a given set of relations, and
> > have it call a method to update itself from the database to figure out
> > what had changed and take the changes into account.  This worked, but
> > wasn't quite as targeted as it could be if admin actually passed
> > m2m_changed signals for removal, and didn't pass add signals for
> > relations that were unchanged.
>
> > I also limited the event listeners to only the "through" senders I
> > cared about (see code sample below for accessing a "through" class -
> > import the class that contains the ManyToManyField, then reference
> > "class_name"."m2m_field_name".through).  Here is the code I ended up
> > with for registering the signals (in my models.py file, so the Event
> > class is already there, doesn't need to be 

Re: IDE for Python/django

2010-09-27 Thread pixelcowboy
For linux/ubuntu there is also Eric IDE. It has django plugin.

On Sep 27, 7:38 am, Sithembewena Lloyd Dube  wrote:
> Less? He could probably ask, "is there any IDE?"
>
> ^^ Couldn't let that one slip by...haven't trolled in a while :)
>
> On Mon, Sep 27, 2010 at 4:29 PM, fcaldera wrote:
>
>
>
>
>
>
>
> > On 27 Set, 14:52, Masklinn  wrote:
> > > On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
>
> > > > is there any IDE for Python/Django ?
>
> > > Yes.
>
> > Could you be less specific, please?
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Django users" group.
> > To post to this group, send email to django-us...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > django-users+unsubscr...@googlegroups.com > groups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/django-users?hl=en.
>
> --
> Regards,
> Sithembewena Lloyd Dubehttp://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread bruno desthuilliers
On 27 sep, 12:55, Thomas Weholt  wrote:
> On Mon, Sep 27, 2010 at 12:40 PM, Steve Holden  wrote:
> > I think the point is to learn enough Python that you don't need
> > Django-specific advice.
>
> > [Thinks: definitely time for a "Python for Djangonauts" class].
>
> I`m asking for a best-practice advice, and have gotten plenty of good
> examples of ways to solve this "problem", but I still think this
> should be covered by the standard django docs anyhow,

What would you suggest exactly ?

> especially since
> there are some django specific magic related to the files generated by
> using manage.py startapp.

??? Which "django specific magic" ???

> It`s obviously not clear to all django users
> how to best handle growing projects, split into modules etc

I can only second Steve on this : time for "Python for Djangonauts"
class then. FWIW, I'm amazed at how many persons seem to pick up
django without any background in Python.

> and just
> taking some of the info in this thread, re-writing it and giving a few
> examples and then adding it to the std docs would be enough.

Mmm... Not sure this would help. A pointer to Python's doc and a
strong emphasis on the fact that you definitly have to learn Python to
go any further would be more helpful in the long run IMHO. But well,
if you think you can contribute something useful, please go ahead and
submit your patch to the team - it's an OSS project, isn't it ?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Sithembewena Lloyd Dube
Less? He could probably ask, "is there any IDE?"

^^ Couldn't let that one slip by...haven't trolled in a while :)

On Mon, Sep 27, 2010 at 4:29 PM, fcaldera wrote:

>
>
> On 27 Set, 14:52, Masklinn  wrote:
> > On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
> >
> > > is there any IDE for Python/Django ?
> >
> > Yes.
>
> Could you be less specific, please?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread fcaldera


On 27 Set, 14:52, Masklinn  wrote:
> On 2010-09-27, at 14:51 , girish shabadimath wrote:> hi all,
>
> > is there any IDE for Python/Django ?
>
> Yes.

Could you be less specific, please?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Accessing schemas in django

2010-09-27 Thread shmengie
Using the later django versions, supports mutiple database/schemas
with a DATABASES dict in settings.py

your modles can select different db's on the fly:

result = MyModel.objects.using('anotherdb').filter...

Should get you there.

On Sep 27, 4:37 am, Jean-Pierre De Villiers 
wrote:
> On Sep 27, 9:30 am, Nabil Servais  wrote:
>
> >   Hello,
>
> > Le 27/09/2010 08:53, Jean-Pierre De Villiers a crit :
>
> > > Hi,
> > > Is there a way to access an existing database schema in Django?
> > > Any help would be appreciated!
>
> > > J
>
> > You can use the inspectdb option of the project manager, you will find
> > more information in the official documentation :
>
> >http://docs.djangoproject.com/en/dev/ref/django-admin/?from=olddocs
>
> Hi,
> Thanks for the help Nabil Servais, is there a way to use the same
> model for different schemas, like a variable used for the schemas or
> something.
> We have for example, hundreds of schemas and using a different model
> for every one of them would be a tiresome process.
>
> thanks again!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: JavaScript with Dango

2010-09-27 Thread shmengie
Javascript is a bugger and miserably difficult to debunk and
implement.

Google blows me away, in that they actually developed google apps with
it.  Kudos!  I suspected it was possible, but think my brain would end
up looking like funky grey mushy matter if I were one of the
developers on the team (don't quite know what I mean by that)...

If you're serious about javascript I recommend jQuery, it can ease the
chore, even though I don't believe javascript and any form of the verb
"easy" belong in the same sentence.  Firefox can be your friend and iE
the enemy...  Or was it the other way around.  jQuery can help with
that too.

Maybe it's just me, but every time I write javascript, it's a chore
until I get the job done, then I prey it doesn't break.

Just finished refactored and authoring new javascript in my app...
Phew!  Need to thank Guido for python one of these days ;) and curse
the netscape folks that thought C/pascal was a good for scripting.

To polish your web work javascript is a necessary evil.  Clearly
identify the js purpuse, keep the implementation as simple as possible
and it won't be too bad.  Firefox has some nice tools/extensions that
can be a tremendous help.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



No caching if request.GET not empty

2010-09-27 Thread Thomas Guettler
Hi,

requests with a query string (http://example.com?foo=bar) are not cached in 
Django:

http://code.djangoproject.com/svn/django/trunk/django/middleware/cache.py
{{{
if not request.method in ('GET', 'HEAD') or request.GET:
request._cache_update_cache = False
return None # Don't bother checking the cache.
}}}

If the query string would be used in _generate_cache_key() (utils/cache.py),
requests with an not empty request.GET could be cached.

I see no reason, not to cache requests with a query string.

Can someone explain this?

  Thomas

-- 
Thomas Guettler, http://www.thomas-guettler.de/
E-Mail: guettli (*) thomas-guettler + de

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Carlos Daniel Ruvalcaba Valenzuela
So far there is 3 big ones for django, Eclipse + PyDev or Aptana +
PyDev, WingIDE (latest version can even debug django templates) and
PyCharm.

If you want something OSS or Free Eclipse or Aptana, otherwise you may
want to checkout both WingIDE and PyCharm to see if you like one of
those.

Personally I like PyCharm so far.

Regards,
Carlos Ruvalcaba

On Mon, Sep 27, 2010 at 6:00 AM, girish shabadimath
 wrote:
> actually i use vim for writing python scripts , i wanted IDE to easy my
> tasks of writing script (like auto-completion) ,,,i dont want GUI based,,i
> prefer  editor like vim which supports python scripts
>
> On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube 
> wrote:
>>
>> Hi Girish,
>>
>> I do not know what platform you work on, but on Windows try Jetbrains
>> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter is
>> also available on Windows).
>>
>> What are you looking for in an IDE? Give more info to get a better answer.
>>
>> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn  wrote:
>>>
>>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>>> > hi all,
>>> >
>>> > is there any IDE for Python/Django ?
>>> Yes.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Regards,
>> Sithembewena Lloyd Dube
>> http://www.lloyddube.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>
>
>
> --
> Girish M S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread bagheera
Dnia 27-09-2010 o 15:00:51 girish shabadimath   
napisał(a):


actually i use vim for writing python scripts , i wanted IDE to easy my  
tasks of writing script (like auto-completion) ,,,i dont want GUI  
based,,i prefer  editor like vim which supports python scripts


GUI based, but lightweight "Geany" IDE is. :)
--
Linux user

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread girish shabadimath
actually i use vim for writing python scripts , i wanted IDE to easy my
tasks of writing script (like auto-completion) ,,,i dont want GUI based,,i
prefer  editor like vim which supports python scripts

On Mon, Sep 27, 2010 at 6:26 PM, Sithembewena Lloyd Dube
wrote:

> Hi Girish,
>
> I do not know what platform you work on, but on Windows try Jetbrains
> PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter is
> also available on Windows).
>
> What are you looking for in an IDE? Give more info to get a better answer.
>
>
> On Mon, Sep 27, 2010 at 2:52 PM, Masklinn  wrote:
>
>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>> > hi all,
>> >
>> > is there any IDE for Python/Django ?
>> Yes.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Regards,
> Sithembewena Lloyd Dube
> http://www.lloyddube.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Sithembewena Lloyd Dube
yw. SPE is strictly a Python IDE, so I am not aware of any support for
Django tags. If you are comfortable with client-side coding, I reckon you
shouldn't really need that anyway.


On Mon, Sep 27, 2010 at 2:56 PM, girish shabadimath <
girishmss.1...@gmail.com> wrote:

> thanks a lot...
>
>
> On Mon, Sep 27, 2010 at 6:28 PM, bagheera  wrote:
>
>> Dnia 27-09-2010 o 14:51:15 girish shabadimath 
>> napisał(a):
>>
>>
>>  hi all,
>>>
>>> is there any IDE for Python/Django ?
>>>
>>>
>> Most will probably recommend Eclipse + pydev plugin or Aptana + pydev.
>> I fell quite comfortable with NetBeans. Unfortunately it doesn't support
>> django template language.
>>
>> --
>> Linux user
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Girish M S
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Ramdas S
On Mon, Sep 27, 2010 at 6:24 PM, girish shabadimath <
girishmss.1...@gmail.com> wrote:

> im using ubuntu machine so which IDE is best suited for this machine.
>
>
> On Mon, Sep 27, 2010 at 6:23 PM, girish shabadimath <
> girishmss.1...@gmail.com> wrote:
>
>> can u please tell me which is it..
>>
>>
>> On Mon, Sep 27, 2010 at 6:22 PM, Masklinn  wrote:
>>
>>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>>> > hi all,
>>> >
>>> > is there any IDE for Python/Django ?
>>> Yes.
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "Django users" group.
>>> To post to this group, send email to django-us...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> django-users+unsubscr...@googlegroups.com
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>
>>
>> --
>> Girish M S
>>
>
>
>
vim or emacs.

>
> --
> Girish M S
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Ramdas S
+91 9342 583 065

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread girish shabadimath
thanks a lot...

On Mon, Sep 27, 2010 at 6:28 PM, bagheera  wrote:

> Dnia 27-09-2010 o 14:51:15 girish shabadimath 
> napisał(a):
>
>
>  hi all,
>>
>> is there any IDE for Python/Django ?
>>
>>
> Most will probably recommend Eclipse + pydev plugin or Aptana + pydev.
> I fell quite comfortable with NetBeans. Unfortunately it doesn't support
> django template language.
>
> --
> Linux user
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Sithembewena Lloyd Dube
Hi Girish,

I do not know what platform you work on, but on Windows try Jetbrains
PyCharm. On Linux, try SPE, or Eclipse with Pydev extensions (the latter is
also available on Windows).

What are you looking for in an IDE? Give more info to get a better answer.

On Mon, Sep 27, 2010 at 2:52 PM, Masklinn  wrote:

> On 2010-09-27, at 14:51 , girish shabadimath wrote:
> > hi all,
> >
> > is there any IDE for Python/Django ?
> Yes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread girish shabadimath
im using ubuntu machine so which IDE is best suited for this machine.

On Mon, Sep 27, 2010 at 6:23 PM, girish shabadimath <
girishmss.1...@gmail.com> wrote:

> can u please tell me which is it..
>
>
> On Mon, Sep 27, 2010 at 6:22 PM, Masklinn  wrote:
>
>> On 2010-09-27, at 14:51 , girish shabadimath wrote:
>> > hi all,
>> >
>> > is there any IDE for Python/Django ?
>> Yes.
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
> --
> Girish M S
>



-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread bagheera
Dnia 27-09-2010 o 14:51:15 girish shabadimath   
napisał(a):



hi all,

is there any IDE for Python/Django ?



Most will probably recommend Eclipse + pydev plugin or Aptana + pydev.
I fell quite comfortable with NetBeans. Unfortunately it doesn't support  
django template language.


--
Linux user

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread girish shabadimath
can u please tell me which is it..

On Mon, Sep 27, 2010 at 6:22 PM, Masklinn  wrote:

> On 2010-09-27, at 14:51 , girish shabadimath wrote:
> > hi all,
> >
> > is there any IDE for Python/Django ?
> Yes.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: IDE for Python/django

2010-09-27 Thread Masklinn
On 2010-09-27, at 14:51 , girish shabadimath wrote:
> hi all,
> 
> is there any IDE for Python/Django ?
Yes.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



IDE for Python/django

2010-09-27 Thread girish shabadimath
hi all,

is there any IDE for Python/Django ?

-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: JavaScript with Dango

2010-09-27 Thread aug dawg
I found the link but since I don't really know any JavaScript (I was just
kinda wondering if I should start learning it), I just downloaded it and
installed it. It should come in handy at some point though.


On Sun, Sep 26, 2010 at 8:02 PM, Axel Bock  wrote:

> I gotta say this is the kind of answer which usually upsets me for obvious
> reasons, although I gotta admit the question surely is not very well
> phrased, too :)
>
> But well. I just discovered dajaxproject.com from another thread - maybe
> you could start from there. It seems to be a framework which coupoles Django
> with some Ajax libs to some extend, if that's what you want. I only had a
> short look and filed it for later.
>
> http://www.dajaxproject.com/
>
>
> HTH,
> Axel.
>
>
>
> 2010/9/26 CrabbyPete 
>
> Yes.
>>
>> On Sep 26, 7:48 am, aug dawg  wrote:
>> > Does Django work with JavaScript? If so, how can I use JavaScript in my
>> > Django projects?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To post to this group, send email to django-us...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Can I install Django on my Webserver?

2010-09-27 Thread vikalp sahni
Yeah you can, most of the shared web hostings provide either of

Passegener
Fast CGI
WSGI

Modules to run python web apps. you need to check which one is
installed for you and use the respective config.

Regards,
//Vikalp


On Mon, Sep 27, 2010 at 12:58 PM, McFarlane  wrote:

> Hello,
>
> I'm curious if I can install django on my webserver. It is a cheap
> Webserver I used for PHP and Python scripts. My Problem is, that I am
> only able to toggle "Python support" with a checkbox on the Domain-
> Config-Panel. I cannot install any Packages to apache.
>
> Is it still possible to get a django powerd website up and running?
>
> Thanks in advance, McFarlane
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: sql query: how to

2010-09-27 Thread chris hendrix
yeah i was looking at something like that... actually let me correct 
what i'm needing to do:


select year(fieldname) as pubyear from table order by year(fieldname) asc




On 09/27/2010 01:15 AM, akaariai wrote:

The most efficient? Exactly that using raw SQL. I think something
along the following will also work:
Foo.objects.only('fieldname').value_list().distinct().order_by('fieldname').

  - Anssi

On Sep 27, 5:49 am, Bobby Roberts  wrote:
   

what is the most efficient way to do the following sql command in
django?

select distinct fieldname from table order by fieldname
 
   


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Accessing schemas in django

2010-09-27 Thread Jean-Pierre De Villiers


On Sep 27, 9:30 am, Nabil Servais  wrote:
>   Hello,
>
> Le 27/09/2010 08:53, Jean-Pierre De Villiers a crit :
>
> > Hi,
> > Is there a way to access an existing database schema in Django?
> > Any help would be appreciated!
>
> > J
>
> You can use the inspectdb option of the project manager, you will find
> more information in the official documentation :
>
> http://docs.djangoproject.com/en/dev/ref/django-admin/?from=olddocs

Hi,
Thanks for the help Nabil Servais, is there a way to use the same
model for different schemas, like a variable used for the schemas or
something.
We have for example, hundreds of schemas and using a different model
for every one of them would be a tiresome process.

thanks again!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Can I install Django on my Webserver?

2010-09-27 Thread McFarlane
Hello,

I'm curious if I can install django on my webserver. It is a cheap
Webserver I used for PHP and Python scripts. My Problem is, that I am
only able to toggle "Python support" with a checkbox on the Domain-
Config-Panel. I cannot install any Packages to apache.

Is it still possible to get a django powerd website up and running?

Thanks in advance, McFarlane

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Working with User Proxy

2010-09-27 Thread Derek
I am trying to get a working setup for improved display of user details in
the Django Admin.

I am working with a legacy database, so all tables have a character-based
"username" (rather than the numeric one which Django uses), which is linked
to the "auth_user" table.

#models

class UserProxy(User):
class Meta:
proxy = True
def __unicode__(self):
return u'%s %s' % (self.first_name, self.last_name)

class Test(models.Model):
id = models.AutoField(primary_key=True, db_column='TestID')
label = models.CharField(max_length=50, null=True, blank=True)
contact = models.ForeignKey(UserProxy, db_column='ContactUserID',
to_field='username', null=True, blank=True, related_name='contact')

The display of the above Test table in the Django Admin works well - the
user's first and last name show up in the list of records for Test.
However, when I try and add and save a record, I get this error message:

Exception Type: ValueError at /admin/edit/test/add/
Exception Value: Cannot assign "": "Test.contact" must be a
"UserProxy" instance.

Here is the traceback:

File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py"
in get_response
  100. response = callback(request, *callback_args,
**callback_kwargs)
File
"/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in
wrapper
  239. return self.admin_site.admin_view(view)(*args,
**kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapped_view
  76. response = view_func(request, *args, **kwargs)
File
"/usr/local/lib/python2.6/dist-packages/django/views/decorators/cache.py" in
_wrapped_view_func
  69. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/contrib/admin/sites.py"
in inner
  190. return view(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapper
  21. return decorator(bound_func)(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
_wrapped_view
  76. response = view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/utils/decorators.py" in
bound_func
  17. return func(self, *args2, **kwargs2)
File "/usr/local/lib/python2.6/dist-packages/django/db/transaction.py" in
_commit_on_success
  299. res = func(*args, **kw)
File
"/usr/local/lib/python2.6/dist-packages/django/contrib/admin/options.py" in
add_view
  777. if form.is_valid():
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
is_valid
  121. return self.is_bound and not bool(self.errors)
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
_get_errors
  112. self.full_clean()
File "/usr/local/lib/python2.6/dist-packages/django/forms/forms.py" in
full_clean
  269. self._post_clean()
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
_post_clean
  316. self.instance = construct_instance(self, self.instance,
opts.fields, opts.exclude)
File "/usr/local/lib/python2.6/dist-packages/django/forms/models.py" in
construct_instance
  51. f.save_form_data(instance, cleaned_data[f.name])
File
"/usr/local/lib/python2.6/dist-packages/django/db/models/fields/__init__.py"
in save_form_data
  416. setattr(instance, self.name, data)
File
"/usr/local/lib/python2.6/dist-packages/django/db/models/fields/related.py"
in __set__
  318.  self.field.name,
self.field.rel.to._meta.object_name))

If I switch back to using:
contact = models.ForeignKey(User, ...
then editing works OK, but the list now just displays the (ugly) username.

Any help or suggestions appreciated.

Thanks,
Derek

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Plone Conference 2010 schedule published

2010-09-27 Thread Matt Hamilton
Hi all you Djangonauts... I thought some of you might be interested in
finding out a little about what goes on over on the 'other side of the fence'
...in the Plone world. ;)

Django being a fantastic framework for creating web apps with relational
databases, and Plone being a content management system built on
top of an object oriented database you might think they have little in 
common, but both being written in Python, there are in fact quite a few 
good opportunities for sharing lessons learned from each side of the 
camp (such as tools like buildout).

It would be great to cross-pollinate some more ideas, and so I'd like
to warmly welcome you all to the Plone Conference coming up next month
and being held this year in the UK:

Over 400 attendees are set to meet at the 8th annual Plone Conference
for a week-long programme of training, talks and developer sprints
from the 25th to 31st October at the Thistle Grand Hotel in Bristol,
UK.

Plone Conference 2010 registrations are open.

Plone, an Open Source Content Management System used throughout the
world has a massive following and Plone events are held around the
globe. The largest of these is the annual Plone Conference and this
year will be held in the UK. Plone is used for developing websites,
intranet and portals for corporations, NGOs and the public sector.

Organised by Netsight Internet Solutions, it promises to bring
together developers, designers, end users and business people. This
year an additional event is being planned as a one-day mini-conference
on the 26th October called "Plone in Business" which will be aimed
specifically at analysts, advisors, evaluators and information
professionals looking to find out more about Plone and see a showcase
of successful Plone projects from across the sectors. It will also see
the launch of the JBoye Plone Community of Practice.

The main part of the conference, from the 27th - 29th October, has
over 50 scheduled talks from speakers from 19 countries and includes
an 'unconference' day in which talks will be proposed by the
attendees. 

Plone Conference 2010 scheduled talks include:

* Easier and faster Plone theming with Deliverance
* Design and Development with Dexterity
* Enterprise Search in Plone with Solr
* Boosting productivity with "Plone-driven Plone development"
* Brasil.gov.br: Building a digital nation with Plone

Alan Runyan, co-founder of Plone and president of Enfold Systems along
with Alex Limi, fellow co-founder of Plone and now Firefox User
Experience Lead at Mozilla will be delivering a keynote. There will
also be a guest keynote by Richard Noble, OBE, project director of the
Bloodhound SSC project attempting be build a car to pass the 1,000mph
land speed mark.

The conference falls at a great time, with the recent release of Plone
4, a product that raises the bar in the Content Management System
market with a faster, more user-friendly and more refined version of
the product.

So far, registrations for the conference have come from over 30
countries around the world. To find out more about the conference and
to register, visit http://ploneconf2010.org.

Thanks,
Matt


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Thomas Weholt
On Mon, Sep 27, 2010 at 12:40 PM, Steve Holden  wrote:
> On 9/27/2010 4:57 AM, Thomas Weholt wrote:
>> On Mon, Sep 27, 2010 at 10:38 AM, bruno desthuilliers
>>  wrote:
>>> On 27 sep, 09:08, MrMuffin  wrote:
 Where do you put your business logic in django?
>>>
>>> Depends on the definition of "business logic", but :
>>>
 In my project I`ve put
 it into the models.py,
>>>
>>> That's also what I tend to do for anything that's not a pure utility
>>> class or function and that's not strictly tied to the HTTP request /
>>> response cycle.
>>>
 but that file soon become huge and hard to
 maintain.
>>>
>>>
>>> Then refactor your "models.py" module into a package.
>>>
 Of course I can just stuff it into whatever file I like, but
 I`d like to have some standard way of doing this. There seems to be
 something missing in django when it comes to business logic. It`s all
 model, views and templates and that`s all great for small projects,
 but both the models.py and views.py very soon gets huge and how do you
 re-organize your project when that happens? Splitting views and models
 into seperate files is only a partial solution and that requires some
 hackish code in __init__.py to make syncdb etc work.
>>>
>>> Using the package's __init__.py as a facade is certainly not "hackish"
>>> - it's one of - if not the main - the raison d'être of this file.
>>>
>>> Now if your app is really growing that big, it's probably time to
>>> refactor it into a set of related, more specialized apps. It's not as
>>> easy as just splitting the models / views / whatever as sub-packages
>>> of a same app, and doing so afterward will probably be more painful
>>> than designing it right from the start, but in both cases it has the
>>> benefit that it forces you to think about dependancies management,
>>> which can greatly helps when it comes to maintainance.
>>
>> Ok, I see your point, but still -  there`s nothing about this in the
>> main django documentation as far as I know. The docs should have a
>> section about organizing projects where the standard models.py and
>> views.py doesn`t fit anymore.
>>
> I think the point is to learn enough Python that you don't need
> Django-specific advice.
>
> [Thinks: definitely time for a "Python for Djangonauts" class].
>
> regards
>  Steve
>

I`m asking for a best-practice advice, and have gotten plenty of good
examples of ways to solve this "problem", but I still think this
should be covered by the standard django docs anyhow, especially since
there are some django specific magic related to the files generated by
using manage.py startapp. It`s obviously not clear to all django users
how to best handle growing projects, split into modules etc and just
taking some of the info in this thread, re-writing it and giving a few
examples and then adding it to the std docs would be enough.

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Steve Holden
On 9/27/2010 4:57 AM, Thomas Weholt wrote:
> On Mon, Sep 27, 2010 at 10:38 AM, bruno desthuilliers
>  wrote:
>> On 27 sep, 09:08, MrMuffin  wrote:
>>> Where do you put your business logic in django?
>>
>> Depends on the definition of "business logic", but :
>>
>>> In my project I`ve put
>>> it into the models.py,
>>
>> That's also what I tend to do for anything that's not a pure utility
>> class or function and that's not strictly tied to the HTTP request /
>> response cycle.
>>
>>> but that file soon become huge and hard to
>>> maintain.
>>
>>
>> Then refactor your "models.py" module into a package.
>>
>>> Of course I can just stuff it into whatever file I like, but
>>> I`d like to have some standard way of doing this. There seems to be
>>> something missing in django when it comes to business logic. It`s all
>>> model, views and templates and that`s all great for small projects,
>>> but both the models.py and views.py very soon gets huge and how do you
>>> re-organize your project when that happens? Splitting views and models
>>> into seperate files is only a partial solution and that requires some
>>> hackish code in __init__.py to make syncdb etc work.
>>
>> Using the package's __init__.py as a facade is certainly not "hackish"
>> - it's one of - if not the main - the raison d'être of this file.
>>
>> Now if your app is really growing that big, it's probably time to
>> refactor it into a set of related, more specialized apps. It's not as
>> easy as just splitting the models / views / whatever as sub-packages
>> of a same app, and doing so afterward will probably be more painful
>> than designing it right from the start, but in both cases it has the
>> benefit that it forces you to think about dependancies management,
>> which can greatly helps when it comes to maintainance.
> 
> Ok, I see your point, but still -  there`s nothing about this in the
> main django documentation as far as I know. The docs should have a
> section about organizing projects where the standard models.py and
> views.py doesn`t fit anymore.
> 
I think the point is to learn enough Python that you don't need
Django-specific advice.

[Thinks: definitely time for a "Python for Djangonauts" class].

regards
 Steve

-- 
DjangoCon US 2010 September 7-9 http://djangocon.us/

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Django 1.2.1. admin WYSIWYG editor

2010-09-27 Thread Sithembewena Lloyd Dube
Thanks everyone, got it right.

On Wed, Sep 22, 2010 at 8:31 PM, tricks...@googlemail.com <
p...@hotmail.co.uk> wrote:

> What do you have in your settings.py?
>
> Make Sure you have the following configs
>
> TINYMCE_JS_URL (default: settings.MEDIA_URL + 'js/tiny_mce/
> tiny_mce.js')
> TINYMCE_JS_ROOT (default: settings.MEDIA_ROOT + 'js/tiny_mce')
> TINYMCE_DEFAULT_CONFIG (default: {'theme': "simple", 'relative_urls':
> False})
> TINYMCE_SPELLCHECKER (default: False)
> TINYMCE_COMPRESSOR (default: False)
> TINYMCE_FILEBROWSER (default: True if 'filebrowser' is in
> INSTALLED_APPS, else False)
>
> An Example would be like this
>
> TINYMCE_JS_URL = 'http://debug.example.org/tiny_mce/tiny_mce_src.js'
> TINYMCE_DEFAULT_CONFIG = {
>'plugins': "table,spellchecker,paste,searchreplace",
>'theme': "advanced",
> }
> TINYMCE_SPELLCHECKER = True
> TINYMCE_COMPRESSOR = True
>
> If you do it this way you shouldnt have to set anything in model Admin
> every placeholder you call should automatically have widgets. Make
> sure you have the correct plugins in TINYMCE_DEFAULT_CONFIG as well. I
> tend not to use the compressor or spellchecker. thats just me. try it
> by commenting the plugins line out first. Im new to django but i had
> problems with tinyMCE and this sorted it. Hope it helps. Sorry if it
> does not.
>
> maybe try
>
> http://django-tinymce.googlecode.com/svn/tags/release-1.5/docs/.build/html/installation.html
> or letting people know what you have in settings.py
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>


-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SITE_ID

2010-09-27 Thread Tim Sawyer
> On 25/09/2010 18:32, Tim Sawyer wrote:
>> On 25/09/10 15:57, craphunter wrote:
>>> Yes, I have read it, but I don't really get it. What is the meaning of
>>> it?
>>
>> Consider a website that has multiple blogs, all of which are deployed to
>> the same database.
>>
>> Consider that you want each blog to be a separate URL: www.blog1.com,
>> www.blog2.com, but you only want one database for ease of backing up
>> etc.
>>
>> So, you have one codebase, one database, but multiple sites.
>>
>> You can achieve this using SITE_ID.  www.blog1.com has a settings.py
>> with SITE_ID = 1.  www.blog2.com has a settings.py file with SITE_ID =
>> 2.  In your database, there are two rows in the django_site database
>> table, with serials 1 and 2.  The table that holds the blog entries has
>> a foreign key to Site, and so identifies which site the blog post
>> appears on.
>>
>> At least that's how I used it...hope that helps clarify it a bit!
>>
>> Tim.
>
> Hey Tim,
>
> the way you used it would mean that you had different settings.py per
> site/url and thus
> a project per url as 1 project can only have 1 settings file? Is this
> correct?
> Have do you config the admin then so you see both sites in the same admin?

Hi Benedict,

Yes that's correct.  Each settings.py is a separate virtual host in
Apache.  The rest of the source was common (on the pythonpath).  So the
pythonpath was the same for each virtual host but there was a uniquely
named settings.py refered to from the mod-wsgi config.

These were distinct sites for distinct customers, so each site had its own
admin, limited to that site's data.

Here's the mechansim I used to limit the admin to that site's objects.  I
think if you don't do any of this, each admin will have all the data
available in it, if that's what you want.

Each model had an additional manager:

from django.contrib.sites.managers import CurrentSiteManager

class Contest(models.Model):
...
objects = models.Manager()
on_site = CurrentSiteManager()

and in the admin.py I redefined the queryset:

class ContestAdmin(SiteOnlyAdmin):
def queryset(self, request):
return self.limitQueryset(request, Contest)

admin.site.register(Contest, ContestAdmin)

where limitQueryset is defined on the superclass as:

def limitQueryset(self, request, pObject):
return pObject.on_site.all()

Hope that helps,

Tim.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread bruno desthuilliers
On 27 sep, 10:57, Thomas Weholt  wrote:
> Ok, I see your point, but still -  there`s nothing about this in the
> main django documentation as far as I know. The docs should have a
> section about organizing projects where the standard models.py and
> views.py doesn`t fit anymore.

FWIW, the first solution - refactoring modules into apps - is common
Python knowledge, and the second - refactoring into smallest apps - is
obviously encouraged by Django's philosophy, even if there are
currently some discussions about the django app as a reuseable unit.
Also, I've yet to see any framework / language / whatever
documentation mentionning any useful guideline wrt/ project's
growth !-)

Now to the point : the fact is there's no hard rule here, and it kinda
depends on your own project AND personal tastes. For some projects -
even big ones - it makes more sense to keep most of the code in the
same app and refactor modules into packages, because there's just too
much intricacy to allow for anye sane decoupling. For some other apps,
you'll easily spot a "core" part everything else depends upon and a
number of "modules" (in the generic - not Python - meaning) that
depends on the core but not on each other.  You'll often find yourself
using third-parts "pluggable" apps too, so you often need an extra
"main" app taking care of the integration of your own apps and third-
part ones.

But really, this all boils down to dependancies management, and as
such is neither specific to Django nor Python.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Piotr Zalewa
 On 09/27/10 09:57, Thomas Weholt wrote:
> On Mon, Sep 27, 2010 at 10:38 AM, bruno desthuilliers
>  wrote:
>> Using the package's __init__.py as a facade is certainly not "hackish"
>> - it's one of - if not the main - the raison d'être of this file.
>>
>> Now if your app is really growing that big, it's probably time to
>> refactor it into a set of related, more specialized apps. It's not as
>> easy as just splitting the models / views / whatever as sub-packages
>> of a same app, and doing so afterward will probably be more painful
>> than designing it right from the start, but in both cases it has the
>> benefit that it forces you to think about dependancies management,
>> which can greatly helps when it comes to maintainance.
> Ok, I see your point, but still -  there`s nothing about this in the
> main django documentation as far as I know. The docs should have a
> section about organizing projects where the standard models.py and
> views.py doesn`t fit anymore.
>

It's not there as it's a plain Python feature. Please read about it on
Python site here - http://docs.python.org/tutorial/modules.html#packages.

I've no idea if there are links to Python docs in the first djangobook
chapter or on the Django's Introduction page.
If such feature should be explained on Django docs, every other Python
feature should be there as well.

We come to this pretty often in MooTools community - it has to clearly
be said that framework is just extending the language.

Regards
Piotr Zalewa

-- 
blog  http://piotr.zalewa.info
jobs  http://webdev.zalewa.info
twit  http://twitter.com/zalun
face  http://facebook.com/zaloon

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Benedict Verheyen
On 27/09/2010 9:08, MrMuffin wrote:
> Where do you put your business logic in django? In my project I`ve put
> it into the models.py, but that file soon become huge and hard to
> maintain. Of course I can just stuff it into whatever file I like, but
> I`d like to have some standard way of doing this. There seems to be
> something missing in django when it comes to business logic. It`s all
> model, views and templates and that`s all great for small projects,
> but both the models.py and views.py very soon gets huge and how do you
> re-organize your project when that happens? Splitting views and models
> into seperate files is only a partial solution and that requires some
> hackish code in __init__.py to make syncdb etc work. And then there`s
> urls.py.
> 
> Should there be a better and standardized way to organize huge
> projects in django?
> 
> Thanks for your time.
> 

I would also like the Django guru's to come up with a best practices page.
Just ideas of how you could structure code for this or that kind of project.
You certainly can't cover all bases but at least it could serve as a starting 
point.

On a related note, there is a thread about the SITE_ID.
I can see how multiple sites can be managed from a single project but 1 project
means 1 settings.py file so it's not clear to me how you can then use the 
SITE_ID.

Anyway, as for structuring my code, I always end up splitting my models and 
views
and as Bruno pointed out, using __init__.py isn't hackish but takes a bit 
getting used too.
It's actually a nice Python feature.
Dealing with a few smaller files is in my opinion more logical, cleaner and 
makes
it faster to solve problems if they arise.

Putting your business logic in your models is the preferred way it seems.
If you have other code like utilities that aren't bound to http or django 
specific,
i would put them in a another directory, make it package and install it so
you can use it in any code/project.

I have a big project that i'm working on and i'm putting all application 
related code,
media and templates included, in the application directory.
To me, it makes more sense to do it like this than to have a single template 
directory
with sub directories for every application.
This ties the apps into the project and i want to avoid this is possible so 
reusing
the applications should be easier.

Regards,
Benedict




-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Thomas Weholt
On Mon, Sep 27, 2010 at 10:38 AM, bruno desthuilliers
 wrote:
> On 27 sep, 09:08, MrMuffin  wrote:
>> Where do you put your business logic in django?
>
> Depends on the definition of "business logic", but :
>
>> In my project I`ve put
>> it into the models.py,
>
> That's also what I tend to do for anything that's not a pure utility
> class or function and that's not strictly tied to the HTTP request /
> response cycle.
>
>> but that file soon become huge and hard to
>> maintain.
>
>
> Then refactor your "models.py" module into a package.
>
>> Of course I can just stuff it into whatever file I like, but
>> I`d like to have some standard way of doing this. There seems to be
>> something missing in django when it comes to business logic. It`s all
>> model, views and templates and that`s all great for small projects,
>> but both the models.py and views.py very soon gets huge and how do you
>> re-organize your project when that happens? Splitting views and models
>> into seperate files is only a partial solution and that requires some
>> hackish code in __init__.py to make syncdb etc work.
>
> Using the package's __init__.py as a facade is certainly not "hackish"
> - it's one of - if not the main - the raison d'être of this file.
>
> Now if your app is really growing that big, it's probably time to
> refactor it into a set of related, more specialized apps. It's not as
> easy as just splitting the models / views / whatever as sub-packages
> of a same app, and doing so afterward will probably be more painful
> than designing it right from the start, but in both cases it has the
> benefit that it forces you to think about dependancies management,
> which can greatly helps when it comes to maintainance.

Ok, I see your point, but still -  there`s nothing about this in the
main django documentation as far as I know. The docs should have a
section about organizing projects where the standard models.py and
views.py doesn`t fit anymore.

-- 
Mvh/Best regards,
Thomas Weholt
http://www.weholt.org

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: SITE_ID

2010-09-27 Thread Benedict Verheyen
On 25/09/2010 18:32, Tim Sawyer wrote:
> On 25/09/10 15:57, craphunter wrote:
>> Yes, I have read it, but I don't really get it. What is the meaning of
>> it?
> 
> Consider a website that has multiple blogs, all of which are deployed to the 
> same database.
> 
> Consider that you want each blog to be a separate URL: www.blog1.com, 
> www.blog2.com, but you only want one database for ease of backing up etc.
> 
> So, you have one codebase, one database, but multiple sites.
> 
> You can achieve this using SITE_ID.  www.blog1.com has a settings.py with 
> SITE_ID = 1.  www.blog2.com has a settings.py file with SITE_ID =
> 2.  In your database, there are two rows in the django_site database table, 
> with serials 1 and 2.  The table that holds the blog entries has
> a foreign key to Site, and so identifies which site the blog post appears on.
> 
> At least that's how I used it...hope that helps clarify it a bit!
> 
> Tim.

Hey Tim,

the way you used it would mean that you had different settings.py per site/url 
and thus
a project per url as 1 project can only have 1 settings file? Is this correct?
Have do you config the admin then so you see both sites in the same admin?

Regards,
Benedict


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread bruno desthuilliers
On 27 sep, 09:08, MrMuffin  wrote:
> Where do you put your business logic in django?

Depends on the definition of "business logic", but :

> In my project I`ve put
> it into the models.py,

That's also what I tend to do for anything that's not a pure utility
class or function and that's not strictly tied to the HTTP request /
response cycle.

> but that file soon become huge and hard to
> maintain.


Then refactor your "models.py" module into a package.

> Of course I can just stuff it into whatever file I like, but
> I`d like to have some standard way of doing this. There seems to be
> something missing in django when it comes to business logic. It`s all
> model, views and templates and that`s all great for small projects,
> but both the models.py and views.py very soon gets huge and how do you
> re-organize your project when that happens? Splitting views and models
> into seperate files is only a partial solution and that requires some
> hackish code in __init__.py to make syncdb etc work.

Using the package's __init__.py as a facade is certainly not "hackish"
- it's one of - if not the main - the raison d'être of this file.

Now if your app is really growing that big, it's probably time to
refactor it into a set of related, more specialized apps. It's not as
easy as just splitting the models / views / whatever as sub-packages
of a same app, and doing so afterward will probably be more painful
than designing it right from the start, but in both cases it has the
benefit that it forces you to think about dependancies management,
which can greatly helps when it comes to maintainance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Thomas Weholt
On Mon, Sep 27, 2010 at 10:07 AM, Mike Dewhirst  wrote:
> On 27/09/2010 5:08pm, MrMuffin wrote:
>>
>> Where do you put your business logic in django? In my project I`ve put
>> it into the models.py, but that file soon become huge and hard to
>> maintain. Of course I can just stuff it into whatever file I like, but
>> I`d like to have some standard way of doing this. There seems to be
>> something missing in django when it comes to business logic. It`s all
>> model, views and templates and that`s all great for small projects,
>> but both the models.py and views.py very soon gets huge and how do you
>> re-organize your project when that happens? Splitting views and models
>> into seperate files is only a partial solution and that requires some
>> hackish code in __init__.py to make syncdb etc work. And then there`s
>> urls.py.
>>
>> Should there be a better and standardized way to organize huge
>> projects in django?
>
> I hope some dguru answers this because it is important.
>
> I reckon business rules should be in models.py because that represents the
> database and I've always thought that is where the business rules belong for
> the sake of data integrity.
>
> There is probably nothing wrong with multiple model files named for the
> tables in the app if you want to keep them small. You might want to import
> them 'from app import table_x.table_x as table_x'. Bit ugly I suppose - this
> is really why it makes lotsa sense to split a big project up.
>
> Business logic is different than business rules. That is simply the
> application logic and that probably belongs in views.py but there is nothing
> stopping you importing stuff from app_logic.py which can import stuff from
> big_project.py.
>
> If it is a giant project you probably ought to split it into smaller apps
> each of which is focused on a self-contained subset of your entire
> functionality. That way, you might be able to put parts of it on sourceforge
> and I can use it :)
>
> Mike
>
>>
>> Thanks for your time.

Stuffing logic and huge amounts of code into models.py sounds like a
terrible idea. It doesn`t belong in views.py either. In a simple app
this works fine, but not for larger projects. There might be at least
two different ways to handle this; 1) like one guy points out - it`s
up to the developer to choose or 2) try to get the django
community/core dev/etc to come up with a more standard way of doing
it. I`m probably more in support of the second option.

Almost all of my projects start quite small, but outgrown one
models.py and one views.py rather quick. And that`s not even thinking
of all the business logic, just plain data models and views. So what
do I do?

Thanks for all your input anyway :-)

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



notification in python

2010-09-27 Thread harryos
hi
Is there an opensource notification utility in python/django?I mean,
something I can use to know when a website updates a page?
If someone knows about one,please let me know
thanks
harry

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Accessing schemas in django

2010-09-27 Thread Mike Dewhirst

On 27/09/2010 4:53pm, Jean-Pierre De Villiers wrote:

Hi,
Is there a way to access an existing database schema in Django?
Any help would be appreciated!


google for 'existing schema django'



J



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Mike Dewhirst

On 27/09/2010 5:08pm, MrMuffin wrote:

Where do you put your business logic in django? In my project I`ve put
it into the models.py, but that file soon become huge and hard to
maintain. Of course I can just stuff it into whatever file I like, but
I`d like to have some standard way of doing this. There seems to be
something missing in django when it comes to business logic. It`s all
model, views and templates and that`s all great for small projects,
but both the models.py and views.py very soon gets huge and how do you
re-organize your project when that happens? Splitting views and models
into seperate files is only a partial solution and that requires some
hackish code in __init__.py to make syncdb etc work. And then there`s
urls.py.

Should there be a better and standardized way to organize huge
projects in django?


I hope some dguru answers this because it is important.

I reckon business rules should be in models.py because that represents 
the database and I've always thought that is where the business rules 
belong for the sake of data integrity.


There is probably nothing wrong with multiple model files named for the 
tables in the app if you want to keep them small. You might want to 
import them 'from app import table_x.table_x as table_x'. Bit ugly I 
suppose - this is really why it makes lotsa sense to split a big project up.


Business logic is different than business rules. That is simply the 
application logic and that probably belongs in views.py but there is 
nothing stopping you importing stuff from app_logic.py which can import 
stuff from big_project.py.


If it is a giant project you probably ought to split it into smaller 
apps each of which is focused on a self-contained subset of your entire 
functionality. That way, you might be able to put parts of it on 
sourceforge and I can use it :)


Mike



Thanks for your time.



--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Accessing schemas in django

2010-09-27 Thread Nabil Servais

 Hello,


Le 27/09/2010 08:53, Jean-Pierre De Villiers a écrit :

Hi,
Is there a way to access an existing database schema in Django?
Any help would be appreciated!

J




You can use the inspectdb option of the project manager, you will find 
more information in the official documentation :


http://docs.djangoproject.com/en/dev/ref/django-admin/?from=olddocs

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Subhranath Chunder
Sometimes I put it in some 'utils.py' in the app directory, and sometimes in
'views.py' itself, with leading underscores, whichever I feel is more
appropriate.

I guess this would be more of the developer's choice. Any better
suggestions?

Thanks,
Subhranath Chunder.

On Mon, Sep 27, 2010 at 12:43 PM, Antoni Aloy  wrote:

> 2010/9/27 MrMuffin :
> > Where do you put your business logic in django? In my project I`ve put
> > it into the models.py, but that file soon become huge and hard to
> > maintain. Of course I can just stuff it into whatever file I like, but
> > I`d like to have some standard way of doing this. There seems to be
> > something missing in django when it comes to business logic. It`s all
> > model, views and templates and that`s all great for small projects,
> > but both the models.py and views.py very soon gets huge and how do you
> > re-organize your project when that happens? Splitting views and models
> > into seperate files is only a partial solution and that requires some
> > hackish code in __init__.py to make syncdb etc work. And then there`s
> > urls.py.
> >
> > Should there be a better and standardized way to organize huge
> > projects in django?
> >
> > Thanks for your time.
> >
>
> Django allows you to split your project in applications, and Django
> applications are quite linked to models. But you can create your own
> libraries, this is Python. As an example, we create applications to
> connect to different web services and we use Django in the project.
> Each web service mapping is in its own Python packages. The Django
> urls and views just uses that package.
>
> Hope it helps!
>
> --
> Antoni Aloy López
> Blog: http://trespams.com
> Site: http://apsl.net
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Where do you put your business logic in django? Organizing big projects in django.

2010-09-27 Thread Antoni Aloy
2010/9/27 MrMuffin :
> Where do you put your business logic in django? In my project I`ve put
> it into the models.py, but that file soon become huge and hard to
> maintain. Of course I can just stuff it into whatever file I like, but
> I`d like to have some standard way of doing this. There seems to be
> something missing in django when it comes to business logic. It`s all
> model, views and templates and that`s all great for small projects,
> but both the models.py and views.py very soon gets huge and how do you
> re-organize your project when that happens? Splitting views and models
> into seperate files is only a partial solution and that requires some
> hackish code in __init__.py to make syncdb etc work. And then there`s
> urls.py.
>
> Should there be a better and standardized way to organize huge
> projects in django?
>
> Thanks for your time.
>

Django allows you to split your project in applications, and Django
applications are quite linked to models. But you can create your own
libraries, this is Python. As an example, we create applications to
connect to different web services and we use Django in the project.
Each web service mapping is in its own Python packages. The Django
urls and views just uses that package.

Hope it helps!

-- 
Antoni Aloy López
Blog: http://trespams.com
Site: http://apsl.net

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Accessing schemas in django

2010-09-27 Thread Jean-Pierre De Villiers
Hi,
Is there a way to access an existing database schema in Django?
Any help would be appreciated!

J

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Upload a File using the request.POST data

2010-09-27 Thread Sam Lai
On 27 September 2010 14:31, Danny Bos  wrote:
> There is no form, it's entirely Javascript.
> Spoke to the creator of the script, who has popped up script examples
> for PHP and ColdFusion he reckons:
>
> "You basically have to put the whole post contents into a file."

Hmm... a little difficult seeing as Django parses the POST contents
into a string first, so it has probably done irreversible things to
it.

There is HttpRequest.raw_post_data though, but not sure what format
that is in. If it is just bytes, you could just stream that to
wherever you need it to be.

> Not altogether helpful, eh?
>
> d
>
>
> On Sep 27, 1:52 pm, Sam Lai  wrote:
>> Have you got the right attribute in the form?
>>
>> Fromhttp://docs.djangoproject.com/en/dev/topics/http/file-uploads/
>>
>> "Note that request.FILES will only contain data if the request method
>> was POST and the  that posted the request has the attribute
>> enctype="multipart/form-data". Otherwise, request.FILES will be
>> empty."
>>
>> On 27 September 2010 13:21, Danny Bos  wrote:
>>
>> > Can it even be done?
>> > It seems pretty ordinary but everything I'm trying expects it to be a
>> > request.FILE.
>>
>> > Frustrating stuff.
>>
>> > d
>>
>> > On Sep 27, 11:24 am, Danny Bos  wrote:
>> >> Heya,
>>
>> >> I'm using the 'Valums File Uploader' which passes the file in the
>> >> request.POST as you can see below. I'm wondering how to get that data
>> >> into an actual file. Any ideas would be great as things like "for
>> >> chunk in f.chunks()" only works on request.FILES which in this case is
>> >> empty.
>>
>> >> Thanks,
>> >> Hope all is well your side of the planet.
>>
>> >> Eg DATA:
>>
>> >> GET:,
>> >> POST:> >> \ufffd\x03\ufffd\x05\ufffd\ufffd\ufffdC\ufffdC\x1b\ufffd\ufffd\x0f/
>> >> \x1eY:\ufffdZ\ufffd \ufffd8': [u''], u'5]]\x1f\u04ff\x7f\ufffd\ufffd
>> >> \ufffd\x0f\x054\x15\u0622i\x1c\ufffd(\ufffdG\x01 \ufffd\x03u
>> >> \x05\ufffdL]b*\x002\x18PW\x00\ufffd\ufffd%\ufffd\x02 \ufffd\x01u
>> >> \x05\ufffdL]b*\x002\x18PW\x00\ufffd\ufffd%\ufffd\x02 \ufffd\x01u
>> >> \x05\ufffdL]b*\x002\x18PW\x00\ufffd\ufffd%\ufffd\x02 \ufffd\x01u
>> >> \x05\ufffdL]b*\x002\x18PW\x00\ufffd\ufffd%\ufffd\ufffd\ufffd\ufffd$X]]
>> >> \u0775k\ufffd\ufffd\ufffd\ufffd\ufffd\ufffdt\ufffd_2\x13\ufffd\u01cf
>> >> \x1fkkk\ufffd\ufffd\ufffdUe\ufffd\ufffd\ufffd\ufffdt2\u04ef\x1f?~|
>> >> \ufffd\u0529\ufffd\ufffd$\ufffdx}\ufffd\ufffd*\ufffdNw9': [u''],
>> >> u'\uff ... Etc ...
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "Django users" group.
>> > To post to this group, send email to django-us...@googlegroups.com.
>> > To unsubscribe from this group, send email to 
>> > django-users+unsubscr...@googlegroups.com.
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/django-users?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: In admin, is there a post-commit hook that is executed after all models and inlines are saved?

2010-09-27 Thread Subhranath Chunder
Hi,

Since you have already done what you required, I'm not going much into
detail, but your process basically looks pretty lengthy.

Normally, to do these sort of stuff I only override two ModelAdmin methods:
- save_model()
- save_formset()

Using them together normally serves any kind of purpose, and the code looks
cleaner too. Maybe you can try with experimenting them out sometime.

Thanks,
Subhranath Chunder.

On Mon, Sep 27, 2010 at 8:19 AM, jonathan.morgan <
jonathan.morgan@gmail.com> wrote:

> Update:
>
> Well, I cobbled together a few things to accomplish most of what I
> needed to accomplish, and figured I'd write it down here so I can look
> it up later and so others can learn from it (the doc on m2m_changed,
> in particular, is not incomplete, but not detailed or particularly
> precise, and I had trouble finding a good example).
>
> The event to event_date relation was one-to-many, so there is a model
> for event dates that contains the key to each date's related event.
> For these, I overrode the save and delete methods for the event_dates
> model so it notifies the related event when any related date is added,
> changed, or deleted, after the actual save on insert, update, or
> delete, so the related event (which is still present in the instance
> even on delete, though the relation no longer exists in the database)
> can invoke a method that accepts the date and checks if it potentially
> needs to re-calculate its overall start and end dates from the
> database based on where the date lies in relation to its current start
> and end dates.  Part of the problem I was running into is that the
> internal set of event_dates for an event were not getting updated as
> updates from the admin screen were getting processed.  The database is
> updated, though, and so the event can query the database for updated
> dates and update its start and end date accurately even though its
> internal Set representation of associated dates gets out of sync.
>
> For the ManyToMany, I ended up being able to use the m2m_changed
> signal combined with overriding the save and delete on the right-hand
> side of the m2m relationship to let the event know that something had
> changed, and so it should rebuild its cached list of series and
> providers.  First, a few notes on what precisely the m2m_changed
> signal passes:
>
> - sender: Python new-class Type instance for the django-generated
> "through" class that connects the two models (Event.presenters.through
> and Event.series.through in this case).
>
> - instance: an instance of the model that contains the ManyToManyField
> relationship (Event, in this case).
>
> - model: Python new-class Type instance for the class of the model
> that is on the right side of the M2M relationship, joined by the
> "through" class that is in the "sender" parameter (Series and
> Presenter model classes in the two functions below).
>
> - action - either "pre_add"/"post_add" or
> "pre_clear"/"post_clear" ("pre_remove" and "post_remove" are never
> sent by the admin, as far as I can tell, since it just clears all
> relations each time a record is saved, then adds in relations again
> that still are present - not perhaps how I would have done it, but
> efficient).
>
> Because of how django admin implements processing changes to m2m
> relations (clear all, then re-add all that are present in form submit)
> m2m_changed doesn't actually tell you how the relation changed (so no
> signals for things getting removed, and no good signals on "add"
> versus "still here"), so I had to just use these signals to let the
> event know something had changed with a given set of relations, and
> have it call a method to update itself from the database to figure out
> what had changed and take the changes into account.  This worked, but
> wasn't quite as targeted as it could be if admin actually passed
> m2m_changed signals for removal, and didn't pass add signals for
> relations that were unchanged.
>
> I also limited the event listeners to only the "through" senders I
> cared about (see code sample below for accessing a "through" class -
> import the class that contains the ManyToManyField, then reference
> "class_name"."m2m_field_name".through).  Here is the code I ended up
> with for registering the signals (in my models.py file, so the Event
> class is already there, doesn't need to be imported, and including the
> debug and logging code I used to figure much of this out):
>
> # imports for handling signals that ManyToMany relations have changed.
> from django.db.models.signals import m2m_changed
> from django.dispatch import receiver
>
> @receiver( m2m_changed, sender = Event.series.through )
> def process_event_series_updates( sender, **kwargs_IN ):
>
># declare variables
>instance_IN = None #-- kwargs_IN[ "instance" ]
>action_IN = '' #-- kwargs_IN[ "action" ] - from
> http://docs.djangoproject.com/en/dev/ref/signals/, will be either
> "pre_add", "post_add", "pre_remove", "post_remove",