Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Mike Dewhirst
On 6/09/2010 4:19pm, kmpm wrote: I have a project running in a manufacturing industry that is actually built upon django. In this I need to generate a unique serial, batch or lot number (depending on what you would like to call it) that is a running number from 0 to whathever for each and every d

Launching Background Processes from a View

2010-09-06 Thread Heath
Hello All, I realize this has been discussed at some length, but the posts I found keep leading me back to the start, so I thought I'd try.. I currently have some python "worker" scripts that make great use pyInotify, an event based "watch" manager. When files arrive in a "hot folder", the correc

Having issue setting UP admin section in Dajngo

2010-09-06 Thread aliahsan
Hi All I am new to Django,I am sysadmin i am in migration a django based site to new server i have having following issue Can any one help me in this regards. Below is the error i am facing.Please let me know if you need any thing else from me. Page not found (404) Request Method: GE

Re: Having issue setting UP admin section in Dajngo

2010-09-06 Thread Kenneth Gonsalves
On Sun, 2010-09-05 at 22:29 -0700, aliahsan wrote: > 26. ^admin/(.*) this may be the offending line - which version of django are you using and which version of django was the app written for? -- regards Kenneth Gonsalves -- You received this message because you are subscribed to the Google Gro

Re: Launching Background Processes from a View

2010-09-06 Thread Aljoša Mohorović
On Mon, Sep 6, 2010 at 7:19 AM, Heath wrote: > What I require seems simple, just run the requested process in the > background. The terminal equivalent would be: > > "nohup &" and return control to the view. > > Any ideas on how to achieve this? if this already works in a shell is there some re

Re: what to do instead of adding to Query.extra_where ?

2010-09-06 Thread derek
On Sep 3, 2:10 am, Steve Holden wrote: > On 9/2/2010 1:44 AM, Paul Winkler wrote: > > > Hah. That was a pretty long message relative to how quickly I found > > the answer myself :-p > > Sorry for the noise. > > > For posterity, extra(where=...) is indeed the solution. I overlooked > > the obvious:

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread kmpm
On Sep 6, 9:02 am, Mike Dewhirst wrote: > On 6/09/2010 4:19pm, kmpm wrote: > > > I have a project running in a manufacturing industry that is actually > > built upon django. > > In this I need to generate a unique serial, batch or lot number > > (depending on what you would like to call it) that i

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Daniel Roseman
On Sep 6, 8:38 am, kmpm wrote: > On Sep 6, 9:02 am, Mike Dewhirst wrote: > > > > > > > On 6/09/2010 4:19pm, kmpm wrote: > > > > I have a project running in a manufacturing industry that is actually > > > built upon django. > > > In this I need to generate a unique serial, batch or lot number > >

Re: Having issue setting UP admin section in Dajngo

2010-09-06 Thread Ali Ahsan
Hi Thanks for replay Issue got solved when i added my hostname in setting.py. On Mon, Sep 6, 2010 at 12:10 PM, Kenneth Gonsalves wrote: > On Sun, 2010-09-05 at 22:29 -0700, aliahsan wrote: > > 26. ^admin/(.*) > > this may be the offending line - which version of django are you using > and which

Re: mod_wsgi, apache, windows XP

