Re: testing a django package

2012-09-11 Thread Thomas Orozco
Is it a view mix in?

It's a bit difficult to tell you much without more information.

A few you things that you may find useful or not for testing :

.  Test cases can override settings such as the urlconf
.  There's a test client to test views
.  Class based views can sometimes be tested without any of the former by
just testing the methods in them
.   You can always use mocking library
.  Tests are basically just python code with a lot of asserts, you can
always add viewed in them
.  You can use fixtures for test data if you see fit

Hope this helps!

Thomas
On Sep 10, 2012 5:23 PM, "Jonas Geiregat"  wrote:

> Hello,
>
> I've created a simple reusable django package. This package basically
> consists out of a views.py file, with some helper functions.
>
> I want to write some tests for what's in this file. This file contains a
> mixin , so I probably can't test it directly.
>
> What's the best way to test a django package ?
>
> Do I need to include some kind of example project that, uses my mixin and
> has tests files just as one would test a normal django application ?
>
> I've tried googling but, there's little about this. Most of the things
> I've found where related to testing actual django applications.
>
> Any help is appreciated.
>
> Jonas
>
>
> --
> 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.
>
>

-- 
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread DJ-Tom
Am Dienstag, 11. September 2012 00:43:44 UTC+2 schrieb Mike Dewhirst:
>
>
> Try dropping this down to "djtest.settings". Also make sure you have a 
> file in each of your folders called __init__.py 
>
> This tells Python the folder is part of the package. 
>

Sorry - but this does not help. Just to be sure that I'm not missing 
anything essential, this is all I have so far:

d:\djtest\
   manage.py
   data.sql
   \djtest\
  __init__.py
  settings.py
  urls.py
  wsgi.py

Am I correct to assume that this should be sufficient to call at least the 
/admin/ interface?

I have activated this in urls.py:  url(r'^admin/', 
include(admin.site.urls)),

And this in settings.py: 'django.contrib.admin',

But as django does not seem to be able to find settings.py... hm

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/tEB1E_DacVAJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread Jian Chang
"d:/wwwroot/djtest/djtest/" was already in system path, so I think you
should set DJANGO_SETTINGS_MODULE like this:
os.environ.setdefault("DJANGO_SETTINGS_MODULE",
"settings")

try it![?][?][?]

2012/9/11 DJ-Tom 

> Am Dienstag, 11. September 2012 00:43:44 UTC+2 schrieb Mike Dewhirst:
>
>>
>> Try dropping this down to "djtest.settings". Also make sure you have a
>> file in each of your folders called __init__.py
>>
>> This tells Python the folder is part of the package.
>>
>
> Sorry - but this does not help. Just to be sure that I'm not missing
> anything essential, this is all I have so far:
>
> d:\djtest\
>manage.py
>data.sql
>\djtest\
>   __init__.py
>   settings.py
>   urls.py
>   wsgi.py
>
> Am I correct to assume that this should be sufficient to call at least the
> /admin/ interface?
>
> I have activated this in urls.py:  url(r'^admin/',
> include(admin.site.urls)),
>
> And this in settings.py: 'django.contrib.admin',
>
> But as django does not seem to be able to find settings.py... hm
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/tEB1E_DacVAJ.
>
> 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.
>

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

<<330.gif>>

Iphone applications via django

2012-09-11 Thread Sait Maraşlıoğlu
How do you create iphone applications via django.
Application logic will be django but what about user interface, do we do 
that with django too?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xL4mqQobAEUJ.
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.



models for KML file

2012-09-11 Thread Coulson Thabo Kgathi
Somebody help with using kml files to plot points on maps using geodjango

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/6EqyQE3Kbm4J.
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: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  wrote:

> Hey Cal,
>
> This looks like a great tool. I know I've implemented code like this in
> another project. I was planning on doing a field change audit module for an
> application I'm currently working on. I will definitely look at
> django-cutemodel and see if it works for what I need, and how I can
> contribute.
> My current project is a time clock system for human resources to manage
> hourly workers. We need field change auditing for security, we need the
> ability to produce reports from it, and ability to restore from audit
> history (in case of record tampering).


I think django-cutemodel would be a pretty good fit for this requirement,
although it doesn't yet have any sort of administration interface to
produce reports, and the documentation isn't exactly great.

Restore from audit history functionality is something we need for ourselves
too, so I've raised an issue (will prob fix that sometime this week);
https://github.com/foxx/django-cutemodel/issues/1

We also need to have the ability to bind the Django User objects together
with the event/field change - but some of our clients don't use the Django
built-in user/auth stuff - so I need to have a little think about how to
satisfy both.
https://github.com/foxx/django-cutemodel/issues/2

Basically, all actions are logged and nothing is deleted or over-written.
> When changes are made, the original record is marked as a parent archive.
> The modified record is a dup of the parent, but with the changes.
>

The approach of duplicating the row individually could work in some cases,
but if there was any unique index constraints then I'm guessing the rows
would have to be moved into a different table. If this were the case, you'd
need twice the amount of tables, which in itself may be undesirable, plus
another which stores the change relationships, plus any changes would have
to be done twice.

Instead, django-cutemodel doesn't require a sub-table for every model, and
the tables don't need to be modified if one of your models changes - it has
the following;

- table map (stores unique table names) - allows for super fast lookup
instead of full text scan
- model map (stores unique model + app + db names) - allows for super fast
lookup instead of full text scan
- fieldchange (stores fieldname+old/new value, target model+pk, and
timestamp)
- event (stores event message, log level, target model+pk and timestamp)


> Anyway, I'm rambling. If you would like to chat about this let me know. I
> will update this group, or contact you when I start working on the change
> audit code
>

Sure thing, if you think of any additional changes please feel free to fire
them over (it'd be great to see others using this in the wild!)


>
> Kurt Pruhs
> Utah State University
> Programing & Design Team
>
>
>
>
> On Monday, September 10, 2012 1:43:17 PM UTC-6, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>> Hi guys,
>>
>> We have just released a new module that allows for lightweight/easy
>> relational event logging and auditing field changes.
>>
>> Our use case was to satisfy four main requirements;
>>
>> * Log events directly from models, whilst keeping a relational link to
>> the row that triggered the event
>> * Keep track of field changes (storing the old/new value).
>> * Provide a scalable/easy to use API that allowed access to this
>> information
>> * Ensure module was a drop-in replacement (only change required is to
>> subclass CuteModel)
>>
>> The code itself has been dragged out of our existing projects, cleaned up
>> slightly, and released as open source.
>>
>> Full documentation and source code has been made available here:
>> https://github.com/foxx/**django-cutemodel
>>
>> Particular care has been made to ensure the code is able to scale up to
>> many millions of rows, and we have not yet had any issues.
>>
>> In future, we'd love to add some extra features and do a bit more tidy up
>> - so any testing/feedback/features suggestions/comments would be
>> appreciated.
>>
>> Cheers
>>
>> Cal
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/OQzlNQjqtbYJ.
> 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.
>

-- 
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: Iphone applications via django

2012-09-11 Thread Mario Gudelj
Nope. You do objective c or html and js with something like phonegap
On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:

> How do you create iphone applications via django.
> Application logic will be django but what about user interface, do we do
> that with django too?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/xL4mqQobAEUJ.
> 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.
>

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



tree.io installation with django

2012-09-11 Thread Fabian Weiss
I am using Debian and want to use treeio with my Apache. So I was working 
with this tutorial: 
http://fuckyeahcoding.wordpress.com/2011/12/20/install-tree-io-on-ubuntu-with-apache/
But the instructions "make" and "make install" didnt work.. Instead I used 
the 'python manage.py update_ve' and './bin/patch_' from the INSTALL Howto. 
So this is the result:
http://nopaste.immersight.de/?3c0f99829f839ff8#EhsVGqDrxk6xDzDvYq6hiuxNpJw04XhXK36b6BMc3Dc=

Next stept: root@iss1:/srv/http/de.immersight.project/treeio# ./bin/patch
patching file db/models/fields/related.py

I created a MySQL database, user and password. But where to configure 
treeio for this? Where shall I enter this informations??

So this is the result of the next step:
http://nopaste.immersight.de/?f36e7753a9fcca9b#7ICkjsTcxh/Ck4JZ6d9jhfPStsY8eYWJ3N5Ko4YrY7M=

I am not sure and dont understand much of it, but for me it seems there 
already went something wrong..
The tree.io community is not so active, but maybe somebody here can give me 
a hint!

Thx alot!!

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/wm6J2Ces9BUJ.
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.



Django newbie with issues

2012-09-11 Thread Morrti
Hi,

I'm a total newbie to Django and I'm trying to follow the build your first 
app tutorial from the site 
https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but have soon run 
into problems, please see below. This is as a result of running the  python 
manage.py runserver command. 

If anyone can help, I believe I'm running version 1.1 of django, not sure 
what else you may want to know.

Thanx,

python manage.py runserver
Validating models...

Unhandled exception in thread started by >
Traceback (most recent call last):
  File 
"/Users/timmorris/Sites/django/django-trunk/django/core/management/commands/runserver.py",
 
line 91, in inner_run
self.validate(display_num_errors=True)
  File 
"/Users/timmorris/Sites/django/django-trunk/django/core/management/base.py", 
line 277, in validate
num_errors = get_validation_errors(s, app)
  File 
"/Users/timmorris/Sites/django/django-trunk/django/core/management/validation.py",
 
line 32, in get_validation_errors
for (app_name, error) in get_app_errors().items():
  File 
"/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
line 163, in get_app_errors
self._populate()
  File 
"/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
line 69, in _populate
self.load_app(app_name, True)
  File 
"/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
line 93, in load_app
models = import_module('.models', app_name)
  File 
"/Users/timmorris/Sites/django/django-trunk/django/utils/importlib.py", 
line 35, in import_module
__import__(name)
  File 
"/Users/timmorris/Sites/django/django-trunk/django/contrib/auth/models.py", 
line 18, in 
from django.contrib.contenttypes.models import ContentType
  File 
"/Users/timmorris/Sites/django/django-trunk/django/contrib/contenttypes/models.py",
 
line 125, in 
class ContentType(models.Model):
  File 
"/Users/timmorris/Sites/django/django-trunk/django/db/models/base.py", line 
64, in __new__
new_class.add_to_class('_meta', Options(meta, **kwargs))
TypeError: Error when calling the metaclass bases
__init__() keywords must be strings

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/xxWivGGykWYJ.
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.



Plot points from a kml file in django

2012-09-11 Thread Coulson Thabo Kgathi
Plot points from a kml file in django

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/d1SMT2gK38cJ.
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: Iphone applications via django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
You can create a server side API for the app - but the actual interface is
done using the methods mentioned by Mario previously.

Cal

On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:

> Nope. You do objective c or html and js with something like phonegap
> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:
>
>> How do you create iphone applications via django.
>> Application logic will be django but what about user interface, do we do
>> that with django too?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/xL4mqQobAEUJ.
>> 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.
>>
>  --
> 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.
>

-- 
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: tree.io installation with django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Looks like an incompatible version of Django perhaps (first glance).

Alternatively, just patch it yourself based on the error given:

@@@
django.core.exceptions.ImproperlyConfigured: You're using the staticfiles
app without having set the STATIC_ROOT setting.
@@@

See https://docs.djangoproject.com/en/dev/howto/static-files/

Cal

On Tue, Sep 11, 2012 at 7:22 AM, Fabian Weiss
wrote:

> I am using Debian and want to use treeio with my Apache. So I was working
> with this tutorial:
> http://fuckyeahcoding.wordpress.com/2011/12/20/install-tree-io-on-ubuntu-with-apache/
> But the instructions "make" and "make install" didnt work.. Instead I used
> the 'python manage.py update_ve' and './bin/patch_' from the INSTALL Howto.
> So this is the result:
>
> http://nopaste.immersight.de/?3c0f99829f839ff8#EhsVGqDrxk6xDzDvYq6hiuxNpJw04XhXK36b6BMc3Dc=
>
> Next stept: root@iss1:/srv/http/de.immersight.project/treeio# ./bin/patch
> patching file db/models/fields/related.py
>
> I created a MySQL database, user and password. But where to configure
> treeio for this? Where shall I enter this informations??
>
> So this is the result of the next step:
>
> http://nopaste.immersight.de/?f36e7753a9fcca9b#7ICkjsTcxh/Ck4JZ6d9jhfPStsY8eYWJ3N5Ko4YrY7M=
>
> I am not sure and dont understand much of it, but for me it seems there
> already went something wrong..
> The tree.io community is not so active, but maybe somebody here can give
> me a hint!
>
> Thx alot!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/wm6J2Ces9BUJ.
> 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.
>

-- 
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: Plot points from a kml file in django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
http://stackoverflow.com/questions/833/how-to-process-an-uploaded-kml-file-in-geodjango

http://iwoom.blogspot.co.uk/2010/11/python-django-reading-kml-points.html
http://code.google.com/p/simplekml/
http://code.google.com/p/pylibkml/
http://pypi.python.org/pypi/pykml

Come on man, use Google :)

Cal

On Tue, Sep 11, 2012 at 11:30 AM, Coulson Thabo Kgathi
wrote:

> Plot points from a kml file in django
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/d1SMT2gK38cJ.
> 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.
>

