Listbox even when using a "through" class?

2012-10-04 Thread Carsten Agger
I'm maintaining a product in which we have a many-to-many relationship 
which needs to have attributes in /some/ installations.


That means we'll define a tabular inline class and display in the admin.

But in /other /installations, these attributes are not needed, and we'd 
like to just display  a listbox. How do we do that?


According to this page:

https://docs.djangoproject.com/en/1.2/ref/contrib/admin/#working-with-many-to-many-intermediary-models

you need to do something in admin.py to get the tabular presentation - 
but is it also possible to get a listbox, and how?


One could make the "through" link conditonal, but that complicates 
matters as Django will then by default use a different database table to 
store the class. I'd really like to keep the intermediate class but 
"hide" it behind a simple multiple choice field when its attributes 
aren't needed.


best regards,

--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1476
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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: Installation script?

2012-09-05 Thread Carsten Agger

Den 04-09-2012 20:41, creecode skrev:

Have you checked out pip <http://www.pip-installer.org/> which has 
a requirements feature and fabric <http://docs.fabfile.org/>.  Those 
two would probably take you a fair ways or at least give you some 
ideas how you might approach the problem.




Thanks for the suggestions! In fact, I think buildout (zc.buildout) may 
be what I'm looking for.


Best regards,

Carsten

--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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: Installation script?

2012-09-04 Thread Carsten Agger

Den 03-09-2012 16:07, Andres Reyes Monge skrev:

Take a look at this project https://github.com/dcramer/logan



Thanks a lot, but I'm afraid that's not quite what I'm looking for.

It seems logan is a tool for running Django instances as standalone 
program. What I'm looking for is a standardized installation procedure 
which includes Apache and PostgreSQL setup so my Web service (which is 
not really "standalone") is installed without the user having to 
configure a lot.





--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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.



Installation script?

2012-09-03 Thread Carsten Agger
I've created a Django web service consisting of two separate sites, by 
default running on the same server, which implements a "document broker" 
service capable of centralizing the generation of office documents.


This work was made on behalf of my employer Magenta ApS - the code is 
available on the Subversion server for the Danish Agency for 
Digitisation 
<http://www.digst.dk/da/Servicemenu/English/About-the-Danish-Agency-for-Digitisation>, 
if anyone is interested:


https://svn.softwareborsen.dk/DokumentBroker/

As it is, the installation procedure is:

* Get the code directory by unpacking the tarball or checking out the code

* Check the INSTALL file for dependencies, install all dependencies 
(Debian/Ubuntu is strongly preferred)


* Run the "create_virtualenv" bash script to create the Python 
virtualenv and install Django and a lot of Python packages


* Softlink or copy the Apache config files to 
/etc/apache2/sites-available, manually update paths, etc.


* Create the necessary databases and update the settings.py files of the 
two sites.


We'd like to be able to automate all of this, so that the user can 
install these two services by running a single installation script.


I'm working on how to create source distribution tarballs with 
setuptools and a setup.py file. However, setuptools and distutils will 
only *install* my packages as Python packages and not set up the sites, 
and that is *not* what we want. We'd like to create a complete 
installation program so the user could just


* grab the tarball
* run "sudo install.py" or whatever
* enter some ports and paths configuration
* and now, up and running.

But how do I do that for a web service which is really a complete Django 
site? Setup.py is obviously the Python Way of installing packages, but 
is there a Django Way of creating and distributing installation programs 
for web services which are entire site implementations?



best regards and thanks in advance,

Carsten Agger


--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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: How to call perl script in my django application

2012-06-18 Thread Carsten Agger

Den 18-06-2012 13:10, Tanveer Ali Sha skrev:

sorry, i dint get that.Please can u give example .??


  visit this group at http://groups.google.com/group/django-users?hl=en.



There's a discussion of how to do this here:

http://stackoverflow.com/questions/4682088/call-perl-script-from-python

The second answer and the following ones is best.


--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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 Django Right for Me?

2012-05-29 Thread Carsten Agger

Den 29-05-2012 14:33, KevinE skrev:
Just one question - why would django avoid an offline mode - is that a 
completely unreasonable/undo-able extension? It seems to me that 
smartphones may eventually take over normal computers on the web but 
with the inherent distinction that on a smartphone you are not always 
guaranteed a data connection. I have been looking at all the mobile 
development systems and very few (if any) have really dealt with 
offline mode (not sure how powerful html5 is and whether you could 
support it for a complete database?)


So if I uncouple my client app am I not losing all the advantages of 
using django? Seems to me I will be rewriting alot of my code...




Django is inherently a Web application framework. You could build 
off-line applications to be used by one person with no connection to the 
Internet, but the easiest way to do that would probably be to set up a 
local Web server, e.g. an Apache server. So it would be online, but it 
would still be "Web".


--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf +45 5060 1269
Mob +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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: Determine gender from first name

2012-01-27 Thread Carsten Agger

Den 25-01-2012 09:59, Praveen Krishna R skrev:

*I don't know if there are any databases or webservices available for
the purpose. But how would you handle the exceptions ?! Like if it does
not exist in the db, and common names used across genders ?!*
*
*



In general this would not be possible.

Kim, e.g., is used as a female name in English and as a male name in 
Scandinavian languages.


Robin is used as a female and male name.

Then there's combinations such as José María and María José, which 
require knowledge of Spanish naming conventions.


Andrea is a male name in Italian.

I think you might go by a list but there'd always be errors.


--
Carsten Agger
Magenta ApS
Åbogade 15
8200 Århus N

Tlf  +45 2086 5010
http://www.magenta-aps.dk
carst...@magenta-aps.dk

--
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 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.