2010-09-06 Thread Graham Dumpleton
You can do that with mod_wsgi as well. Go to the mod_wsgi site and read the ConfigurationGuidelines page on the wiki. Sorry, can't paste link right now. Graham On Sep 6, 4:27 pm, Elim Qiu wrote: > I followed a installation instruction and got > Apache/2.2.15 (Win32) SVN/1.6.12 mod_wsgi/3.3 Pyth

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Mike Dewhirst
On 6/09/2010 5:38 PM, kmpm wrote: On Sep 6, 9:02 am, Mike Dewhirst wrote: On 6/09/2010 4:19pm, kmpm wrote: I have a project running in a manufacturing industry that is actually built upon django. In this I need to generate a unique serial, batch or lot number (depending on what you would like

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Tom Evans
On Mon, Sep 6, 2010 at 7:19 AM, kmpm wrote: > I have a project running in a manufacturing industry that is actually > built upon django. > In this I need to generate a unique serial, batch or lot number > (depending on what you would like to call it) that is a running number > from 0 to whathever

Re: Where and how should I write translations

2010-09-06 Thread Tom Evans
Never heard about google either? CLDR can hardly be a common acronym. Django has a complete implementation of internationalization. It knows how to extract translations from python files, from HTML files, from JS files and compile them into catalogues. You want to have django magically extract ad

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread kmpm
> > UUIDs are your best bet. Even if you generated 100 billion UUIDs a > second for the next 100 years, the chance of one collision would only > be 50% [1]. > > class ProducedEntity(models.Model): >     >     uuid = models.CharField(max_length=36, unique=True) > > def _hook_add_uuid(instance,

Re: AttributeError at /admin/ when logging into the default Admin site.

2010-09-06 Thread daniel.osterme...@gmail.com
>     This sounds suspicious to me. There is actually no "installation" > procedure for Python stuff. It's all about priority in the sys.path, or > PYTHON_PATH, environment variable. So you might experience glitches because > some bits of 1.2 are used together with some other bits of 1.0. > > C

Re: Pylons vs. Django

2010-09-06 Thread bruno desthuilliers
A few points: * It's as easy to swap components in Django as it is with Pylons. The main difference is that Django components are well integrated in the framework so 1/ you don't have much to do to use them and 2/ you loose some very usefull features - that just don't exist OOTB in Pylons - if you

Re: how do forms select language to render?

2010-09-06 Thread Aljosa Mohorovic
anybody here knows how forms select language for label localization? Aljosa -- 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 djang

GoFlow - anybody out there used it?

2010-09-06 Thread Steve Boyle
Hi, I've been writing an application that requires a workflow component and rather than build one from scratch looked around to see what was already out there. One app that was mentioned a number of times was "GoFlow" which apparently is based on "OpenFlow" a Zope product. It feels as though the

How do you avoid this race condition in Django?

2010-09-06 Thread Andy
I have a model MyModel that has a field expiration_datetime. Every time a user retrieves an instance of MyModel I need to first check if it has expired or not. If it has expired, than I need to increment some counter, update others, and then reset the expiration_datetime to some time in the future

Re: GoFlow - anybody out there used it?

2010-09-06 Thread Matias
El 06/09/10 14:23, Steve Boyle escribió: Hi, I've been writing an application that requires a workflow component and rather than build one from scratch looked around to see what was already out there. One app that was mentioned a number of times was "GoFlow" which apparently is based on "OpenFl

Re: AttributeError at /admin/ when logging into the default Admin site.

2010-09-06 Thread daniel.osterme...@gmail.com
I have now seen this happen with other data that has expired in the session. What I am seeing is that any key:value pair that times out when stored in the request.session is replaced by key:True Is this expected behaviour? -Daniel -- You received this message because you are subscribed to the

Re: how do forms select language to render?

2010-09-06 Thread Daniel Roseman
On Sep 5, 10:26 pm, Aljoša Mohorović wrote: > if django.utils.translation.get_language() and LANGUAGE_CODE returns > one language what does form.as_p use that it renders localized stuff > in another language? > > Aljosa Mohorovic Forms aren't special in any regard - they follow the usual rules f

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread kmpm
For anyone listening in... the ticket http://code.djangoproject.com/ticket/2705 might also be worth looking at On Sep 6, 11:39 am, kmpm wrote: > > UUIDs are your best bet. Even if you generated 100 billion UUIDs a > > second for the next 100 years, the chance of one collision would only > > be 50

XML sitemap not using correct domain name

2010-09-06 Thread Sithembewena Lloyd Dube
Hi all, I added a sitemap app to my Django 1.2.1. app to and when I browse to sitemap.xml on my development machine, Django does generate valid xml sitemap. However, it's using www.example.com/ in the generated links instead of my local IP address and port number. is this behaviour customisable wi

simplegeo / python-oauth2

2010-09-06 Thread ashy
Hi All, Iam using simplegeo / python-oauth2 to connect to twitter.com using python 2.6 and httplib2 getting the following error Exception Type: error Exception Value:(111, 'Connection refused') the line which is causing the problem is this: resp, content = client.request(reque

Re: How do you avoid this race condition in Django?

2010-09-06 Thread Jim
Maybe I'm not understanding the question but I'd freeze the row in the database, do the work, and then unfreeze the row. Jim -- 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

Re: XML sitemap not using correct domain name

2010-09-06 Thread Xavier Ordoquy
Hi, You need to edit de default site name and url. By default the site application creates an www.example.com site. Just log in the admin and change it. Regards, Xavier. Le 6 sept. 2010 à 16:58, Sithembewena Lloyd Dube a écrit : > Hi all, > > I added a sitemap app to my Django 1.2.1. app to a

Re: How to share Custom Template Tag in other APP?

2010-09-06 Thread funcrush
Thank you Daniel!! I'll try it!! :) On Sep 3, 8:45 pm, Daniel Roseman wrote: > On Sep 3, 9:27 am, funcrush wrote: > > > Hi, all. > > I wrote acustomtemplatetagpackage in aappthat named Blogs. > > And I madeotherappnamed SMS. > > But I don't know how to use thecustomtemplatetagthat located Blogs

Re: How do you avoid this race condition in Django?

2010-09-06 Thread Andy
How do I freeze a row in database? On Sep 6, 11:05 am, Jim wrote: > Maybe I'm not understanding the question but I'd freeze the row in the > database, do the work, and then unfreeze the row. > > Jim -- You received this message because you are subscribed to the Google Groups "Django users" gro

Re: XML sitemap not using correct domain name

2010-09-06 Thread Sithembewena Lloyd Dube
Thanks Xavier, works! On Mon, Sep 6, 2010 at 5:21 PM, Xavier Ordoquy wrote: > Hi, > > You need to edit de default site name and url. > By default the site application creates an www.example.com site. Just log > in the admin and change it. > > Regards, > Xavier. > > Le 6 sept. 2010 à 16:58, Sithe

Re: Django template : For Loop

2010-09-06 Thread Jagdeep Singh Malhi
> but is this correct way to get values from two tables and use in > templates? Me actually want to combine to tables and use there values in template Is the above post code is correct way to do this? Thanks -- You received this message because you are subscribed to the Google Groups "Django

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Preston Holmes
On Sep 6, 2:39 am, kmpm wrote: > First of all to everyone, thanks for all good suggestions so far. > > Regarding UUIDs, one of the business requirements (which I don't > control) is that the identifier that is to be used on barcodes and > what not is to be in the format "YYMMDD" where i

django-facebookconnect extended permissions breaks popup functionality.

2010-09-06 Thread tomfmason
Hi, I am using django-facebookconnect which worked as expected until I had to add extended permissions. I thought this would be a simple enough task but it is proving not to be at all. Basically I have made just a few small edits to the code in facebookconnect/templates/js.html and in facebookconn

Re: Launching Background Processes from a View

2010-09-06 Thread Heath
Thanks! yes, os.system() will launch the process and return control, but then I'd have to write a utility to get the PID and other data about the process. I guess I'm looking for a definitive answer that the built-in process modules cannot launch a process in the background. Here are my findings

django-friends | setup views.py with templates

2010-09-06 Thread justin jools
trying to setup simple social network have installed: registration, profiles, accoutns, messages but am stuck as how to setup/link the views.py to templates/ notification. I guess this is what is needed to be done. Any help much appreciated -- You received this message because you are subscribe

form model def save question

2010-09-06 Thread Rob B (uk)
Been struggling over at http://stackoverflow.com/questions/3652585/simple-django-form-model-save-question to get a solution. I want the inuse field to update to to True when LocationForm is saved. For example there would be a list of locations added by the admin (London, New York and Paris) all

Reverse lookup - models

2010-09-06 Thread Shamail Tayyab
Hi, I've a model something like this: class Article ( models.Model ): text = models.TextField () lasteditedby = models.ForeignKey ( User ) whenedited = models.DateTimeField ( default = datetime.datetime.now() ) class Topic ( models.Model ): name = models.CharField ( max_length =

Re: Django template : For Loop

2010-09-06 Thread Tim Chase
but is this correct way to get values from two tables and use in templates? Me actually want to combine to tables and use there values in template Is the above post code is correct way to do this? Combine the in the *view* with the zip() built-in, and use Steve's suggestion to split the part

Re: Reverse lookup - models

2010-09-06 Thread Daniel Roseman
On Sep 6, 6:27 pm, Shamail Tayyab wrote: > Hi, > >   I've a model something like this: > > class Article ( models.Model ): > >    text = models.TextField () >    lasteditedby = models.ForeignKey ( User ) >    whenedited = models.DateTimeField ( default = datetime.datetime.now() ) > > class Topic (

Re: Reverse lookup - models

2010-09-06 Thread Shamail Tayyab
On Mon, Sep 6, 2010 at 11:21 PM, Shamail Tayyab wrote: >> Each topic has *multiple* sections - that's the whole point of a >> ManyToMany relationship. >> >> You can iterate through the sections for each topic: >> >>    for topic in topics: >>        for section in topic.sections.all(): >>        

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread raj
Hi all, Why can't we use the aggregate function 'max' from within save()? I found it working to find the lot_max from among the objects filtered by prod_date and then if lot_max is None, lot_no must be 0, else it's just lot_max + 1. I don't know if I've misunderstood some requirement by the way.

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread kmpm
On Sep 6, 6:52 pm, Preston Holmes wrote: > > what about a simple function that does something as low tech as > checking a lock file.  If you had multiple front end servers, this > could be a running process on a server using semaphore lock. > > -Preston Sort of thought about that as well. Meanw

Re: Launching Background Processes from a View

2010-09-06 Thread kmpm
I have been using Celery some and from what I got I thought the concurrency/workers in the config controlled how many processes that would be at maximum started from the worker that checks the queue but I could be wrong. Another twist on the celery thing is that you could actually have several mach

Re: django-friends | setup views.py with templates

2010-09-06 Thread justin jools
Hi I have setup jtauber notification and friends apps but now I am stuck as to how to add views/urls to produce add friends/friends accept/friends list etc. please help me through the process thx On 6 Sep, 18:24, justin jools wrote: > trying to setup simple social network > have installed: regis

Save a ManyToMany via code

2010-09-06 Thread Alexandre González
Hi! I'm using this plugin: http://code.google.com/p/django-countries/ that gives me a model Country. I use it to a ManyToMany relation class A(models.Model): b = models.ManyToMany(Country) I must save a A object with servarl countries object on it... how can I do it? I had same problem but

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Mike Dewhirst
I'm reminded that almost all my own disasters were caused by premature optimisation. I would go with the simplest solution and keep an eye on performance as it scales. Gives you plenty of time to research plan B. That'll be 2c please M On 7/09/2010 4:49am, kmpm wrote: On Sep 6, 6:52 pm,

Translating Google Chart API parameters to Django

2010-09-06 Thread tbb
Is there a table that translates the Google Chart API parameters to Django tags? The parameters for creating a chart using the Google Charts API look like this: cht=bvg chs=250x150 chd=s:Monkeys chxt=x,y chxs=0,ff,12,0,lt 1,ff,10,1,lt Whereas the Django parameters look like this: {%

Re: Pylons vs. Django

2010-09-06 Thread Sandro Dutra
1. It's possible to use Mako and SQLAlchemy with Django too, as Steven writes. 2. As Bruno writes, Django it's a easy-learn piece of software and Pylons uses third-party software (and 2 powerfull ones), so, to extract the full power of Pylons you've a major learning curve, while Django is sit and

How do I cache related model query

2010-09-06 Thread gaoxt1983
I have a requirement, which is, show a model's OneToMany related model's fields in a page, the problem is, if I pass the main model to simple_tag, then using filter or get or whatever methods to lookup the specific related model, it will generate db query everytime. When I have 5 simple_tag which s

Re: Pylons vs. Django

2010-09-06 Thread Martin Chiteri
Hi, I understand that you can use whatever templating engine you so wish with django, so if you feel that Mako or Genshi is better for you, you can plug them into django and start using them. It might help to know that Guido Van Rossum actually prefers django templates :) Regards, Martin. -- Yo

Re: GoFlow - anybody out there used it?

2010-09-06 Thread Mathieu Leduc-Hamel
Another option might be http://github.com/knipknap/SpiffWorkflow at the time where i was searching for a workflow solution for my project it seems in pretty good shape. Although, the API was not enough Pythonic and a little too complicated. I finally didn't need to use a worlkflow solution and cho

Django --Unit testing view functions

2010-09-06 Thread girish shabadimath
hi,,, anybody help me with testing django views,,, * wat all things need to be tested for view functions..? * little bit confused about d usage of these two-- self.failUnlessEquals(XXX, XXX) and self.assertEquals(XXX, XXX) both seems to be same for me,, * any related books or links is appreciat

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread kmpm
On Sep 6, 8:40 pm, raj wrote: > Hi all, > Why can't we use the aggregate function 'max' from within save()? I > found it working to find the lot_max from among the objects filtered > by prod_date and then if lot_max is None, lot_no must be 0, else it's > just lot_max + 1. I don't know if I've mi

Re: GoFlow - anybody out there used it?

2010-09-06 Thread Thomas Guettler
Hi Steve, please post your result here, if you looked at the different workflow solutions. Thomas Steve Boyle wrote: > Hi, > > I've been writing an application that requires a workflow component > and rather than build one from scratch looked around to see what was > already out there. > > O

django-tagging languages and multi fields

2010-09-06 Thread Henrik Genssen
Hi, has someone a solution for tags in more than one language for the same entry? I normally use transdb (1) to archive this on char or textfields. But what about tags in multi languages for one entry? Has someone managed to get more than one tag field for a model? e.g. for internal and externa

Re: Generate a daily serial/batch/lot number

2010-09-06 Thread Shamail Tayyab
On Tuesday 07 September 2010 04:46 AM, Mike Dewhirst wrote: I'm reminded that almost all my own disasters were caused by premature optimisation. Seconds that! :-) I would go with the simplest solution and keep an eye on performance as it scales. Gives you plenty of time to research plan B.