-- 
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: Django newbie with issues

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Ouch, 1.1 is very old indeed.

I have seen compatibility issues before when running django/py apps on a
mac, but can't say I've ever ran into this before.

Could you upgrade to the latest (1.4.1) and see if you still experience the
same issue?

Cal

On Tue, Sep 11, 2012 at 11:03 AM, Morrti  wrote:

> Hi,
>
> I'm a total newbie to Django and I'm trying to follow the build your first
> app tutorial from the site
> https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but have soon run
> into problems, please see below. This is as a result of running the  python
> manage.py runserver command.
>
> If anyone can help, I believe I'm running version 1.1 of django, not sure
> what else you may want to know.
>
> Thanx,
>
> python manage.py runserver
> Validating models...
>
> Unhandled exception in thread started by  of  at 0x10114d0d0>>
> Traceback (most recent call last):
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/commands/runserver.py",
> line 91, in inner_run
> self.validate(display_num_errors=True)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/base.py",
> line 277, in validate
> num_errors = get_validation_errors(s, app)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/core/management/validation.py",
> line 32, in get_validation_errors
> for (app_name, error) in get_app_errors().items():
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 163, in get_app_errors
> self._populate()
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 69, in _populate
> self.load_app(app_name, True)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py",
> line 93, in load_app
> models = import_module('.models', app_name)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/utils/importlib.py",
> line 35, in import_module
> __import__(name)
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/contrib/auth/models.py",
> line 18, in 
> from django.contrib.contenttypes.models import ContentType
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/contrib/contenttypes/models.py",
> line 125, in 
> class ContentType(models.Model):
>   File
> "/Users/timmorris/Sites/django/django-trunk/django/db/models/base.py", line
> 64, in __new__
> new_class.add_to_class('_meta', Options(meta, **kwargs))
> TypeError: Error when calling the metaclass bases
> __init__() keywords must be strings
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/xxWivGGykWYJ.
> 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.
>

-- 
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: Marketplace for Django apps

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
-1

It's not the cost that I'm concerned with, it's the community motivation
that worries me.

If we have a paid app store, we will not only end up with every
tom/dick/harry submitting crappy apps (just like every other store), but it
also changes the motivation of the community to be commercially driven,
rather than kudos.

Personally, I feel something like this would become the cancer of our
community, and should be avoided - especially since the Django contributors
themselves give so much for free and ask so little in return.

At the same time, there is nothing stopping you from creating your own
store and selling the modules yourself - if you really wanted to.

Cal

On Mon, Sep 10, 2012 at 7:35 AM, Slava Kravchenko wrote:

> Hi,
>
> our web development agency uses Django basically for all stuff we are
> doing. We love it, we love Django community and open-source. We even have
> some open-sourced apps.
>
> We also have some apps, which can't be open-sourced now for some reason,
> but we're interested in selling them. We know that there are some other
> agencies that have such apps.
>
> What I want to discuss is a "Django Marketplace" thing, like WordPress
> Marketplace or Magento Connect. A place, where developers will be able to
> sell apps to other developers or complete projects to end-users.
>
> About a year ago, Jacob-Kaplan Moss wrote a post on this topic in his
> blog: http://jacobian.org/writing/paid-django-apps/ . It has some
> negative and some positive comments about selling Django apps.
>
> I want to ask you again, what you think about such service? Would you buy
> or sell apps (or paid support) out there and why?
>
> --
> Slava Kravchenko
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/LrxAHCv0sQcJ.
> 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.
>

-- 
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: Marketplace for Django apps

2012-09-11 Thread jonas




I want to ask you again, what you think about such service? Would you
buy or sell apps (or paid support) out there and why?



If the apps are more then good enough and would spare companies time 
and there are no better or equal opensource alternatives,
then yes I do believe some people might be willing to buy apps in such 
a market place. For example there is no real outstanding e-commerce 
application for django.


--
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: Plot points from a kml file in django

2012-09-11 Thread Coulson Thabo Kgathi
I googled, went through the geodjango tutorial, now my problem is ploting 
points or coordinates on a map on my geodjango project tht i created using 
this kml file

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/D4KmAQqQOiUJ.
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: Plot points from a kml file in django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Need a bit more info than that for anyone to help you.

Please tell us exactly what information you have, what you are trying to
achieve, and where you are getting stuck.

Cal

On Tue, Sep 11, 2012 at 1:49 PM, Coulson Thabo Kgathi wrote:

> I googled, went through the geodjango tutorial, now my problem is ploting
> points or coordinates on a map on my geodjango project tht i created using
> this kml file
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/D4KmAQqQOiUJ.
>
> 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.
>

-- 
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: Django newbie with issues

2012-09-11 Thread Morrti
Hi,

We did try things with v1.5, but that also failed. Looking further it seems 
that my branch on git was wrong.
Moving to the correct one for 1.1 has seemed to have corrected things, well 
we got past that issue.
I'm going to continue with the tutorial now and see how that goes.

Thanx,
Tim

On Tuesday, September 11, 2012 11:45:17 AM UTC+1, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
> Ouch, 1.1 is very old indeed.
>
> I have seen compatibility issues before when running django/py apps on a 
> mac, but can't say I've ever ran into this before.
>
> Could you upgrade to the latest (1.4.1) and see if you still experience 
> the same issue? 
>
> Cal
>
> On Tue, Sep 11, 2012 at 11:03 AM, Morrti 
> > wrote:
>
>> Hi,
>>
>
 

>
>> I'm a total newbie to Django and I'm trying to follow the build your 
>> first app tutorial from the site 
>> https://docs.djangoproject.com/en/1.1/intro/tutorial01/ but have soon 
>> run into problems, please see below. This is as a result of running the  
>> python manage.py runserver command. 
>>
>> If anyone can help, I believe I'm running version 1.1 of django, not sure 
>> what else you may want to know.
>>
>> Thanx,
>>
>> python manage.py runserver
>> Validating models...
>>
>> Unhandled exception in thread started by > of > at 0x10114d0d0>>
>> Traceback (most recent call last):
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/core/management/commands/runserver.py",
>>  
>> line 91, in inner_run
>> self.validate(display_num_errors=True)
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/core/management/base.py", 
>> line 277, in validate
>> num_errors = get_validation_errors(s, app)
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/core/management/validation.py",
>>  
>> line 32, in get_validation_errors
>> for (app_name, error) in get_app_errors().items():
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
>> line 163, in get_app_errors
>> self._populate()
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
>> line 69, in _populate
>> self.load_app(app_name, True)
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/db/models/loading.py", 
>> line 93, in load_app
>> models = import_module('.models', app_name)
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/utils/importlib.py", 
>> line 35, in import_module
>> __import__(name)
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/contrib/auth/models.py", 
>> line 18, in 
>> from django.contrib.contenttypes.models import ContentType
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/contrib/contenttypes/models.py",
>>  
>> line 125, in 
>> class ContentType(models.Model):
>>   File 
>> "/Users/timmorris/Sites/django/django-trunk/django/db/models/base.py", line 
>> 64, in __new__
>> new_class.add_to_class('_meta', Options(meta, **kwargs))
>> TypeError: Error when calling the metaclass bases
>> __init__() keywords must be strings
>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/xxWivGGykWYJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/pPigqomwn0EJ.
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: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread jondykeman
Hello,

I am in a very similar situation. I would in an environment that deals with 
sensitive data collection. Everything has to be two-factor authenticated, 
in the secure server zone etc. As part of this we need logging of every 
action ever taken, by whom, when, and what the changes were.

At first I implemented my own custom solution which was less than ideal, 
but it worked. That was a model of creating a new record for each field any 
time there was a change to the value, but via a lot of manual checking 
code. 

I am not starting to migrate to a slicker solution. I am taking advantage 
of django-reversion.

https://github.com/etianen/django-reversion

This provides row level auditing out of the box, and then you just need to 
take advantage of the pre_commit_signal to track field changes as well.

@receiver(reversion.pre_revision_commit)
def it_worked(sender, **kwargs):
currentVersion = kwargs.pop('versions')[0].field_dict
pastVersion = 
reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
changes = set(currentVersion.items()) - set(pastVersion.items())
changedVars = []
for var in changes:
changedVars.append(var[0])
comment = "Changed: %s" % ", ".join(changedVars)
revision = kwargs.pop('revision')
revision.comment = comment
revision.save()
kwargs['revision'] = revision

Rather than the string tracking which fields I am going to switch to a dict 
of changed or not for each variable.

I will check out cutemodel for sure and let you know.

Thanks,

JD


On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
>
>
> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs 
> > wrote:
>
>> Hey Cal,
>>
>> This looks like a great tool. I know I've implemented code like this in 
>> another project. I was planning on doing a field change audit module for an 
>> application I'm currently working on. I will definitely look at 
>> django-cutemodel and see if it works for what I need, and how I can 
>> contribute. 
>> My current project is a time clock system for human resources to manage 
>> hourly workers. We need field change auditing for security, we need the 
>> ability to produce reports from it, and ability to restore from audit 
>> history (in case of record tampering). 
>
>
> I think django-cutemodel would be a pretty good fit for this requirement, 
> although it doesn't yet have any sort of administration interface to 
> produce reports, and the documentation isn't exactly great.
>
> Restore from audit history functionality is something we need for 
> ourselves too, so I've raised an issue (will prob fix that sometime this 
> week);
> https://github.com/foxx/django-cutemodel/issues/1 
>
> We also need to have the ability to bind the Django User objects together 
> with the event/field change - but some of our clients don't use the Django 
> built-in user/auth stuff - so I need to have a little think about how to 
> satisfy both.
> https://github.com/foxx/django-cutemodel/issues/2 
>
> Basically, all actions are logged and nothing is deleted or over-written. 
>> When changes are made, the original record is marked as a parent archive. 
>> The modified record is a dup of the parent, but with the changes. 
>>
>
> The approach of duplicating the row individually could work in some cases, 
> but if there was any unique index constraints then I'm guessing the rows 
> would have to be moved into a different table. If this were the case, you'd 
> need twice the amount of tables, which in itself may be undesirable, plus 
> another which stores the change relationships, plus any changes would have 
> to be done twice.
>
> Instead, django-cutemodel doesn't require a sub-table for every model, and 
> the tables don't need to be modified if one of your models changes - it has 
> the following;
>
> - table map (stores unique table names) - allows for super fast lookup 
> instead of full text scan
> - model map (stores unique model + app + db names) - allows for super fast 
> lookup instead of full text scan
> - fieldchange (stores fieldname+old/new value, target model+pk, and 
> timestamp)
> - event (stores event message, log level, target model+pk and timestamp)
>
>
>> Anyway, I'm rambling. If you would like to chat about this let me know. I 
>> will update this group, or contact you when I start working on the change 
>> audit code
>>
>
> Sure thing, if you think of any additional changes please feel free to 
> fire them over (it'd be great to see others using this in the wild!)
>  
>
>>
>> Kurt Pruhs
>> Utah State University
>> Programing & Design Team
>>
>>
>>
>>
>> On Monday, September 10, 2012 1:43:17 PM UTC-6, Cal Leeming [Simplicity 
>> Media Ltd] wrote:
>>>
>>> Hi guys,
>>>
>>> We have just released a new module that allows for lightweight/easy 
>>> relational event logging and auditing field changes.
>>>
>>> Our use case was to satisfy four main requirements;
>>>
>>> * Log events directly from models, whilst keeping a relational link to 
>>> the row that triggered th

Re: Django newbie with issues

2012-09-11 Thread Thomas Lockhart

On 9/11/12 6:29 AM, Morrti wrote:

Hi,

We did try things with v1.5, but that also failed. Looking further it 
seems that my branch on git was wrong.
Moving to the correct one for 1.1 has seemed to have corrected things, 
well we got past that issue.

I'm going to continue with the tutorial now and see how that goes.
Please take the advice and use 1.4.1. And on the Mac I strongly 
recommend using virtualenv; it is hard to keep things straight otherwise.


hth

- 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-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: Iphone applications via django

2012-09-11 Thread Kelly Nicholes
If you go HTML/JS, a phonegap alternative for cross-device compatibility 
would be appcelerator.

On Tuesday, September 11, 2012 2:59:12 AM UTC-6, Sait Maraşlıoğlu wrote:
>
> How do you create iphone applications via django.
> Application logic will be django but what about user interface, do we do 
> that with django too?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/M5URL8CILUUJ.
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: Iphone applications via django

2012-09-11 Thread Thomas Weholt
You could use JQuery Mobile on the frontend. It's still a web app like
any other, but app-like in looks and functionality, at least to a
certain degree.

Thomas

On Tue, Sep 11, 2012 at 4:16 PM, Kelly Nicholes  wrote:
> If you go HTML/JS, a phonegap alternative for cross-device compatibility
> would be appcelerator.
>
>
> On Tuesday, September 11, 2012 2:59:12 AM UTC-6, Sait Maraşlıoğlu wrote:
>>
>> How do you create iphone applications via django.
>> Application logic will be django but what about user interface, do we do
>> that with django too?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/M5URL8CILUUJ.
>
> 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.



-- 
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-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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread DJ-Tom


Am Dienstag, 11. September 2012 10:20:16 UTC+2 schrieb Chang.Jian:
>
> "d:/wwwroot/djtest/djtest/" was already in system path, so I think you 
> should set DJANGO_SETTINGS_MODULE like this: 
> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
>
> try it!
>
>
Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had 
to restart Apache to make config changes effective... is that "normal"?

I think important things like "you have to restart the webserver to make 
changes life" should go into the tutorial in *BIG RED LETTERS* 

Now I get a "regular" Django exception:

NameError: name 'admin' is not defined


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/y4GYmsDZkKwJ.
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: Problems with simple "hello world" test - "ImportError: Could not import settings"

2012-09-11 Thread Daniel Roseman
On Tuesday, 11 September 2012 16:33:31 UTC+1, DJ-Tom wrote:
>
>
>
> Am Dienstag, 11. September 2012 10:20:16 UTC+2 schrieb Chang.Jian:
>>
>> "d:/wwwroot/djtest/djtest/" was already in system path, so I think you 
>> should set DJANGO_SETTINGS_MODULE like this: 
>> os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings")
>>
>> try it!
>>
>>
> Ok... GREAT! Now it works :-) (well... sort of, more below... ) but I had 
> to restart Apache to make config changes effective... is that "normal"?
>
> I think important things like "you have to restart the webserver to make 
> changes life" should go into the tutorial in *BIG RED LETTERS* 
>


