Use Python to parse HTML and integrating said script into Django

2009-04-12 Thread Tonne
Hi I'm not too sure how to ask this correctly (not an experienced developer so my vocab is not very accurate), but I'll try. I have created a Python script (collection of functions) that generates a calendar of sorts, really just a long list of dates from a 4 year date range. It also parses the

Re: Business Logic Architecture Questions on Models & ModelManagers

2009-04-12 Thread Sean Neilan
Hey Malcolm, Thank you very much for your thoughts on those questions! I will definitely be referring to your advice when I'm writing this thing. I had been thinking about those questions when I was on spring break (about a week or so) and couldn't seem to reach a conclusion, but, I think I'll

Re: newbie question: django-registration

2009-04-12 Thread Praveen
You should change the site domain name example.com to 127.0.0.1:8000 check in your django-site table.. http://www.example.com/accounts/activate/ 637cd08106eea9b1139efd34a0fa79a5d7f90494/ for instance http://127.0.0.1:8000/accounts/activate/ 637cd08106eea9b1139efd34a0fa79a5d7f90494/ On Apr 13,

Re: Registration form and Profile form is not saving

2009-04-12 Thread Praveen
How the current user logging-in first while registration.. you mean to say after successfully registration the user must login automatically. On Apr 11, 7:55 pm, Praveen wrote: > Hi all, i am really fed up and have tried number of way. Please read > my last line

Re: how to use email instead of username for user authentication?

2009-04-12 Thread pkenjora
Malcolm, <- Remembered the 'l' this time! To keep things simple and avoid fragmenting this discussion into a million different dead end tit for tats , I'll try to reign in the main points. 1. The default authentication method in Django should have no inherent restrictions. Such as blocking

Re: Business Logic Architecture Questions on Models & ModelManagers

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 20:41 -0700, Sean Neilan wrote: > I'm building a large web application & I'm trying to figure out ways > to organize my business logic (just the queries). I figure I should > either put all my queries inside Model functions or ModelManager > functions. I've searched all over

Business Logic Architecture Questions on Models & ModelManagers

2009-04-12 Thread Sean Neilan
I'm building a large web application & I'm trying to figure out ways to organize my business logic (just the queries). I figure I should either put all my queries inside Model functions or ModelManager functions. I've searched all over the internet for documentation on where the business logic

Re: Question about administration

2009-04-12 Thread James Bennett
On Sun, Apr 12, 2009 at 9:31 PM, Joshua Williams wrote: > That was the nugget I was looking for.  I think that my use case falls > into the latter, which is currently not available.  Good news is, as > long as i only support 1 "working area" i should be ok. It's true that

Re: Question about administration

2009-04-12 Thread Joshua Williams
Thank you pointing me to these docs. In the link: > If that doesn't tickle your fancy, check out the following: > http://docs.djangoproject.com/en/dev/topics/auth/#permissions I found the following statement: For example, it's possible to say "Mary may change news stories," but it's not

Re: Mulitple Time Zone support?

2009-04-12 Thread Brian Neal
On Apr 12, 7:15 pm, ydjango wrote: > What is the best way to provide multiple Time zone support? Definitely check out the Python pytz module. > (Also where can I get list of all time zones to populate the  select > dropdown.) > There is almost 400 time zones in the

Re: Simple Query?

2009-04-12 Thread Karen Tracey
On Sun, Apr 12, 2009 at 8:24 PM, jrs_66 wrote: > > Thanks Karen, > > models are as follows... > > class MediaAndContainer(models.Model): >media = models.ForeignKey(MediaLocal) >order = models.FloatField(null=True, blank=True) >... > > class MediaLocal(models.Model):

Re: Fwd: Default ManyToMany ordering

2009-04-12 Thread R. Gorman
If it's for the admin interface the admin option ordering (http:// docs.djangoproject.com/en/dev/ref/contrib/admin/#ordering) might do the trick. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group.

Re: Simple Query?