The tutorial, by design, doesn't mention Apache at all. That's because it's 
heavily recommended that you use the built-in devserver for development, 
for precisely this reason. That's what it's for.
--
DR. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/LlpRVasnf_UJ.
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: testing a django package

2012-09-11 Thread Jonas Geiregat

> Is it a view mix in?
> 
The package actually already changed from containing a view mix in to actual 
views that should be subclassed by the users using the package.
> It's a bit difficult to tell you much without more information.
> 
For example, a view derived from FormView. Like I said the user should subclass 
this view again as you would normally do with CBV.

Currently the package is just a package/directory with views.py, models.py, 
urls.py and of course __init__.py to make it a module.

It's hard to test views without having an actual django project to test it 
again, I think.  Correct me if I'm wrong here.
So I created an example django project that is using this package in the 
directory below the package, thus the directory containing the README, setup.py 
etc .. files.

The example app will hold a tests.py file which will contain my tests which 
will be testing the actual functionality of my views.

Basically I'm asking do I need an actual django project to test just a views.py 
file or can I just write some tests without a containing django project to test 
a views.py file.
And if so, I'm kinda lost on how you would start on such a task.

> A few you things that you may find useful or not for testing :
> 
> .  Test cases can override settings such as the urlconf 
> .  There's a test client to test views 
> .  Class based views can sometimes be tested without any of the former by 
> just testing the methods in them 
> .   You can always use mocking library 
> .  Tests are basically just python code with a lot of asserts, you can always 
> add viewed in them 
> .  You can use fixtures for test data if you see fit
> 
> Hope this helps!
> 
> Thomas
> 
> On Sep 10, 2012 5:23 PM, "Jonas Geiregat"  wrote:
> Hello,
> 
> I've created a simple reusable django package. This package basically 
> consists out of a views.py file, with some helper functions.
> 
> I want to write some tests for what's in this file. This file contains a 
> mixin , so I probably can't test it directly.
> 
> What's the best way to test a django package ?
> 
> Do I need to include some kind of example project that, uses my mixin and has 
> tests files just as one would test a normal django application ?
> 
> I've tried googling but, there's little about this. Most of the things I've 
> found where related to testing actual django applications.
> 
> Any help is appreciated.
> 
> Jonas
> 
> 
> --
> 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.
> 
> 
> -- 
> 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.

-- 
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: Marketplace for Django apps

2012-09-11 Thread Jorge Vargas
I agree with Jonas here. having a place were you have get apps to solve
hard problems no one has done right (ecommerce is a very good example) is a
plus.

As for it being "cancer" and bad I don't agree there is a market for
everything. And that will bring more people in which in the end is what
everyone wants.
I do agree that it should be clear that said store will be managed by a
third party and not Django itself.

On Tue, Sep 11, 2012 at 7:11 AM,  wrote:

>
>
>> I want to ask you again, what you think about such service? Would you
>> buy or sell apps (or paid support) out there and why?
>>
>>
> If the apps are more then good enough and would spare companies time and
> there are no better or equal opensource alternatives,
> then yes I do believe some people might be willing to buy apps in such a
> market place. For example there is no real outstanding e-commerce
> application for django.
>
>
> --
> 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+unsubscribe@**
> 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-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: Changing the text on the admin "change_list.html"

2012-09-11 Thread Melvyn Sopacua
That would be the verbose name in the models' meta class. I think
Op 8 sep. 2012 18:34 schreef "Derek"  het volgende:

> I need to alter the text that appears above every change list in my app:
>
> "Select *modelname* to change"
>
> However, I cannot see this text in the change_list.html file -
> whereabouts is this text kept, and can it be overridden?
>
> 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-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.
>
>

-- 
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: Marketplace for Django apps

2012-09-11 Thread Kurtis Mullins
How about a compromise; just an easier way to donate to Django and Django
Application developers? It would encourage sharing high quality projects
and hopefully make it worth our time (financially, not just because we love
and support libre software) to do so. For that matter, there's all sorts of
ways to make money around free software (laid out by RMS among others) such
as Paid Support, selling printed documentation, etc...

On Tue, Sep 11, 2012 at 1:36 PM, Jorge Vargas wrote:

> I agree with Jonas here. having a place were you have get apps to solve
> hard problems no one has done right (ecommerce is a very good example) is a
> plus.
>
> As for it being "cancer" and bad I don't agree there is a market for
> everything. And that will bring more people in which in the end is what
> everyone wants.
> I do agree that it should be clear that said store will be managed by a
> third party and not Django itself.
>
>
> On Tue, Sep 11, 2012 at 7:11 AM,  wrote:
>
>>
>>
>>> I want to ask you again, what you think about such service? Would you
>>> buy or sell apps (or paid support) out there and why?
>>>
>>>
>> If the apps are more then good enough and would spare companies time and
>> there are no better or equal opensource alternatives,
>> then yes I do believe some people might be willing to buy apps in such a
>> market place. For example there is no real outstanding e-commerce
>> application for django.
>>
>>
>> --
>> 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+unsubscribe@**
>> 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-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.
>

-- 
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: Validating GB telephone numbers in Django forms.

2012-09-11 Thread g1smd.1

Brad Pitcher stepped in and made the various code conversions.

There's just a few more changes and updates to go and the module will be 
complete.


On Wednesday, September 5, 2012 11:05:45 PM UTC, g1smd.1 wrote:
>
>
> The GB number plan is quite complicated, with a variety of number lengths 
> and formats.
> Some of it is detailed here:
> http://www.aa-asterisk.org.uk/index.php/Number_format
>
> I already compiled all the RegEx patterns that are needed. Some are listed 
> here:
>
> http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_UK_Telephone_Numbers
>
> I've already started the process of translating a fully working PHP 
> routine (that I wrote from scratch) into python. There will be syntax 
> errors in the python version as I don't understand all that much of the 
> python language.
>
> The python functionality so far  
> https://github.com/django/django/pull/324/files
> or
>
> https://github.com/g1smd/django/blob/master/django/contrib/localflavor/gb/forms.py
>
> The code using an array is probably not quite right, and I guess it would 
> be better to return error messages instead of "false" in some places.
>
> However, I'd guess that someone who knows what they were doing could get 
> it working in an hour or two.
>
>
>
> On Wednesday, September 5, 2012 6:24:42 PM UTC, Amyth wrote:
>>
>> To be frank, I am not really familiar with all possibilities of GB phone 
>> numbers, if you could throw some light on this, I might be able to help ya.
>>
>> On Wed, Sep 5, 2012 at 5:59 PM, g1smd.1  wrote:
>>
>>>
>>> Thanks for the reply and information.
>>>
>>>
>>> The jQuery validation routines for GB telephone numbers contain 
>>> significant errors and shortcomings. I already posted some patches 
>>> correcting many of those problems at least a month ago, but they haven't 
>>> been reviewed yet.
>>>
>>>
>>> The new Python/django telephone number validation code I am proposing 
>>> here is far more comprehensive and has much more detailed range and length 
>>> checking. Similar code already works fine in PHP and Java elsewhere, but I 
>>> am having trouble converting it all to Python. 
>>>
>>> I have added some Python logic and code to the initial RegEx patterns 
>>> that I posted yesterday, but I now need help to finish it off and get it 
>>> working. I am not at all familiar with the Python syntax and the manual is 
>>> somewhat terse and obtuse.
>>>
>>> I had a problem with GitHub this morning, so the pull request is now at 
>>> https://github.com/django/django/pull/324
>>>
>>> The code so far, can be found at: 
>>> https://github.com/g1smd/django/blob/master/django/contrib/localflavor/gb/forms.py
>>>
>>> I'm guessing that someone proficient in Python could finish it off in a 
>>> couple of hours or less.
>>>
>>> Any volunteers?
>>>
>>>
>>>
>>>
>>> On Wednesday, September 5, 2012 7:02:09 AM UTC, Amyth wrote:

 you can alternatively use jquery to validate the field, i do not have 
 the link handy as m on my phone right now but google validation engine, it 
 is one of the most powerful jquery validation library which also has 
 builtin method of validating uk phone numbers.
 On Sep 4, 2012 5:00 AM, "g1smd.1"  wrote:

>  I see that there are routines for validating telephone numbers in 
> forms in Django for several countries.
>
> The code for that can usually be found in the forms.py file located in 
> the various country folders here:
> https://github.com/django/**django/tree/master/django/**
> contrib/localflavor
>  
>
> So far, there is nothing for GB numbers, here:
> https://github.com/django/**django/tree/master/django/**
> contrib/localflavor/gb
>
> I've written a bunch of RegEx patterns to get this functionality 
> started. The patterns are 100% fully tested. All that's needed is a few 
> lines of python logic to string them together. The details can be found 
> at:
> https://github.com/django/**django/pull/316/files
>
> My python foo is almost zero. Anyone care to have a go at getting this 
> to work?
>
> RegEx 1 checks the user entered something that looks like a GB 
> telephone number:
> 020  3000  
> 02075  567  234
> 0114  223  4567
> 01145  345  567
> +44  1213  456  789
> 00  44  (0)  1697  73555
> 011  44  11  4890  2345
> and several other formats, without worrying if the format is correct 
> for this particular number (but read on). It allows for national or 
> international format, even for two common international dial prefixes. 
> What 
> is most important is that the user enters the right number of digits. 
> Don't 
> constrain the user to use a particular format for entr

Re: Iphone applications via django

2012-09-11 Thread Ray Ch
Can you tell me how do i do that? 
Do you have any kind of blog or tutorial which would help me out connecting 
the web API's with iphone.

Do you suggest JSON or XML ?


On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming [Simplicity 
Media Ltd] wrote:
>
> You can create a server side API for the app - but the actual interface is 
> done using the methods mentioned by Mario previously.
>
> Cal
>
> On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj 
> 
> > wrote:
>
>> Nope. You do objective c or html and js with something like phonegap
>> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu" > 
>> wrote:
>>
>>> How do you create iphone applications via django.
>>> Application logic will be django but what about user interface, do we do 
>>> that with django too?
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Django users" group.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msg/django-users/-/xL4mqQobAEUJ.
>>> To post to this group, send email to django...@googlegroups.com
>>> .
>>> To unsubscribe from this group, send email to 
>>> django-users...@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...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/J44uT5ivqbIJ.
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: Request for comments - django-cutemodel (model logging and field change auditing)

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
Thanks for letting me know about django-reversion, it has made for
interesting reading.

>From what I can see there are two big differences between them;

* CuteModel is designed with performance/scalability in mind (as some of
our projects are tipping into the 700+mil row count and rising)
* CuteModel is designed to be as simple and easy as possible - where as
django-reversion left me feeling a bit confused.

Looking at django-reversion, it certainly looks close to cutemodel, but
there are a few differences;

* Changes are serialized into the database, this adds a significant extra
size and CPU overhead (Version.serialized_data)
* Object references are stored as a TextField, this is not good for
performance (Version.object_id)
* Creates a new serialized object every time a row is added - this is
really really not good for performance(*.VERSION_ADD)
* Requires an additional model for every model you have if you want to
store custom meta data (cutemodel only requires 1)
* Uses signal rather than overriding the subclass - although this is
probably a better approach - thoughts anyone??
* In some ways the API is quite nice, but in others it seems a bit clunky.
* Requires you to create initial revisions dump - again, not good if you
have a lot of rows

That being said - there are definitely some good points from that app, and
a lot of features that would be great for CuteModel, such as;

* Grouping together field changes into a 'revision'
* Better low level API support
* Ability to revert a change

I'm certainly going to add those into the todos list - thanks for your
feedback!

Cal

On Tue, Sep 11, 2012 at 2:46 PM, jondykeman  wrote:

> Hello,
>
> I am in a very similar situation. I would in an environment that deals
> with sensitive data collection. Everything has to be two-factor
> authenticated, in the secure server zone etc. As part of this we need
> logging of every action ever taken, by whom, when, and what the changes
> were.
>
> At first I implemented my own custom solution which was less than ideal,
> but it worked. That was a model of creating a new record for each field any
> time there was a change to the value, but via a lot of manual checking
> code.
>
> I am not starting to migrate to a slicker solution. I am taking advantage
> of django-reversion.
>
> https://github.com/etianen/django-reversion
>
> This provides row level auditing out of the box, and then you just need to
> take advantage of the pre_commit_signal to track field changes as well.
>
> @receiver(reversion.pre_revision_commit)
> def it_worked(sender, **kwargs):
> currentVersion = kwargs.pop('versions')[0].field_dict
> pastVersion =
> reversion.get_for_object(kwargs.pop('instances')[0])[0].field_dict
> changes = set(currentVersion.items()) - set(pastVersion.items())
> changedVars = []
> for var in changes:
> changedVars.append(var[0])
> comment = "Changed: %s" % ", ".join(changedVars)
> revision = kwargs.pop('revision')
> revision.comment = comment
> revision.save()
> kwargs['revision'] = revision
>
> Rather than the string tracking which fields I am going to switch to a
> dict of changed or not for each variable.
>
> I will check out cutemodel for sure and let you know.
>
> Thanks,
>
> JD
>
>
> On Tuesday, September 11, 2012 3:46:54 AM UTC-6, Cal Leeming [Simplicity
> Media Ltd] wrote:
>>
>>
>>
>> On Mon, Sep 10, 2012 at 11:07 PM, Kurt Pruhs  wrote:
>>
>>> Hey Cal,
>>>
>>> This looks like a great tool. I know I've implemented code like this in
>>> another project. I was planning on doing a field change audit module for an
>>> application I'm currently working on. I will definitely look at
>>> django-cutemodel and see if it works for what I need, and how I can
>>> contribute.
>>> My current project is a time clock system for human resources to manage
>>> hourly workers. We need field change auditing for security, we need the
>>> ability to produce reports from it, and ability to restore from audit
>>> history (in case of record tampering).
>>
>>
>> I think django-cutemodel would be a pretty good fit for this requirement,
>> although it doesn't yet have any sort of administration interface to
>> produce reports, and the documentation isn't exactly great.
>>
>> Restore from audit history functionality is something we need for
>> ourselves too, so I've raised an issue (will prob fix that sometime this
>> week);
>> https://github.com/foxx/**django-cutemodel/issues/1
>>
>> We also need to have the ability to bind the Django User objects together
>> with the event/field change - but some of our clients don't use the Django
>> built-in user/auth stuff - so I need to have a little think about how to
>> satisfy both.
>> https://github.com/foxx/**django-cutemodel/issues/2
>>
>> Basically, all actions are logged and nothing is deleted or over-written.
>>> When changes are made, the original record is marked as a parent archive.
>>> The modified

Re: Django newbie with issues

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
+1 on virtualenv - I only just started using it about 3 months ago.. don't
know how the hell I survived without it for so long!

On Tue, Sep 11, 2012 at 2:59 PM, Thomas Lockhart wrote:

> On 9/11/12 6:29 AM, Morrti wrote:
>
>> Hi,
>>
>> We did try things with v1.5, but that also failed. Looking further it
>> seems that my branch on git was wrong.
>> Moving to the correct one for 1.1 has seemed to have corrected things,
>> well we got past that issue.
>> I'm going to continue with the tutorial now and see how that goes.
>>
> Please take the advice and use 1.4.1. And on the Mac I strongly recommend
> using virtualenv; it is hard to keep things straight otherwise.
>
> hth
>
> - 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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> 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-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: Iphone applications via django

2012-09-11 Thread Cal Leeming [Simplicity Media Ltd]
It would be a cold day in hell before I ever used XML for an API ;)

There's a whole ton of API wrappers for Django (hell you could write your
own in under 50 lines of code), but here is a pretty good one:

http://django-tastypie.readthedocs.org/en/latest/index.html

Tastypie is a bit complex to look at, but it is sane and ensures you keep
to good security and design principles.

Hope this helps!

Cal

On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch  wrote:

> Can you tell me how do i do that?
> Do you have any kind of blog or tutorial which would help me out
> connecting the web API's with iphone.
>
> Do you suggest JSON or XML ?
>
>
> On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming
> [Simplicity Media Ltd] wrote:
>
>> You can create a server side API for the app - but the actual interface
>> is done using the methods mentioned by Mario previously.
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:
>>
>>> Nope. You do objective c or html and js with something like phonegap
>>> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:
>>>
 How do you create iphone applications via django.
 Application logic will be django but what about user interface, do we
 do that with django too?

 --
 You received this message because you are subscribed to the Google
 Groups "Django users" group.
 To view this discussion on the web visit https://groups.google.com/d/**
 msg/django-users/-/**xL4mqQobAEUJ
 .
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 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...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/J44uT5ivqbIJ.
>
> 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.
>

-- 
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: Iphone applications via django

2012-09-11 Thread Sait Maraşlıoğlu
What do you mean by api wrapper, ur previous link a bit complicated and Im 
having a hard time understanding this term, can u explain in a smiple 
manner?


On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming [Simplicity Media 
Ltd] wrote:
>
> It would be a cold day in hell before I ever used XML for an API ;)
>
> There's a whole ton of API wrappers for Django (hell you could write your 
> own in under 50 lines of code), but here is a pretty good one:
>
> http://django-tastypie.readthedocs.org/en/latest/index.html 
>
> Tastypie is a bit complex to look at, but it is sane and ensures you keep 
> to good security and design principles.
>
> Hope this helps!
>
> Cal
>
> On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch  >wrote:
>
>> Can you tell me how do i do that? 
>> Do you have any kind of blog or tutorial which would help me out 
>> connecting the web API's with iphone.
>>
>> Do you suggest JSON or XML ?
>>
>>
>> On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming 
>> [Simplicity Media Ltd] wrote:
>>
>>> You can create a server side API for the app - but the actual interface 
>>> is done using the methods mentioned by Mario previously.
>>>
>>> Cal
>>>
>>> On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:
>>>
 Nope. You do objective c or html and js with something like phonegap
 On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:

>  How do you create iphone applications via django.
> Application logic will be django but what about user interface, do we 
> do that with django too?
>
> -- 
> You received this message because you are subscribed to the Google 
> Groups "Django users" group.
> To view this discussion on the web visit https://groups.google.com/d/*
> *msg/django-users/-/**xL4mqQobAEUJ
> .
> To post to this group, send email to django...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> 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...@googlegroups.com.
 To unsubscribe from this group, send email to django-users...@**
 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 view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/J44uT5ivqbIJ.
>>
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/F73khMkPWO4J.
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: Iphone applications via django

2012-09-11 Thread Kurtis Mullins
I can offer some information if you can share your "skill level" when it
comes to developing iOS and/or Django Applications.

1. Do you currently know how to program iOS Applications? If so, do you
have any experience writing iOS programs that can handle HTTP Requests? If
the answer to either of those is "no", then you may want to dive in to some
iOS coding first. Alternatively, skip to #2:

2. Do you know how to program Django Applications? If so, do you have a
pretty good understanding of the Server-Client Paradigm?

There's many different approaches you can take to this problem. One
approach would be to create an iOS Application which uses a Django
Application as a "back-end". Another approach would be to simply write a
Django Application and use HTML to make the web site look like a native iOS
Application. There's pros and cons to each of these methods. One or the
other may be easier dependent upon what you're trying to accomplish in this
particular Mobile Application as well as your skill level and how much
time/motivation you have to learn new technologies.

On Tue, Sep 11, 2012 at 3:41 PM, Sait Maraşlıoğlu wrote:

> What do you mean by api wrapper, ur previous link a bit complicated and Im
> having a hard time understanding this term, can u explain in a smiple
> manner?
>
>
>
> On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming [Simplicity
> Media Ltd] wrote:
>
>> It would be a cold day in hell before I ever used XML for an API ;)
>>
>> There's a whole ton of API wrappers for Django (hell you could write your
>> own in under 50 lines of code), but here is a pretty good one:
>>
>> http://django-tastypie.**readthedocs.org/en/latest/**index.html
>>
>>
>> Tastypie is a bit complex to look at, but it is sane and ensures you keep
>> to good security and design principles.
>>
>> Hope this helps!
>>
>> Cal
>>
>> On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch  wrote:
>>
>>> Can you tell me how do i do that?
>>> Do you have any kind of blog or tutorial which would help me out
>>> connecting the web API's with iphone.
>>>
>>> Do you suggest JSON or XML ?
>>>
>>>
>>> On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming
>>> [Simplicity Media Ltd] wrote:
>>>
 You can create a server side API for the app - but the actual interface
 is done using the methods mentioned by Mario previously.

 Cal

 On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:

> Nope. You do objective c or html and js with something like phonegap
> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  wrote:
>
>>  How do you create iphone applications via django.
>> Application logic will be django but what about user interface, do we
>> do that with django too?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit https://groups.google.com/d/
>> **ms**g/django-users/-/**xL4mqQobAEUJ
>> .
>> To post to this group, send email to django...@googlegroups.com.
>> To unsubscribe from this group, send email to django-users...@**
>> 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...@googlegroups.com.
> To unsubscribe from this group, send email to django-users...@**
> 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 view this discussion on the web visit https://groups.google.com/d/**
>>> msg/django-users/-/**J44uT5ivqbIJ
>>> .
>>>
>>> To post to this group, send email to django...@googlegroups.com.
>>> To unsubscribe from this group, send email to django-users...@**
>>> 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 view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/F73khMkPWO4J.
>
> 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

Re: Iphone applications via django

2012-09-11 Thread Sait Maraşlıoğlu
For my skill levels, Ive started with python, then qt, pyqt,matplotlib ... 
and finnaly django, I m not complaining, django is just perfect. I m ok 
with django, I write and and I understand what I read. If I want to learn 
ios, answer is no, cause Ive been travelling alot lately among different 
enviroments and found django and now have to stop and learn it. Your 
approach about building a website and make it behave like an ios applcation 
seemed better for me. Recently I found twitters bootstrap, and responsive 
design, I think I can create a web site, for mobile phone. But I dont know 
its disadvantages
When I first read api wrapper and hell about using xml :) I just intrested, 
cause it seems like its something u use to communicate with some other 
layer of programming.
Recently I wrote a code look like this. its initial code and still has alot 
to do, have to do it modular and parametric.
"""
doc = Document()
rows = doc.createElement("rows")
doc.appendChild(rows)
head = doc.createElement("head")
rows.appendChild(head)
mycolumn = doc.createElement("column")
mycolumn.setAttribute("type", "ed")
mycolumn.setAttribute("sort", "str")
mycolumn.setAttribute("color", "red")
mycolumn.setAttribute("width", "150")
head.appendChild(mycolumn)
ctext = doc.createTextNode("This is a test!")
mycolumn.appendChild(ctext)
for e in Material.objects.all()[15:55]:
myrow = doc.createElement("row")
myrow.setAttribute("id", e.material)
rows.appendChild(myrow)
mycell = doc.createElement("cell")
myrow.appendChild(mycell)
ptext = doc.createTextNode(e.stext)
mycell.appendChild(ptext)
#print doc.toprettyxml(indent="  ")
data = doc.toprettyxml(indent=" ")
"""
this is basically generates some xml and returns via httprequest using 
django, and it works. I use this xml to communicate with dhmtlx grids. I 
was thinking to write some code and make it parametric, with a lot of if 
loops. 
If I can do that, is it going to be an api wrapper :) 
its just what I understood, it may be complately another thing.

On Tuesday, 11 September 2012 22:57:25 UTC+3, Kurtis wrote:
>
> I can offer some information if you can share your "skill level" when it 
> comes to developing iOS and/or Django Applications.
>
> 1. Do you currently know how to program iOS Applications? If so, do you 
> have any experience writing iOS programs that can handle HTTP Requests? If 
> the answer to either of those is "no", then you may want to dive in to some 
> iOS coding first. Alternatively, skip to #2:
>
> 2. Do you know how to program Django Applications? If so, do you have a 
> pretty good understanding of the Server-Client Paradigm?
>
> There's many different approaches you can take to this problem. One 
> approach would be to create an iOS Application which uses a Django 
> Application as a "back-end". Another approach would be to simply write a 
> Django Application and use HTML to make the web site look like a native iOS 
> Application. There's pros and cons to each of these methods. One or the 
> other may be easier dependent upon what you're trying to accomplish in this 
> particular Mobile Application as well as your skill level and how much 
> time/motivation you have to learn new technologies.
>
> On Tue, Sep 11, 2012 at 3:41 PM, Sait Maraşlıoğlu 
> 
> > wrote:
>
>> What do you mean by api wrapper, ur previous link a bit complicated and 
>> Im having a hard time understanding this term, can u explain in a smiple 
>> manner?
>>
>>
>>
>> On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming [Simplicity 
>> Media Ltd] wrote:
>>
>>> It would be a cold day in hell before I ever used XML for an API ;)
>>>
>>> There's a whole ton of API wrappers for Django (hell you could write 
>>> your own in under 50 lines of code), but here is a pretty good one:
>>>
>>> http://django-tastypie.**readthedocs.org/en/latest/**index.html
>>>  
>>>
>>> Tastypie is a bit complex to look at, but it is sane and ensures you 
>>> keep to good security and design principles.
>>>
>>> Hope this helps!
>>>
>>> Cal
>>>
>>> On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch  wrote:
>>>
 Can you tell me how do i do that? 
 Do you have any kind of blog or tutorial which would help me out 
 connecting the web API's with iphone.

 Do you suggest JSON or XML ?


 On Tuesday, September 11, 2012 4:09:35 PM UTC+5:30, Cal Leeming 
 [Simplicity Media Ltd] wrote:

> You can create a server side API for the app - but the actual 
> interface is done using the methods mentioned by Mario previously.
>
> Cal
>
> On Tue, Sep 11, 2012 at 11:09 AM, Mario Gudelj wrote:
>
>> Nope. You do objective c or html and js with something like phonegap
>> On Sep 11, 2012 6:59 PM, "Sait Maraşlıoğlu"  
>> wrote:
>>
>>>  How do you create iphone applications via django.

Re: Iphone applications via django

2012-09-11 Thread Nikolas Stevenson-Molnar
For web applications, I'd recommend using JSON instead of XML:
http://en.wikipedia.org/wiki/Json

It's easier to work with and Python has a json module which will convert
a Python dictionary to a JSON-formatted string ready to return to the
client. Most JS libraries also have functions to turn JSON-formatted
strings into JS objects and the other way around.

_Nik

On 9/11/2012 1:23 PM, Sait Maraşlıoğlu wrote:
> For my skill levels, Ive started with python, then qt, pyqt,matplotlib
> ... and finnaly django, I m not complaining, django is just perfect. I
> m ok with django, I write and and I understand what I read. If I want
> to learn ios, answer is no, cause Ive been travelling alot lately
> among different enviroments and found django and now have to stop and
> learn it. Your approach about building a website and make it behave
> like an ios applcation seemed better for me. Recently I found twitters
> bootstrap, and responsive design, I think I can create a web site, for
> mobile phone. But I dont know its disadvantages
> When I first read api wrapper and hell about using xml :) I just
> intrested, cause it seems like its something u use to communicate with
> some other layer of programming.
> Recently I wrote a code look like this. its initial code and still has
> alot to do, have to do it modular and parametric.
> """
> doc = Document()
> rows = doc.createElement("rows")
> doc.appendChild(rows)
> head = doc.createElement("head")
> rows.appendChild(head)
> mycolumn = doc.createElement("column")
> mycolumn.setAttribute("type", "ed")
> mycolumn.setAttribute("sort", "str")
> mycolumn.setAttribute("color", "red")
> mycolumn.setAttribute("width", "150")
> head.appendChild(mycolumn)
> ctext = doc.createTextNode("This is a test!")
> mycolumn.appendChild(ctext)
> for e in Material.objects.all()[15:55]:
> myrow = doc.createElement("row")
> myrow.setAttribute("id", e.material)
> rows.appendChild(myrow)
> mycell = doc.createElement("cell")
> myrow.appendChild(mycell)
> ptext = doc.createTextNode(e.stext)
> mycell.appendChild(ptext)
> #print doc.toprettyxml(indent="  ")
> data = doc.toprettyxml(indent=" ")
> """
> this is basically generates some xml and returns via httprequest using
> django, and it works. I use this xml to communicate with dhmtlx grids.
> I was thinking to write some code and make it parametric, with a lot
> of if loops.
> If I can do that, is it going to be an api wrapper :)
> its just what I understood, it may be complately another thing.
>
> On Tuesday, 11 September 2012 22:57:25 UTC+3, Kurtis wrote:
>
> I can offer some information if you can share your "skill level"
> when it comes to developing iOS and/or Django Applications.
>
> 1. Do you currently know how to program iOS Applications? If so,
> do you have any experience writing iOS programs that can handle
> HTTP Requests? If the answer to either of those is "no", then you
> may want to dive in to some iOS coding first. Alternatively, skip
> to #2:
>
> 2. Do you know how to program Django Applications? If so, do you
> have a pretty good understanding of the Server-Client Paradigm?
>
> There's many different approaches you can take to this problem.
> One approach would be to create an iOS Application which uses a
> Django Application as a "back-end". Another approach would be to
> simply write a Django Application and use HTML to make the web
> site look like a native iOS Application. There's pros and cons to
> each of these methods. One or the other may be easier dependent
> upon what you're trying to accomplish in this particular Mobile
> Application as well as your skill level and how much
> time/motivation you have to learn new technologies.
>
> On Tue, Sep 11, 2012 at 3:41 PM, Sait Maraşlıoğlu
> > wrote:
>
> What do you mean by api wrapper, ur previous link a bit
> complicated and Im having a hard time understanding this term,
> can u explain in a smiple manner?
>
>
>
> On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming
> [Simplicity Media Ltd] wrote:
>
> It would be a cold day in hell before I ever used XML for
> an API ;)
>
> There's a whole ton of API wrappers for Django (hell you
> could write your own in under 50 lines of code), but here
> is a pretty good one:
>
> http://django-tastypie.readthedocs.org/en/latest/index.html 
>  
>
> Tastypie is a bit complex to look at, but it is sane and
> ensures you keep to good security and design principles.
>
> Hope this helps!
>
> Cal
>
> On Tue, Sep 11, 2012 at 7:56 PM, Ray Ch
>  wrote:
>
> Can you tell me how do i do that? 
>

Re: Best free web hosting portal

2012-09-11 Thread Thomas Orozco
You can also try https://www.pythonanywhere.com/
Their free offering, however, doesn't seem as interesting as Anton's appfog

2012/9/10 Anton Popovine 

> Hello,
>
> http://www.appfog.com/  came out of closed beta recently. They support
> python and django.
>
> You get quite alot for free. (2Gb ram, unlimited # of instances, 10
> services)
>
> Anton
>
> On Monday, September 10, 2012 10:51:07 AM UTC+2, Somnath wrote:
>>
>> Hello friends,
>>
>>I want to host my site on free web hosting for testing purpose,
>> so anyone give me suggestion on best free web hosting site for django
>> website.
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/wpKvLXGL9gwJ.
>
> 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.
>

-- 
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: Marketplace for Django apps

2012-09-11 Thread Thomas Orozco
You could always use https://www.gittip.com/ to that end,
Basically, it allows you to tip developers that are on github

For instance, you could tip django devs at:
https://www.gittip.com/on/github/django/

You can see that: https://www.gittip.com/aaugustin/ or
https://www.gittip.com/alex/, among other django devs, opted into gittip,

Cheers,

2012/9/11 Kurtis Mullins 

> How about a compromise; just an easier way to donate to Django and Django
> Application developers? It would encourage sharing high quality projects
> and hopefully make it worth our time (financially, not just because we love
> and support libre software) to do so. For that matter, there's all sorts of
> ways to make money around free software (laid out by RMS among others) such
> as Paid Support, selling printed documentation, etc...
>
>
> On Tue, Sep 11, 2012 at 1:36 PM, Jorge Vargas wrote:
>
>> I agree with Jonas here. having a place were you have get apps to solve
>> hard problems no one has done right (ecommerce is a very good example) is a
>> plus.
>>
>> As for it being "cancer" and bad I don't agree there is a market for
>> everything. And that will bring more people in which in the end is what
>> everyone wants.
>> I do agree that it should be clear that said store will be managed by a
>> third party and not Django itself.
>>
>>
>> On Tue, Sep 11, 2012 at 7:11 AM,  wrote:
>>
>>>
>>>
 I want to ask you again, what you think about such service? Would you
 buy or sell apps (or paid support) out there and why?


>>> If the apps are more then good enough and would spare companies time and
>>> there are no better or equal opensource alternatives,
>>> then yes I do believe some people might be willing to buy apps in such a
>>> market place. For example there is no real outstanding e-commerce
>>> application for django.
>>>
>>>
>>> --
>>> 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+unsubscribe@*
>>> *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-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.
>>
>
>  --
> 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.
>

-- 
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: Override save or other options?

2012-09-11 Thread Lachlan Musicman
On Tue, Sep 11, 2012 at 5:15 PM, Jani Tiainen  wrote:
>
> Rather than creating individual series of events from recurring I would do a
> concept called "recurring event". So it would be just a single event that is
> projected to spesific days as necessary. It requires a slightly more work
> but it's easier to maintain - for example entry would just state:
>
> recurring = True
> frequence = WEEKLY
> start_date = 2012-09-11
> end_date = 2012-12-01
> start_time = 09:00
> end_time = 10:00
>
> Then I would roll out custom non-database concept of "calendar day" that
> would be projected from database using both individual entries and recurring
> entries.
>
> Later on it would be very easy to modify existing recurring events and for
> example add cancellation of single event by creating overriding events
> concept.
>
> This way amount of data will be kept relatively small, it's much easier to
> read and modify. Of course drawback is that you need top level mechanisms to
> work with single calendar entries that map to your database representation.

Great, and obvious, idea - unfortunately a bad fit. Each event needs
to be an object as there are student attendance records and staff
attendance records linked to each individually.

I was thinking about it last night and it occurred to me that instead
of using the admin interface I should just write my own form and then
do the multiple object creation in the view - it makes sense to me,
although I'm sure I've miffed something up.

Other ideas still welcome.

cheers
L.



-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Thank you Mike for your answer. I started this topic, because i have an
assignment at my Faculty, which requires connection between Django and an
LDAP (assistant insisted on 389ds). I installed Django, enabled admin,
logged in through Firefox. I can't make up my mind, do i need to connect
Django and LDAP like so that all users from LDAP can login through e.g.
localhost:8000/admin, or do i need to make a register/login page, where
users from LDAP server can login and onlu admin can login from admin page?
The second is mpre logical to me, but i don't know, because i am new to
Django and Python.



On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst wrote:

> On 11/09/2012 4:14am, Tony wrote:
>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my users) and i
>> need to somehow connect them two, so i can auth users from LDAP when
>> logging into Django. i have read some documentation, and i saw a massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>
> I think the best first step is to tightly specify your requirements. There
> are lots of different approaches and your choice of available open source
> depends a lot on what you want to do. For example, you may be interested in
> ldap group membership being related to Django groups.
>
> Being new to Python and Django isn't a problem. Look at Mark Pilgrim's
> Dive into Python (the first one which covers Python 2.x) then do the Django
> tutorials up to the point where the Django Admin is working for you. That
> will demonstrate "add this, add that" and make it easier for you. Also,
> install pip for fetching this and that!
>
> The Django Admin auth will happily/easily accept external auth backends.
>
> I have stopped using ldap nowadays but when I had it working the general
> principle employed was to query the ldap server and if it authenticated the
> offered userid and password AND the userid didn't exist in the Django user
> table, the backend inserted a new record.
>
> From my own experience I can recommend you start with a plan to unit test
> absolutely everything. The ldap side of things is tricky. Once you get your
> head around Python and Django you will really appreciate the nth degree of
> flexibility.
>
> Good luck
>
> Mike
>
>
>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/**msg/django-users/-/**7ArlkeKjY0YJ
>> .
>> To post to this group, send email to django-users@googlegroups.com.
>> To unsubscribe from this group, send email to
>> django-users+unsubscribe@**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-users@googlegroups.com.
> To unsubscribe from this group, send email to django-users+unsubscribe@**
> 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-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: Django and LDAP

2012-09-11 Thread Mike Dewhirst

On 12/09/2012 7:49am, Ivan Pavlović wrote:

Thank you Mike for your answer. I started this topic, because i have an
assignment at my Faculty, which requires connection between Django and
an LDAP (assistant insisted on 389ds). I installed Django, enabled
admin, logged in through Firefox. I can't make up my mind, do i need to
connect Django and LDAP like so that all users from LDAP can login
through e.g. localhost:8000/admin, or do i need to make a register/login
page, where users from LDAP server can login and onlu admin can login
from admin page? The second is mpre logical to me, but i don't know,
because i am new to Django and Python.


It is immaterial where it is hosted except localhost:8000 is usually the 
development machine running the development server. It comes with a 
caveat "not for production use". You really need a production web server 
for production.


Your other questions are unanswerable without a set of specs. You can 
use the admin or not and you can use the login/auth with your own app 
and/or the admin depending on the url you use. Users can be permitted to 
use the admin or not depending on user.is_staff


There is no substitute for getting started.





On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst mailto:mi...@dewhirst.com.au>> wrote:

On 11/09/2012 4:14am, Tony wrote:

Hi everybody,

I am new to Django and Python, and right now, i am going through the
documentation. I have an assignment at my Faculty, where i need to
install Django, 389ds LDAP server (where i have to store my
users) and i
need to somehow connect them two, so i can auth users from LDAP when
logging into Django. i have read some documentation, and i saw a
massive
lines of code, add this, add that, and i don't get any of that.


I think the best first step is to tightly specify your requirements.
There are lots of different approaches and your choice of available
open source depends a lot on what you want to do. For example, you
may be interested in ldap group membership being related to Django
groups.

Being new to Python and Django isn't a problem. Look at Mark
Pilgrim's Dive into Python (the first one which covers Python 2.x)
then do the Django tutorials up to the point where the Django Admin
is working for you. That will demonstrate "add this, add that" and
make it easier for you. Also, install pip for fetching this and that!

The Django Admin auth will happily/easily accept external auth backends.

I have stopped using ldap nowadays but when I had it working the
general principle employed was to query the ldap server and if it
authenticated the offered userid and password AND the userid didn't
exist in the Django user table, the backend inserted a new record.

 >From my own experience I can recommend you start with a plan to
unit test absolutely everything. The ldap side of things is tricky.
Once you get your head around Python and Django you will really
appreciate the nth degree of flexibility.

Good luck

Mike



Can someone please help me with this issue, i'll be very grateful.

Thank you

--
You received this message because you are subscribed to the Google
Groups "Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/__msg/django-users/-/__7ArlkeKjY0YJ
.
To post to this group, send email to
django-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscribe@__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-users@googlegroups.com
.
To unsubscribe from this group, send email to
django-users+unsubscribe@__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-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.


--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post t

Re: Django and LDAP

2012-09-11 Thread Thomas Lockhart

On 9/11/12 2:49 PM, Ivan Pavlović wrote:
Thank you Mike for your answer. I started this topic, because i have 
an assignment at my Faculty, which requires connection between Django 
and an LDAP (assistant insisted on 389ds). I installed Django, enabled 
admin, logged in through Firefox. I can't make up my mind, do i need 
to connect Django and LDAP like so that all users from LDAP can login 
through e.g. localhost:8000/admin, or do i need to make a 
register/login page, where users from LDAP server can login and onlu 
admin can login from admin page? The second is mpre logical to me, but 
i don't know, because i am new to Django and Python.
I believe that you will write a (small) middleware function which will 
be added to the tuple PASSWORD_HASHERS in your settings.py. The 
middleware will take the username and password already provided by the 
user from an existing login page and then access your LDAP server for 
the authentication.


You can probably find example code for that middleware function in 
Django; I needed to use existing Drupal (ugh) passwords for a content 
conversion to Mezzanine and found an example, probably on django-snippets.


hth

- 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-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: Django and LDAP

2012-09-11 Thread Ivan Pavlović
Once again, thank you. If you have some advices or pointers where to start
(besides the ones you've already mentioned), how to develop my knowledge,
please feel free to share with me.

Grateful
Tony

On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst wrote:

> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>
>> Thank you Mike for your answer. I started this topic, because i have an
>> assignment at my Faculty, which requires connection between Django and
>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>> admin, logged in through Firefox. I can't make up my mind, do i need to
>> connect Django and LDAP like so that all users from LDAP can login
>> through e.g. localhost:8000/admin, or do i need to make a register/login
>> page, where users from LDAP server can login and onlu admin can login
>> from admin page? The second is mpre logical to me, but i don't know,
>> because i am new to Django and Python.
>>
>
> It is immaterial where it is hosted except localhost:8000 is usually the
> development machine running the development server. It comes with a caveat
> "not for production use". You really need a production web server for
> production.
>
> Your other questions are unanswerable without a set of specs. You can use
> the admin or not and you can use the login/auth with your own app and/or
> the admin depending on the url you use. Users can be permitted to use the
> admin or not depending on user.is_staff
>
> There is no substitute for getting started.
>
>
>>
>>
>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst > **> wrote:
>>
>> On 11/09/2012 4:14am, Tony wrote:
>>
>> Hi everybody,
>>
>> I am new to Django and Python, and right now, i am going through
>> the
>> documentation. I have an assignment at my Faculty, where i need to
>> install Django, 389ds LDAP server (where i have to store my
>> users) and i
>> need to somehow connect them two, so i can auth users from LDAP
>> when
>> logging into Django. i have read some documentation, and i saw a
>> massive
>> lines of code, add this, add that, and i don't get any of that.
>>
>>
>> I think the best first step is to tightly specify your requirements.
>> There are lots of different approaches and your choice of available
>> open source depends a lot on what you want to do. For example, you
>> may be interested in ldap group membership being related to Django
>> groups.
>>
>> Being new to Python and Django isn't a problem. Look at Mark
>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>> then do the Django tutorials up to the point where the Django Admin
>> is working for you. That will demonstrate "add this, add that" and
>> make it easier for you. Also, install pip for fetching this and that!
>>
>> The Django Admin auth will happily/easily accept external auth
>> backends.
>>
>> I have stopped using ldap nowadays but when I had it working the
>> general principle employed was to query the ldap server and if it
>> authenticated the offered userid and password AND the userid didn't
>> exist in the Django user table, the backend inserted a new record.
>>
>>  >From my own experience I can recommend you start with a plan to
>> unit test absolutely everything. The ldap side of things is tricky.
>> Once you get your head around Python and Django you will really
>> appreciate the nth degree of flexibility.
>>
>> Good luck
>>
>> Mike
>>
>>
>>
>> Can someone please help me with this issue, i'll be very grateful.
>>
>> Thank you
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/__**msg/django-users/-/__**
>> 7ArlkeKjY0YJ
>> 
>> 
>> >.
>>
>> To post to this group, send email to
>> django-users@googlegroups.com
>> 
>> > >.
>>
>> To unsubscribe from this group, send email to
>> 
>> django-users+unsubscribe@__goo**glegroups.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 t

Re: Django and LDAP

2012-09-11 Thread Ivan Pavlović
I appreciate it Thomas :)

On Wed, Sep 12, 2012 at 12:11 AM, Ivan Pavlović
wrote:

> Once again, thank you. If you have some advices or pointers where to start
> (besides the ones you've already mentioned), how to develop my knowledge,
> please feel free to share with me.
>
> Grateful
> Tony
>
>
> On Wed, Sep 12, 2012 at 12:05 AM, Mike Dewhirst wrote:
>
>> On 12/09/2012 7:49am, Ivan Pavlović wrote:
>>
>>> Thank you Mike for your answer. I started this topic, because i have an
>>> assignment at my Faculty, which requires connection between Django and
>>> an LDAP (assistant insisted on 389ds). I installed Django, enabled
>>> admin, logged in through Firefox. I can't make up my mind, do i need to
>>> connect Django and LDAP like so that all users from LDAP can login
>>> through e.g. localhost:8000/admin, or do i need to make a register/login
>>> page, where users from LDAP server can login and onlu admin can login
>>> from admin page? The second is mpre logical to me, but i don't know,
>>> because i am new to Django and Python.
>>>
>>
>> It is immaterial where it is hosted except localhost:8000 is usually the
>> development machine running the development server. It comes with a caveat
>> "not for production use". You really need a production web server for
>> production.
>>
>> Your other questions are unanswerable without a set of specs. You can use
>> the admin or not and you can use the login/auth with your own app and/or
>> the admin depending on the url you use. Users can be permitted to use the
>> admin or not depending on user.is_staff
>>
>> There is no substitute for getting started.
>>
>>
>>>
>>>
>>> On Tue, Sep 11, 2012 at 12:36 AM, Mike Dewhirst >> **> wrote:
>>>
>>> On 11/09/2012 4:14am, Tony wrote:
>>>
>>> Hi everybody,
>>>
>>> I am new to Django and Python, and right now, i am going through
>>> the
>>> documentation. I have an assignment at my Faculty, where i need
>>> to
>>> install Django, 389ds LDAP server (where i have to store my
>>> users) and i
>>> need to somehow connect them two, so i can auth users from LDAP
>>> when
>>> logging into Django. i have read some documentation, and i saw a
>>> massive
>>> lines of code, add this, add that, and i don't get any of that.
>>>
>>>
>>> I think the best first step is to tightly specify your requirements.
>>> There are lots of different approaches and your choice of available
>>> open source depends a lot on what you want to do. For example, you
>>> may be interested in ldap group membership being related to Django
>>> groups.
>>>
>>> Being new to Python and Django isn't a problem. Look at Mark
>>> Pilgrim's Dive into Python (the first one which covers Python 2.x)
>>> then do the Django tutorials up to the point where the Django Admin
>>> is working for you. That will demonstrate "add this, add that" and
>>> make it easier for you. Also, install pip for fetching this and that!
>>>
>>> The Django Admin auth will happily/easily accept external auth
>>> backends.
>>>
>>> I have stopped using ldap nowadays but when I had it working the
>>> general principle employed was to query the ldap server and if it
>>> authenticated the offered userid and password AND the userid didn't
>>> exist in the Django user table, the backend inserted a new record.
>>>
>>>  >From my own experience I can recommend you start with a plan to
>>> unit test absolutely everything. The ldap side of things is tricky.
>>> Once you get your head around Python and Django you will really
>>> appreciate the nth degree of flexibility.
>>>
>>> Good luck
>>>
>>> Mike
>>>
>>>
>>>
>>> Can someone please help me with this issue, i'll be very
>>> grateful.
>>>
>>> Thank you
>>>
>>> --
>>> You received this message because you are subscribed to the
>>> Google
>>> Groups "Django users" group.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/__**msg/django-users/-/__**
>>> 7ArlkeKjY0YJ
>>> 
>>> 
>>> >.
>>>
>>> To post to this group, send email to
>>> django-users@googlegroups.com
>>> 
>>> >> >.
>>>
>>> To unsubscribe from this group, send email to
>>> 
>>> django-users+unsubscribe@__goo**glegroups.com
>>> 
>>> >> **>.
>>>
>>> For more options, visit this group at
>>> 
>>> http://groups.google.com/__**group/django-users?hl=en
>>> 
>>> 

Re: Iphone applications via django

2012-09-11 Thread Mario Gudelj
Sait,

Just dive into Tasty Pie. It will easily interface your models with a JSON
feed. On the client side you then use this JSON feed in your JavaScript to
construct your web pages or do whatever you want with it. I think this
would be the best model for you. Django with Tasty Pie for the server side
and JavaScript and HTML for the client side.

_M


On 12 September 2012 07:02, Nikolas Stevenson-Molnar  wrote:

>  For web applications, I'd recommend using JSON instead of XML:
> http://en.wikipedia.org/wiki/Json
>
> It's easier to work with and Python has a json module which will convert a
> Python dictionary to a JSON-formatted string ready to return to the client.
> Most JS libraries also have functions to turn JSON-formatted strings into
> JS objects and the other way around.
>
> _Nik
>
>
> On 9/11/2012 1:23 PM, Sait Maraşlıoğlu wrote:
>
> For my skill levels, Ive started with python, then qt, pyqt,matplotlib ...
> and finnaly django, I m not complaining, django is just perfect. I m ok
> with django, I write and and I understand what I read. If I want to learn
> ios, answer is no, cause Ive been travelling alot lately among different
> enviroments and found django and now have to stop and learn it. Your
> approach about building a website and make it behave like an ios applcation
> seemed better for me. Recently I found twitters bootstrap, and responsive
> design, I think I can create a web site, for mobile phone. But I dont know
> its disadvantages
> When I first read api wrapper and hell about using xml :) I just
> intrested, cause it seems like its something u use to communicate with some
> other layer of programming.
> Recently I wrote a code look like this. its initial code and still has
> alot to do, have to do it modular and parametric.
> """
> doc = Document()
> rows = doc.createElement("rows")
> doc.appendChild(rows)
> head = doc.createElement("head")
> rows.appendChild(head)
> mycolumn = doc.createElement("column")
> mycolumn.setAttribute("type", "ed")
> mycolumn.setAttribute("sort", "str")
> mycolumn.setAttribute("color", "red")
> mycolumn.setAttribute("width", "150")
> head.appendChild(mycolumn)
> ctext = doc.createTextNode("This is a test!")
> mycolumn.appendChild(ctext)
> for e in Material.objects.all()[15:55]:
> myrow = doc.createElement("row")
> myrow.setAttribute("id", e.material)
> rows.appendChild(myrow)
> mycell = doc.createElement("cell")
> myrow.appendChild(mycell)
> ptext = doc.createTextNode(e.stext)
> mycell.appendChild(ptext)
> #print doc.toprettyxml(indent="  ")
> data = doc.toprettyxml(indent=" ")
> """
> this is basically generates some xml and returns via httprequest using
> django, and it works. I use this xml to communicate with dhmtlx grids. I
> was thinking to write some code and make it parametric, with a lot of if
> loops.
> If I can do that, is it going to be an api wrapper :)
> its just what I understood, it may be complately another thing.
>
> On Tuesday, 11 September 2012 22:57:25 UTC+3, Kurtis wrote:
>>
>> I can offer some information if you can share your "skill level" when it
>> comes to developing iOS and/or Django Applications.
>>
>>  1. Do you currently know how to program iOS Applications? If so, do you
>> have any experience writing iOS programs that can handle HTTP Requests? If
>> the answer to either of those is "no", then you may want to dive in to some
>> iOS coding first. Alternatively, skip to #2:
>>
>>  2. Do you know how to program Django Applications? If so, do you have a
>> pretty good understanding of the Server-Client Paradigm?
>>
>>  There's many different approaches you can take to this problem. One
>> approach would be to create an iOS Application which uses a Django
>> Application as a "back-end". Another approach would be to simply write a
>> Django Application and use HTML to make the web site look like a native iOS
>> Application. There's pros and cons to each of these methods. One or the
>> other may be easier dependent upon what you're trying to accomplish in this
>> particular Mobile Application as well as your skill level and how much
>> time/motivation you have to learn new technologies.
>>
>> On Tue, Sep 11, 2012 at 3:41 PM, Sait Maraşlıoğlu wrote:
>>
>>> What do you mean by api wrapper, ur previous link a bit complicated and
>>> Im having a hard time understanding this term, can u explain in a smiple
>>> manner?
>>>
>>>
>>>
>>> On Tuesday, 11 September 2012 22:18:34 UTC+3, Cal Leeming [Simplicity
>>> Media Ltd] wrote:
>>>
 It would be a cold day in hell before I ever used XML for an API ;)

  There's a whole ton of API wrappers for Django (hell you could write
 your own in under 50 lines of code), but here is a pretty good one:

  
 http://django-tastypie.readthe**docs.org/en/latest/index.html


  Tastypie is 

Re: Cant Import mysite.urls

2012-09-11 Thread patrick
On Tuesday, September 11, 2012 1:44:22 AM UTC-3, Jon Blake wrote:
>
> Thanks, Patrick. My reference to utils.py should have been to urls.py, 
> which I have in my mysite app package.
>
> I'm seeing this import error on mysite.urls when I'm attempting to get 
> Apache + mod_wsgi to serve my app. I don't remember seeing this error with 
> the development server when I first tried out the tutorials. Probably got 
> my configs wrong, somewhere in my second try.
>
> I'll start a new app, now that I know a little bit more about how this all 
> works. It's a steep learning curve!


It will get better. At one point, I found that the biggest problem I was 
having that I was expecting things to be harder than they actually were.

You might want to also take a look at the tutorials 
at: http://lightbird.net/dbe/

They were written for Django 1.2, but should still work in Django 1.4 and 
get you to build other types of apps, so you'll get more insight into what 
Django has to offer. 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/TLe2mW1rApwJ.
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: Override save or other options?

2012-09-11 Thread Mario Gudelj
I had to do the same thing recently. I had to grab the frequency, interval
etc. (used rrule for that) and then had to look at the first event instance
and create multiple instances from that event inside the view. If you
create a series model and use it as a foreign key in your event to keep on
top of everything it should work.

-m

On 12 September 2012 07:31, Lachlan Musicman  wrote:

> On Tue, Sep 11, 2012 at 5:15 PM, Jani Tiainen  wrote:
> >
> > Rather than creating individual series of events from recurring I would
> do a
> > concept called "recurring event". So it would be just a single event
> that is
> > projected to spesific days as necessary. It requires a slightly more work
> > but it's easier to maintain - for example entry would just state:
> >
> > recurring = True
> > frequence = WEEKLY
> > start_date = 2012-09-11
> > end_date = 2012-12-01
> > start_time = 09:00
> > end_time = 10:00
> >
> > Then I would roll out custom non-database concept of "calendar day" that
> > would be projected from database using both individual entries and
> recurring
> > entries.
> >
> > Later on it would be very easy to modify existing recurring events and
> for
> > example add cancellation of single event by creating overriding events
> > concept.
> >
> > This way amount of data will be kept relatively small, it's much easier
> to
> > read and modify. Of course drawback is that you need top level
> mechanisms to
> > work with single calendar entries that map to your database
> representation.
>
> Great, and obvious, idea - unfortunately a bad fit. Each event needs
> to be an object as there are student attendance records and staff
> attendance records linked to each individually.
>
> I was thinking about it last night and it occurred to me that instead
> of using the admin interface I should just write my own form and then
> do the multiple object creation in the view - it makes sense to me,
> although I'm sure I've miffed something up.
>
> Other ideas still welcome.
>
> cheers
> L.
>
>
>
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world
> was in the grip of authentic-seeming future narratives. He said, “We
> look at the present through a rear-view mirror. We march backwards
> into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> 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.
>
>

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



Newbie Project Setup and Terminology Questions

2012-09-11 Thread Matthew Woodward
Hi all -- semi-new to Django but learning fast and enjoyed meeting a lot of
folks at DjangoCon last week! I have some basic project setup and
terminology questions I'm hoping to get some thoughts on.

Basically I'm curious as to the convention about creating a project using
virtualenv and then adding applications to the project in terms of where
the files are placed. I'll just go through what I've been doing and I'd
welcome any and all feedback as to where I'm breaking with conventional
wisdom.

Let's say I'm starting a new project foo and run this from a ~/projects
directory:
virutalenv foo

So at that point I have ~/projects/foo I then cd into that directory,
activate that virtualenv, and install Django
cd ~/projects/foo
source bin/activate
bin/pip install django

I then start the Django project from ~/projects/foo:
bin/django-admin.py startproject foo

At that point I have ~/projects/foo/foo for my project directory, and in
there it puts another foo for the foo application (I'm assuming that's
accurate terminology? or is that the "project" since that's where
settings.py lives?).

So it's clear what I have at this point:
~/projects/foo <-- root virtualenv directory containing bin, include, etc.
~/projects/foo/foo <-- root project directory containing manage.py and foo
application (or is it called project?) directory
~/projects/foo/foo/foo <-- foo application (project?) directory containing
settings.py, etc.

If that's correct thus far (and please let me know if not!), my next
question is where to create additional applications. I'm assuming that in
this case if I want to create a bar app I cd into ~/projects/foo/foo and
run:
python manage.py startapp bar

So that that point I have:
~/projects/foo/foo/foo <-- where settings.py lives
~/projects/foo/foo/bar <-- bar application files (models.py, etc.)

Specifically on this last piece, should I be creating things there or is
the convention to put applications in the same directory as settings.py, so
you wind up with your application directories at the same level as
settings.py? E.g.:
~/projects/foo/foo/foo <-- where settings.py lives
~/projects/foo/foo/foo/bar <-- bar application files

It certainly works fine the way I'm doing it as long as I reference the
location of the application files correctly, but in a lot of the books I've
been reading application files would be referenced using this example as
'foo.bar' instead of just 'bar' which is what I wind up with the way I've
been doing things.

Any thoughts/pointers/admonitions/etc. are greatly appreciated.

Thanks,
Matt

-- 
Matthew Woodward
m...@mattwoodward.com
http://blog.mattwoodward.com
identi.ca / Twitter: @mpwoodward

Please do not send me proprietary file formats such as Word, PowerPoint,
etc. as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

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



Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
Hi

Is there anyway to import the choices from my models.py into my
forms.py to prevent code duplication?

At the moment I've got the following, but I'm getting invalid sytax
errors in my forms.py:

models.py :
SESSION_CHOICES = (
(u'0',u'Morning 1'),
(u'1',u'Morning 2'),
(u'2',u'Afternoon 1'),
(u'3',u'Afternoon 2'),
(u'4',u'Evening'),
(u'5',u'Weekend'),
)


forms.py:

from django import forms
from tafe.models import Session, Timetable, Subject
from tafe.models import SESSION_CHOICES

class SessionRecurringForm(forms.Form):
subject = forms.ModelChoiceField(queryset=Subject.objects.all)
timetable =
forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
session_number = forms.ChoiceField(choice=SESSION_CHOICES)


Is what I'm trying to do possible? I feel like I've seen someone do it
before, but it was in an unrelated code snippet, and I've no idea
where I found it...

cheers
L.

-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: Forms, ChoiceFields and import?

2012-09-11 Thread m1chael
it looks like you have a syntax error here:

timetable =
forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')

should be:

timetable
= forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date'))
  # added a )




On Tue, Sep 11, 2012 at 9:26 PM, Lachlan Musicman  wrote:

> Hi
>
> Is there anyway to import the choices from my models.py into my
> forms.py to prevent code duplication?
>
> At the moment I've got the following, but I'm getting invalid sytax
> errors in my forms.py:
> 
> models.py :
> SESSION_CHOICES = (
> (u'0',u'Morning 1'),
> (u'1',u'Morning 2'),
> (u'2',u'Afternoon 1'),
> (u'3',u'Afternoon 2'),
> (u'4',u'Evening'),
> (u'5',u'Weekend'),
> )
> 
>
> forms.py:
>
> from django import forms
> from tafe.models import Session, Timetable, Subject
> from tafe.models import SESSION_CHOICES
>
> class SessionRecurringForm(forms.Form):
> subject = forms.ModelChoiceField(queryset=Subject.objects.all)
> timetable =
> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
> session_number = forms.ChoiceField(choice=SESSION_CHOICES)
>
>
> Is what I'm trying to do possible? I feel like I've seen someone do it
> before, but it was in an unrelated code snippet, and I've no idea
> where I found it...
>
> cheers
> L.
>
> --
> ...we look at the present day through a rear-view mirror. This is
> something Marshall McLuhan said back in the Sixties, when the world
> was in the grip of authentic-seeming future narratives. He said, “We
> look at the present through a rear-view mirror. We march backwards
> into the future.”
>
> http://www.warrenellis.com/?p=14314
>
> --
> 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.
>
>

-- 
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: Forms, ChoiceFields and import?

2012-09-11 Thread m1chael
Timtables  should also be  Timetables

On Tue, Sep 11, 2012 at 9:30 PM, m1chael  wrote:

> it looks like you have a syntax error here:
>
> timetable =
> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
>
> should be:
>
> timetable
> = forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date'))
>   # added a )
>
>
>
>
> On Tue, Sep 11, 2012 at 9:26 PM, Lachlan Musicman wrote:
>
>> Hi
>>
>> Is there anyway to import the choices from my models.py into my
>> forms.py to prevent code duplication?
>>
>> At the moment I've got the following, but I'm getting invalid sytax
>> errors in my forms.py:
>> 
>> models.py :
>> SESSION_CHOICES = (
>> (u'0',u'Morning 1'),
>> (u'1',u'Morning 2'),
>> (u'2',u'Afternoon 1'),
>> (u'3',u'Afternoon 2'),
>> (u'4',u'Evening'),
>> (u'5',u'Weekend'),
>> )
>> 
>>
>> forms.py:
>>
>> from django import forms
>> from tafe.models import Session, Timetable, Subject
>> from tafe.models import SESSION_CHOICES
>>
>> class SessionRecurringForm(forms.Form):
>> subject = forms.ModelChoiceField(queryset=Subject.objects.all)
>> timetable =
>> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
>> session_number = forms.ChoiceField(choice=SESSION_CHOICES)
>>
>>
>> Is what I'm trying to do possible? I feel like I've seen someone do it
>> before, but it was in an unrelated code snippet, and I've no idea
>> where I found it...
>>
>> cheers
>> L.
>>
>> --
>> ...we look at the present day through a rear-view mirror. This is
>> something Marshall McLuhan said back in the Sixties, when the world
>> was in the grip of authentic-seeming future narratives. He said, “We
>> look at the present through a rear-view mirror. We march backwards
>> into the future.”
>>
>> http://www.warrenellis.com/?p=14314
>>
>> --
>> 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.
>>
>>
>

-- 
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: Forms, ChoiceFields and import?

2012-09-11 Thread Lachlan Musicman
On Wed, Sep 12, 2012 at 1:35 PM, m1chael  wrote:
> Timtables  should also be  Timetables

Yep - thanks. All good now, you were spot on with the missing parentheses
Cheers
L.

>
>
> On Tue, Sep 11, 2012 at 9:30 PM, m1chael  wrote:
>>
>> it looks like you have a syntax error here:
>>
>> timetable =
>> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
>>
>> should be:
>>
>> timetable =
>> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date'))
>> # added a )
>>
>>
>>
>>
>> On Tue, Sep 11, 2012 at 9:26 PM, Lachlan Musicman 
>> wrote:
>>>
>>> Hi
>>>
>>> Is there anyway to import the choices from my models.py into my
>>> forms.py to prevent code duplication?
>>>
>>> At the moment I've got the following, but I'm getting invalid sytax
>>> errors in my forms.py:
>>> 
>>> models.py :
>>> SESSION_CHOICES = (
>>> (u'0',u'Morning 1'),
>>> (u'1',u'Morning 2'),
>>> (u'2',u'Afternoon 1'),
>>> (u'3',u'Afternoon 2'),
>>> (u'4',u'Evening'),
>>> (u'5',u'Weekend'),
>>> )
>>> 
>>>
>>> forms.py:
>>>
>>> from django import forms
>>> from tafe.models import Session, Timetable, Subject
>>> from tafe.models import SESSION_CHOICES
>>>
>>> class SessionRecurringForm(forms.Form):
>>> subject = forms.ModelChoiceField(queryset=Subject.objects.all)
>>> timetable =
>>> forms.ModelChoiceField(queryset=Timtables.objects.all.ordered_by('-date')
>>> session_number = forms.ChoiceField(choice=SESSION_CHOICES)
>>>
>>>
>>> Is what I'm trying to do possible? I feel like I've seen someone do it
>>> before, but it was in an unrelated code snippet, and I've no idea
>>> where I found it...
>>>
>>> cheers
>>> L.
>>>
>>> --
>>> ...we look at the present day through a rear-view mirror. This is
>>> something Marshall McLuhan said back in the Sixties, when the world
>>> was in the grip of authentic-seeming future narratives. He said, “We
>>> look at the present through a rear-view mirror. We march backwards
>>> into the future.”
>>>
>>> http://www.warrenellis.com/?p=14314
>>>
>>> --
>>> 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.
>>>
>>
>
> --
> 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.



-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: Override save or other options?

2012-09-11 Thread Lachlan Musicman
On Wed, Sep 12, 2012 at 11:46 AM, Mario Gudelj  wrote:
> I had to do the same thing recently. I had to grab the frequency, interval
> etc. (used rrule for that) and then had to look at the first event instance
> and create multiple instances from that event inside the view. If you create
> a series model and use it as a foreign key in your event to keep on top of
> everything it should work.

You mean it should work with keeping per-date attendance records you mean?

cheers
L.

>
> -m
>
> On 12 September 2012 07:31, Lachlan Musicman  wrote:
>>
>> On Tue, Sep 11, 2012 at 5:15 PM, Jani Tiainen  wrote:
>> >
>> > Rather than creating individual series of events from recurring I would
>> > do a
>> > concept called "recurring event". So it would be just a single event
>> > that is
>> > projected to spesific days as necessary. It requires a slightly more
>> > work
>> > but it's easier to maintain - for example entry would just state:
>> >
>> > recurring = True
>> > frequence = WEEKLY
>> > start_date = 2012-09-11
>> > end_date = 2012-12-01
>> > start_time = 09:00
>> > end_time = 10:00
>> >
>> > Then I would roll out custom non-database concept of "calendar day" that
>> > would be projected from database using both individual entries and
>> > recurring
>> > entries.
>> >
>> > Later on it would be very easy to modify existing recurring events and
>> > for
>> > example add cancellation of single event by creating overriding events
>> > concept.
>> >
>> > This way amount of data will be kept relatively small, it's much easier
>> > to
>> > read and modify. Of course drawback is that you need top level
>> > mechanisms to
>> > work with single calendar entries that map to your database
>> > representation.
>>
>> Great, and obvious, idea - unfortunately a bad fit. Each event needs
>> to be an object as there are student attendance records and staff
>> attendance records linked to each individually.
>>
>> I was thinking about it last night and it occurred to me that instead
>> of using the admin interface I should just write my own form and then
>> do the multiple object creation in the view - it makes sense to me,
>> although I'm sure I've miffed something up.
>>
>> Other ideas still welcome.
>>
>> cheers
>> L.
>>
>>
>>
>> --
>> ...we look at the present day through a rear-view mirror. This is
>> something Marshall McLuhan said back in the Sixties, when the world
>> was in the grip of authentic-seeming future narratives. He said, “We
>> look at the present through a rear-view mirror. We march backwards
>> into the future.”
>>
>> http://www.warrenellis.com/?p=14314
>>
>> --
>> 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.
>>
>
> --
> 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.



-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: Django and LDAP

2012-09-11 Thread Mike Dewhirst

On 12/09/2012 8:05am, Mike Dewhirst wrote:

On 12/09/2012 7:49am, Ivan Pavlović wrote:

Thank you Mike for your answer. I started this topic, because i have an
assignment at my Faculty, which requires connection between Django and
an LDAP (assistant insisted on 389ds). I installed Django, enabled
admin, logged in through Firefox. I can't make up my mind, do i need to
connect Django and LDAP like so that all users from LDAP can login
through e.g. localhost:8000/admin, or do i need to make a register/login
page, where users from LDAP server can login and onlu admin can login
from admin page? The second is mpre logical to me, but i don't know,
because i am new to Django and Python.






There is no substitute for getting started.


https://github.com/mdewhirst/ldap-groups

I got a great start using Peter Herndon's django-ldap-groups which 
completely satisfied my client's specifications at the time. I ended up 
enhancing the Novell eDirectory backend somewhat for Django 1.3 and it 
probably needs more attention for Django 1.4 - check the Django release 
notes in the authentication backend area.


Anyway, I just uploaded it to github so you or anyone else can use it. 
You should check Peter's site for licensing and to compare the original 
with my adjustments.


http://pypi.python.org/pypi/django-ldap-groups/0.1.3

Also, google for "django ldap" to find a bunch of other ldap software.

hth

Mike




--
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: models for KML file

2012-09-11 Thread Melvyn Sopacua
Op 11 sep. 2012 11:07 schreef "Coulson Thabo Kgathi" 
het volgende:
>
> Somebody help with using kml files to plot points on maps using geodjango
>

Please read and understand the Geodjango tutorial and Gdal layermapping
API. If you need help understanding that, ask specific questions about
parts that are unclear.

-- 
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: Django Interview Questions

2012-09-11 Thread Stephen Anto
Hi Guys,

I really thanks to who are all gave comments on my previous post.

Now, Keep on watching on Django interview questions and 
answers. 
I am updating questions and answers.

let me know if any feedback.

On Thursday, September 6, 2012 4:45:53 PM UTC+5:30, Stephen Anto wrote:
>
> Hi Guys,
>
> The new modified questions and answers will be updated soon
>
> Thanks for posting your valuable feedback. 
>
> On Wednesday, September 5, 2012 11:23:48 PM UTC+5:30, Amyth wrote:
>>
>> after reading this guide it seems, the interviewer who asks such 
>> questions himself is new to django or more importantly to programming. When 
>> it comes to programming or codes , most of the interviewers would ask you 
>> logic based questions instead of framework based questions as technologies 
>> like django come and go on a daily basis. if your logic is clear, you can 
>> code in any language based on any CMS' or frameworks.
>>
>> On Wed, Sep 5, 2012 at 10:31 PM, Kurtis Mullins wrote:
>>
>>> Yeah, I think this guide is a little crazy. If I'm getting interviewed 
>>> based on questions I can't answer without looking up relevant documentation 
>>> then I'd probably look bad even though the interviewer is the one lacking 
>>> the required knowledge to get the job done. 
>>>
>>> Maybe that's why I don't interview too often :) Just my 2 cents.
>>>
>>>
>>> On Wed, Sep 5, 2012 at 12:57 PM, Aaron C. de Bruyn 
>>> wrote:
>>>
 I disagree with the "how to install" section.
 I use Nginx and uwsgi to host Django applications.
 There are other ways to deploy it too.

 The section makes it seem like the only 'real' way would be Apache.

 Lastly, it doesn't seem to touch on how a lot of people actually
 install and deploy django projects.  My workflow is pretty simple
 compared to what the install section says:

 apt-get install python-pip python-virtualenv virtualenvwrapper
 cd code
 mkvirtualenv some-django-project
 pip install django
 django-admin startproject somedjangoproject
 cd somedjangoproject
 python manage.py startapp app1

 Using virtualenv should also take care of the problem listed in
 "Remove any old versions of Django".

 I'd hate for someone to not get the job because they give a
 "non-textbook" answer. ;)

 -A


 On Tue, Sep 4, 2012 at 5:10 AM, Stephen Anto  
 wrote:
 > Hi Guys,
 >
 > I have updated Django latest interview questions and answers. It may 
 cover
 > all technical requirements of the interview.
 >
 > Vist http://www.f2finterview.com/web/Django/ for latest Django 
 interview
 > questions and answers
 >

 --
 You received this message because you are subscribed to the Google 
 Groups "Django users" group.
 To post to this group, send email to django...@googlegroups.com.
 To unsubscribe from this group, send email to 
 django-users...@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...@googlegroups.com.
>>> To unsubscribe from this group, send email to 
>>> django-users...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> -- 
>> Thanks & Regards
>> 
>>
>> Amyth [Admin - Techstricks]
>> Email - aroras@gmail.com, ad...@techstricks.com
>> Twitter - @a_myth_
>> http://techstricks.com/
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/8N9JtenXR88J.
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.



ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Lachlan Musicman
Hola

As per subject - I'm getting ViewDoesNotExist errors on a view that does exist.

I've checked the spelling, indenting and it all seems legit.

If I comment out the two lines that call the view in question from
urls.py, everything is back to normal.
---
tafe/urls.py

from django.conf.urls import patterns, url
from django.views.generic import DetailView, ListView
from tafe.models import Student, Subject, Enrolment, Course, Grade, Timetable

urlpatterns = patterns('tafe.views',
#url(r'^$', 'index'),
url(r'^$', ListView.as_view(queryset=Subject.objects.all()
...
   url(r'^session/create/$', 'session_create'),
)

tafe/views.py


from tafe.models import Session
from tafe.forms import SessionRecurringForm
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
import datetime

def session_create(request):

form = SessionRecurringForm()

return render_to_response('tafe/session_create.html',{'form':form,})



-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Lachlan Musicman
Grrr - sorry sent before I was finished.

tafe/views.py

# Create your views here.

from tafe.models import Session
from tafe.forms import SessionRecurringForm
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
import datetime

def session_create(request):

form = SessionRecurringForm()
return render_to_response('tafe/session_create.html',{'form':form,})


The note is "error during template rendering" base.html, at line 35:

{% url 'django-admindocs-docroot' as docsroot %}

Note that as soon as I exclude the url in question it all comes up roses.



L.


-- 
...we look at the present day through a rear-view mirror. This is
something Marshall McLuhan said back in the Sixties, when the world
was in the grip of authentic-seeming future narratives. He said, “We
look at the present through a rear-view mirror. We march backwards
into the future.”

http://www.warrenellis.com/?p=14314

-- 
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: Plot points from a kml file in django

2012-09-11 Thread Coulson Thabo Kgathi
i have made a geodjango project, and my intension is to make a map 
application that will will plot points on a map. the points are to be made 
by using gps coordinates that i that i have in a kml file. so what i did is 
convert the kml file into shapefile and auto generated the model by 
usingogrinspect. the pasted the models produced in the models.py file hoping 
that those points wil be show on the map when opening http://localhost:8000 
but it seems the ogrinspect does not even create a field for coordinates on 
the models. not sure thats because the kml file was not converted correctly 
or not cos i converted it using an online tool from hear 
http://www.zonums.com/online/kml2shp.php.

so my intentions is just to plot points on a map with geodjango to show 
area coverage of a particular location.

How that is clear now

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/6MdlwLfDOUEJ.
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: Plot points from a kml file in django

2012-09-11 Thread Coulson Thabo Kgathi
my interntion is to have somethin like this, but not exactly the same. have 
points plotted on a map like this.

[image: HoustonCrimeMaps]

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/FYIR9A6dFMQJ.
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: tree.io installation with django

2012-09-11 Thread Fabian Weiss
THX alot for your help Cal! Does that STATIC stuff has something to do with 
the fact that I am using an Apache virtual host?
But that link you gave me is very complicated! Sorry, but I dont understand 
:( 
This is my simple WSGI file: 
http://nopaste.immersight.de/?51d0bd825fc001a8#gATcImCw08jZTqXqiuA9Qbr0qvoCno+eISUhnZPIq6A=
What do I have to insert there?
I found that I have indeed a dircetory called "static"!! 
http://nopaste.immersight.de/?ae7fe7fa64cd2dbe#TPSfs+1BwLYpqWH0ih/ZBleZ/A8bre5Xwvwafys+gj4=
Shall I add now STATICFILES_DIRS = ( "../static") ?

Am Dienstag, 11. September 2012 12:41:16 UTC+2 schrieb Cal Leeming 
[Simplicity Media Ltd]:
>
> Looks like an incompatible version of Django perhaps (first glance).
>
> Alternatively, just patch it yourself based on the error given:
>
> @@@
> django.core.exceptions.ImproperlyConfigured: You're using the staticfiles 
> app without having set the STATIC_ROOT setting.
> @@@
>
> See https://docs.djangoproject.com/en/dev/howto/static-files/
>
> Cal
>
> On Tue, Sep 11, 2012 at 7:22 AM, Fabian Weiss 
> 
> > wrote:
>
>> I am using Debian and want to use treeio with my Apache. So I was working 
>> with this tutorial: 
>> http://fuckyeahcoding.wordpress.com/2011/12/20/install-tree-io-on-ubuntu-with-apache/
>> But the instructions "make" and "make install" didnt work.. Instead I 
>> used the 'python manage.py update_ve' and './bin/patch_' from the INSTALL 
>> Howto. So this is the result:
>>
>> http://nopaste.immersight.de/?3c0f99829f839ff8#EhsVGqDrxk6xDzDvYq6hiuxNpJw04XhXK36b6BMc3Dc=
>>
>> Next stept: root@iss1:/srv/http/de.immersight.project/treeio# ./bin/patch
>> patching file db/models/fields/related.py
>>
>> I created a MySQL database, user and password. But where to configure 
>> treeio for this? Where shall I enter this informations??
>>
>> So this is the result of the next step:
>>
>> http://nopaste.immersight.de/?f36e7753a9fcca9b#7ICkjsTcxh/Ck4JZ6d9jhfPStsY8eYWJ3N5Ko4YrY7M=
>>
>> I am not sure and dont understand much of it, but for me it seems there 
>> already went something wrong..
>> The tree.io community is not so active, but maybe somebody here can give 
>> me a hint!
>>
>> Thx alot!!
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msg/django-users/-/wm6J2Ces9BUJ.
>> To post to this group, send email to django...@googlegroups.com
>> .
>> To unsubscribe from this group, send email to 
>> django-users...@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 view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/jS4L0ShvuYYJ.
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: ViewDoesNotExist !?!?! It certainly does....

2012-09-11 Thread Sergiy Khohlov
 add to urls
 from tafe.views import session_create

2012/9/12 Lachlan Musicman :
> session_create

-- 
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: Plot points from a kml file in django

2012-09-11 Thread Coulson Thabo Kgathi
eish i am a dead man if i dnt do ths by end of today

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/PpALNxvsnboJ.
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: Converting kml file to shapefile Error

2012-09-11 Thread Coulson Thabo Kgathi
the shape file i wnt 2 use it on geodjango, tht wht it has 2 do wit django 
wel jst thought some1 have seen the same error b4 n might help, not tht its 
a django or python issue

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/4BY15h750W0J.
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.