2009-04-12 Thread R. Gorman
The easiest answer is your foreignkey is pointing the wrong way. With your current model definitions you could do MediaAndContainer.objects.select_related('name'). To go in the opposite direction you need to use _set (http://docs.djangoproject.com/

Re: Send validation error message to the screen

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 17:22 -0700, Joshua Partogi wrote: > Thanks Malcolm, > > What I'm looking after is sending my custom validation error message > that is not covered by django. But what does this mean? How is it different from passing any other piece of information to a template via the

Re: Mulitple Time Zone support?

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 17:15 -0700, ydjango wrote: > What is the best way to provide multiple Time zone support? > > The registered user visiting the website should see all times and > dates as per his/her time zone and not as per time zone in > settings.py? If I were doing this, I'd create a

Re: Simple Query?

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 14:06 -0700, jrs_66 wrote: [...] > On a broader level, is Django's ORM intended for people who don't know > how to write SQL? It seems that many hoops have to be jumped through > to get basic SQL results... I think that impression is probably only because you're still

Re: Simple Query?

2009-04-12 Thread jrs_66
Thanks Karen, models are as follows... class MediaAndContainer(models.Model): media = models.ForeignKey(MediaLocal) order = models.FloatField(null=True, blank=True) ... class MediaLocal(models.Model): name = models.CharField(max_length=255, blank=True) height =

Re: Send validation error message to the screen

2009-04-12 Thread Joshua Partogi
Thanks Malcolm, What I'm looking after is sending my custom validation error message that is not covered by django. Thank you very much On Apr 13, 10:15 am, Malcolm Tredinnick wrote: > On Sun, 2009-04-12 at 23:37 +1000, Joshua Partogi wrote: > > Dear all, > > > I

Re: Mulitple Time Zone support?

2009-04-12 Thread Alex Gaynor
On Sun, Apr 12, 2009 at 8:15 PM, ydjango wrote: > > What is the best way to provide multiple Time zone support? > > The registered user visiting the website should see all times and > dates as per his/her time zone and not as per time zone in > settings.py? > > We will keep

Re: Does Django use persistent DB connection?

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 06:39 -0700, Continuation wrote: > I can't find any info on that in the doc. > > Does that mean DB connections are not reused? If so, why? Seeing how > establishing DB connection is a pretty expensive operation I'd think > it makes sense to reuse them. One connection per

Re: Send validation error message to the screen

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 23:37 +1000, Joshua Partogi wrote: > Dear all, > > I want to send and display validation error message from the view to > the template, how do I do this in Django? I tried searching on the > documents but could not find any topics on error message. Could anyone > give me a

Mulitple Time Zone support?

2009-04-12 Thread ydjango
What is the best way to provide multiple Time zone support? The registered user visiting the website should see all times and dates as per his/her time zone and not as per time zone in settings.py? We will keep user's time zone in our database. Dates and times will be stored in Mysql DB and I

Re: Simple Query?

2009-04-12 Thread Karen Tracey
On Sun, Apr 12, 2009 at 5:06 PM, jrs_66 wrote: > > Hi, > > I'm new to django, but not new to SQL. I have a (seemingly) trivial > query to run. In SQL it looks like- > > SELECT media.*, media_and_containers.order > FROM media > INNER JOIN media_and_containers ON >media.id

Re: Strange issue with session not being saved

2009-04-12 Thread Julien Phalip
On Apr 13, 9:43 am, Julien Phalip wrote: > Hi, > > I've implemented and ajax upload progress bar and I've got a strange > issue with sessions. I've reused the exact same code from another > project where it works perfectly, so I assume there is some kind of > configuration

Strange issue with session not being saved

2009-04-12 Thread Julien Phalip
Hi, I've implemented and ajax upload progress bar and I've got a strange issue with sessions. I've reused the exact same code from another project where it works perfectly, so I assume there is some kind of configuration problem. Any hint on how to debug this would be very welcome. Basically,

Re: Simple Query?

2009-04-12 Thread jrs_66
Thanks for the tip, however, it doesn't really help me out. I've read the docs, repeatedly, my problem is that I can't seem to get data from a related table (see my question above). Thanks On Apr 12, 7:00 pm, Ovnicraft wrote: > 2009/4/12 jrs_66 > > > >

Re: Simple Query?

2009-04-12 Thread Ovnicraft
2009/4/12 jrs_66 > > Hi, > > I'm new to django, but not new to SQL. I have a (seemingly) trivial > query to run. In SQL it looks like- > > SELECT media.*, media_and_containers.order > FROM media > INNER JOIN media_and_containers ON >media.id =

Simple Query?

2009-04-12 Thread jrs_66
Hi, I'm new to django, but not new to SQL. I have a (seemingly) trivial query to run. In SQL it looks like- SELECT media.*, media_and_containers.order FROM media INNER JOIN media_and_containers ON media.id = media_and_containers.media_id WHERE media.id = 1 In the django ORM I think it

Re: newbie question: django-registration

2009-04-12 Thread Angel Cruz
Eh, Never mind. Something is wrong with my root url (fixing the link from the email activated the account). I will fix it. On Sun, Apr 12, 2009 at 12:21 PM, MrBodjangles wrote: > Hi Folks and Happy Easter! > > OK, making slow but sure progress on learning Django. > > I

Re: Question about administration

2009-04-12 Thread Jacolyte
On Apr 12, 8:16 am, Karlw wrote: > Hey all, > > I had a general question about administration in Django.  So I do not > think my situation is unique, so I don't want to go out and make a > customer solution if there is already something out there. > > What i would like to

newbie question: django-registration

2009-04-12 Thread MrBodjangles
Hi Folks and Happy Easter! OK, making slow but sure progress on learning Django. I am using django-registration, have provided the simple templates required, and am to the point that a user can register (their usename, password, etc. get populated in the auth_user table of the PostgreSQL

Re: Question about administration

2009-04-12 Thread J. Williams
The main difference between "working areas" and the sites framework is that I would like to have a single login page. Also, this might be my lack of understanding of the site framework, but it seems that it's main focus is for separate domains to share information. The "work area" idea that I

Re: deletion of "distant" related objects

2009-04-12 Thread Margie
> For a model such as Book, you could iterate through > Book._meta.get_all_field_names(), call Book._meta.get_field_by_name() > for each name and look at the "direct" component of the returned result > to see which are the reverse relations. Those are then the things > pointing to your model.

Re: Question about administration

2009-04-12 Thread Andy Lei
http://docs.djangoproject.com/en/dev/ref/contrib/sites/#ref-contrib-sites is this what you're looking for? On Apr 12, 10:16 am, Karlw wrote: > Hey all, > > I had a general question about administration in Django.  So I do not > think my situation is unique, so I don't want

Re: Generic relations swamp

2009-04-12 Thread zayatzz
Admin for language: from kyss.front.models import lang from django.contrib import admin class FrontAdmin(admin.ModelAdmin): fieldsets = [ ('General info', {'fields': ['name', 'short', 'locale', 'encoding', 'url', 'fdef', 'bdef']}), ('SEO stuff', {'fields':

Fwd: Default ManyToMany ordering

2009-04-12 Thread Andy Lei
hi guys, let's say i have a ManyToMany relationship with an intermediary model; something like this: class Person(models.Model): name = models.CharField(max_length=128) class Group(models.Model): name = models.CharField(max_length=128) members = models.ManyToManyField(Person,

Re: Templates in models and i18n.

2009-04-12 Thread Poromenos
It's not an entire template, I'm just using the template system as an alternative to string formatting because of its name resolution capabilities. I found out how to do it, actually, I used ugettext instead of lazy an it works well! Poromenos On 12 Απρ 2009, at 19:52, Karen Tracey

Re: Templates in models and i18n.

2009-04-12 Thread Karen Tracey
On Sun, Apr 12, 2009 at 11:29 AM, Poromenos wrote: > > Hello, > I am trying to render a template in my models (to get the model > details in a printable format), but I want the template string to be > internationalised. ugettext_lazy does not return a string object, and >

doctest testing with templatefilters

2009-04-12 Thread Julian
hello, I am testing some of my filters with doctests. it's very easy, but I have to call the module with the filters manually: python /foo/bar/templatetags/eggs_extra.py -v to let the doctest run. Now I've added at the end of the egg.py the following code: def run_doctest(): import

Templates in models and i18n.

2009-04-12 Thread Poromenos
Hello, I am trying to render a template in my models (to get the model details in a printable format), but I want the template string to be internationalised. ugettext_lazy does not return a string object, and the template returns nothing. My code is: template = Template(_("{{ self.name }}"))

Question about administration

2009-04-12 Thread Karlw
Hey all, I had a general question about administration in Django. So I do not think my situation is unique, so I don't want to go out and make a customer solution if there is already something out there. What i would like to have happen would be to separate my site into "working areas", and

Re: Generic relations swamp

2009-04-12 Thread matehat
Hi, can you show us the code for each of your admin classes? This probably has something to do with some method overrides, but I can't say much about the cause of your problem from the error message you gave... Cheers Mathieu --~--~-~--~~~---~--~~ You received

Send validation error message to the screen

2009-04-12 Thread Joshua Partogi
Dear all, I want to send and display validation error message from the view to the template, how do I do this in Django? I tried searching on the documents but could not find any topics on error message. Could anyone give me a hint on how to do this? Thank you very much -- If you can't

Re: UnpickleableError when sessions are saved

2009-04-12 Thread matehat
As Alex pointed out, only picklable data can be put in the session. If you really need that ImagingCore object in the session, you have to make it somehow picklable by adding "__getstate__" and "__setstate__" method for picklability (see http://docs.python.org/library/pickle.html). Basically,

Does Django use persistent DB connection?

2009-04-12 Thread Continuation
I can't find any info on that in the doc. Does that mean DB connections are not reused? If so, why? Seeing how establishing DB connection is a pretty expensive operation I'd think it makes sense to reuse them. Any way to have persistent connection with Django?

usage of Django in Atlanta?

2009-04-12 Thread Tech Scout
What companies do you know of that are using Django in the Atlanta area? Marcel Duffoo --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

how to copy django session to tomcat?

2009-04-12 Thread yinminyinmin2005
HI,every body,i have a need: my searching system is doing by lucene,so i use tomcat,but all the other parts are running under django+apache+mod_python.now one user already has logined successful,but when he uses searching system,my site tells him that he had not logined, I knows it is beacause

Re: SQL Between query in sqlite3

2009-04-12 Thread Nalini
Thank you Alex On Apr 11, 11:47 am, Alex Gaynor wrote: > On Sat, Apr 11, 2009 at 2:44 AM, Kenneth Gonsalves > wrote: > > > > > On Saturday 11 April 2009 11:16:52 Nalini wrote: > > > select * from Table where dates BETWEEN '2009-01-01' AND  

Re: SQL Between query in sqlite3

2009-04-12 Thread Nalini
Hi Kg, Thank you very much On Apr 11, 11:44 am, Kenneth Gonsalves wrote: > On Saturday 11 April 2009 11:16:52 Nalini wrote: > > > select * from Table where dates BETWEEN '2009-01-01' AND  '2009-01-31' > >  Can any one help me? > >

Re: deletion of "distant" related objects

2009-04-12 Thread Malcolm Tredinnick
On Sun, 2009-04-12 at 00:40 -0700, Margie wrote: [...] > Let's say that my Publisher and Book classes are in one app, and that > app doesn't know anything about the readers. Is there any simple way > to find all related object fields that point to book and clear them > out, without having to

Re: deletion of "distant" related objects

2009-04-12 Thread Margie
I see. So then I think what you are saying is that if I want to avoid these "readers" getting deleted, prior to deleting my publisher I need to find all readers of the books publised by that publisher, and clear them out so that they are no longer readers of those books. Let's say that my

Re: deletion of "distant" related objects

2009-04-12 Thread Malcolm Tredinnick
On Sat, 2009-04-11 at 23:29 -0700, Margie wrote: > I am having some trouble with the deletion of related objects that are > multiple levels away from the object being deleted. I've read a bunch > of stuff written on deletion of related objects, but nothing on this > particular problem - hoping

Re: How to find the version of Django?

2009-04-12 Thread Alex Gaynor
On Sun, Apr 12, 2009 at 2:38 AM, ydjango wrote: > > How do I find which version of django I have on my server? > > > import django; print django.VERSION That should have a tuple with the version info. Alex -- "I disapprove of what you say, but I will defend to the death

How to find the version of Django?

2009-04-12 Thread ydjango
How do I find which version of django I have on my server? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from

deletion of "distant" related objects

2009-04-12 Thread Margie
I am having some trouble with the deletion of related objects that are multiple levels away from the object being deleted. I've read a bunch of stuff written on deletion of related objects, but nothing on this particular problem - hoping someone can help. Say I have a model like this: class

Re: Help! PNG file upload error...

2009-04-12 Thread higer
Thanks for your suggestion. But Python 2.5 already has zlib moudle. To png file,I wrote lines of code to save it first on disk and then handled the saved copy,then that works. I do not why there is some differencies between png file and file of other formats.The following is my code: