Re: Editable datagrid

2011-11-22 Thread Mike Seidle

On Monday, November 21, 2011 03:46:49 AM Vikas Rawal wrote this and sent it to 
To: Django users ::

> I am new to django and to web programming. I am trying to build a
> database application for entering/querying/viewing data from a mysql
> database. The data entry module needs to have datagrids where users
> can enter multiple rows of data belonging to a particular set.

This is easy if you want rows of forms, and difficut if you want a full on 
spreadsheet like editorthat interactively updates as the user changes pages, 
sorts and searches.

> Would be grateful for pointers to resources on the best way to
> implement datagrids in django.

Take a look at formsets for implementing row by row forms. The first line of 
the documentation says that formsets "...can be best compared to a data grid."

https://docs.djangoproject.com/en/dev/topics/forms/formsets/

Once you've got a handle on that, take a look at a javascript tool like 
Datatables which you can start and get a lot of value (sorting, import, 
export, etc) by just adding to the table you build with the formset.

After that you can implement serialization and paging using datatable to make 
your datagrid more flexible and improve the UI further.  
 
One of the good/bad things about django is that there seems to be an allergy 
to coupling tightly to a UI framework. When you are starting out, it's 
frusterating because doing ajax is time consuming and requires you learn a lot 
more than you expect.  After you get to know django better you start to 
realize that right now there are soo many choices on the UI end are 
between the JavaScript library of the month, HTML5 and client side templating 
engines, things are changing so fast that it's pointless to commit to anything 
right now.  Better to stay loosley coupled and flexible than obsolete in six 
months

-- Mike 

signature.asc
Description: This is a digitally signed message part.


Re: Integrating facebook canvas with django

2011-10-21 Thread Mike Seidle
On Friday, October 21, 2011 12:10:12 PM Amit Sethi wrote this and sent it to 
To: django-users ::

> One of the things that I need is to do is to replace django's user
> backend such that it uses the facebook authentication mechanism .But
> at same time be able to use other third party django plugins . What
> would be an effective way to do that such that third party django apps
> can be integrated without changing any code.

Try django-social-auth. I'm using it on a project right now. It seems to play 
nice... but you may run into some limitations when users register - you get 
very limited profile data from most Oauth and OpenID providers.

Hope that helps.

-- 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: Django admin multiple company accounts

2011-10-19 Thread Mike Seidle

On Wednesday, October 19, 2011 02:10:49 PM Andre Terra wrote this and sent it 
to To: django-users@googlegroups.com::

> > To be honest, you're probably (not 100% sure) creating *more* work for
> > yourself trying to make something like this work in django admin, than
> > just designing something for yourself (YMMV).
> 
> I couldn't agree more. Too often I see newcomers learning how to extend the
> admin, when it would actually be easier to roll out their own views, not to
> mention how they would be learning how to use the framework rather than a
> built-in app.

It's so easy to think Django-Admin is the answer.  Django's admin is a few 
steps up from PHPMyAdmin or some other SQL GUI tool. Uless your use case for 
your user is precicely a create, read, update and delete interface to your 
data as represented by your model definitions, you probably will not have the 
moving parts you need to implement what you want... The minute you want 
more/different, is (most of the time) literally less work to just roll your own 
view and template which will give you much more control of the user experience 
and avoid the inevitable complaints about "why aren't totals at the bottom of 
tables? How come we have to used this wonky Year/Month/Date drill down?

--- 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: Django Development environment

2011-08-23 Thread Mike Seidle
On Monday, August 22, 2011 06:07:24 PM Stephen Jackson wrote:
> I am new to the world of Django. I would like to hear from other django
> developers describe their dev environment (tools, os, editors, etc.).

Dev: Kubuntu (Natty), Emacs (sometimes Aptana), git, Cherokee (web server), 
MySQL

Production: Debian Lenny, Cherokee or Apache, MySQL

Couldn't survive without South :)

-- 
Mike Seidle

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



Re: How to change the schma of database using python manage.py syncdb?

2011-08-18 Thread Mike Seidle
On Thursday, August 18, 2011 12:03:00 pm smith jack wrote:
> at last, i use command  python manage.py syncdb
> 
> but was suprised to find that the schema of url table in the database
> is not changed
> 
> so is there any method to change the shcema of table using django command?

When I started with Django, I ran into the same issue... seemed kind of silly 
that we had this amazing framework that did so much but it had no way to 
really alter tables...   Enter South. South works pretty well, but if you roll 
your own ModelFields it can be tricky as you have to write your own 
migrations.  

-- 
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: Displaying results in Template in a Table ? What is the proper way ?Any app?

2011-08-16 Thread Mike Seidle
On Wednesday, August 10, 2011 07:03:51 pm Brian Bouterse wrote:
> I know it's not Django specific, but when I need a table for my Django
> projects, I use jQuery Datatable .  It rocks!


I highly recommend Datatable... It's not to hard to do either.

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



Re: How to choose a license for an app or a project?

2011-05-13 Thread Mike Seidle
On Friday, May 13, 2011 07:34:35 am Thomas Weholt wrote:
> I've released three django-related packages the last few months, all
> under the GPL license. Recently somebody asked me about my license
> choice; "Why not BSD, the same as django?". My reason for choosing GPL
> is based on the fact that I'm a strong supporter of free software as
> defined by FSF and GPL is the de facto standard license for that. But
> the question got me thinking and I wonder what kind of problems I
> might run into using the GPL, and not the BSD license.

The big problem with the GPL is that it requires source code disclosure, so 
people who want to include your code in a commercial product feel like they 
are giving away the farm instead of selling some eggs.  

Look at it this way: 

If you want to force contribution back to your project, then AGPL or GPL3. 
This limits participation of people who want to use your code in their 
products or SAAS services because it forces them to release their 
customizations for free.

If you want to allow SAAS, but ensure that people can get access to code, use 
GPL2 or if appropriate LGPL.

If you don't care and just want to share and share alike, look at BSD or many 
other more permissive open source licenses.

If you want businesses to pay you, but individuals to be able to use your 
software, Creative Commons has a few good, tested licenses.

If you want to get paid every time someone installs your software, use a 
commercial license.


> 
> Do people really care? Should I care? I think so. What do you people
> think; How to choose a license and why?

-- 
Mike Seidle

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



Login, Password Recovery, etc

2011-02-11 Thread Mike Seidle
Quick question - is there an application or examples of completely implemented 
user authentication templates?  It's getting old trying to devine how to set 
up templates for password recovery and registration. Seems to me that this 
should (and probably is) included with the rest of the batteries.

-- 
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: Best forum/group for Django Help

2011-02-11 Thread Mike Seidle
On Thursday, February 10, 2011 03:40:24 am SimpleDimple wrote:
> Not a prank, it was just what I thought..., it is always better to ask
> than assume...thanks for confirmation that this is the best one
> around.

You might want to check your settings for the group - there are literally 
hundreds of posts every day here.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-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: Amazing work

2011-02-06 Thread Mike Seidle
On Sunday, February 06, 2011 02:54:23 pm Cal Leeming [Simplicity Media Ltd] 
wrote:
> Interesting. See, when I compared Zope to Django, I found Django's
> extensive documentation and feature set to be perfect for prototyping, and
> then optimizing bottlenecks at a later date, either via C extensions, raw
> SQL replacement etc. However, as 'cliché' as this may sound, most large
> enterprises tend to steer towards the most complicated, most bloated, most
> difficult to use "technologies" there are around. Take Microsoft CRM, Java
> and *anything* RHEL based as a clear example (others may disagree, this is
> just my opinion as I'm a hard headed debian/python guy ;p)


Large organizations can screw anything up. With Django, they can screw it up 
while hitting all the deadlines.

-- 
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: Amazing work

2011-02-06 Thread Mike Seidle
On Thursday, February 03, 2011 08:02:43 pm Cal Leeming [Simplicity Media Ltd] 
wrote:
> May I ask, how well did you get along with Zope? From what I can tell,
> Django is suited for SME, where as Zope is the kinda thing that banks would
> be using etc.

Cal - 

I just used Django to write a credit card processing application (as in 
internet gateway w/API for third party sites).  Zope would have simply been 
way to heavy to handle the transaction load, and frankly, most financial 
applications fit the RDBMS model much better than the object database model.  

On the SME/Enterprise statement: Just because a software package is not 
complicated does not mean that it does not fit in the enterprise space.  I've 
found that often the more simple a tool is the *better it fits* in large 
organizations.

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: How do I Bind a Form choice Field?

2011-01-07 Thread Mike Seidle
Hank -

Here's the answer you are looking for:

http://docs.djangoproject.com/en/dev/ref/forms/fields/#modelchoicefield

Here's an example:

stuff = forms.ModelChoiceField(queryset=Series.objects.values('whatever'),  
empty_label=" ")

Spend some serious time learning modelforms. Most of the time, they are the 
right answer.  Modelforms are different than regular forms... so you do have to 
populate the choices differently.  The key with Django is to understand when 
you need a modelform, and when you need a regular form.

modelform - Django builds forms from models.
form - You design what you want, but have to do a lot more work to populate 
the form with data.



There you go.

On Friday, January 07, 2011 02:03:39 pm hank23 wrote:
> So I can create a queryset and pass its variable in the choices
> parameter to bind a modelchoicefield from a modelform to a particular
> iterable object? So then does this work only with modelforms or with
> any kind of form (one coded manually as well)? If I can do this with
> any form then where do I code the choices parameter? The only examples
> I've seen show it being coded using dictionaries containing hard-coded
> values and being coded as part of the form in question.  Let me know
> as soon as you can. Thanks for the help.

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



Re: DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle

Thank you. Problem solved.

On Wednesday, January 05, 2011 03:58:59 pm Shawn Milochik wrote:

> http://docs.djangoproject.com/en/dev/ref/forms/widgets/
> 
> Search for "year" on this page and it has what you need.
> 
> Shawn

-- 
Mike Seidle

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



DateField and SelectDateWidget - How do you set the range for the widget?

2011-01-05 Thread Mike Seidle
Well, 2011 brought a bug I'm not sure what to do with.  I have a view 
that contains a form that lets a user select a date range.  
The field is defined as

start_date = 
forms.DateField(initial=date(d.year,d.month,1),widget=SelectDateWidget())

My problem is that as of the 1st of January 2011, the minimum date shown 
is 01/01/2011, which means people can't select data from last year. I can't find
anything in the documentation that would let me change the range of dates shown 
in
the SelectDateWidget. Any suggestions?


-- 
Mike Seidle

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



Re: SSL through WSGI

2010-12-23 Thread Mike Seidle
On Wednesday, December 22, 2010 05:08:05 pm Jakob H wrote:
> Hi, I have a related SSL question using WSGI and Apache.
> 
> In my .htaccess file I have something like this:

If you are using WSGI, then you'll probably have to look at Apache's config 
files (usually in /etc/apache2 or /etc/httpd for the problem and not .htaccess. 
 
More than likely it's as simple as not automatically redirecting http requests 
to https for your domain (or vhost) as appropriate.

Also, most of the directives in your .htaccess appear to be fast-cgi and not 
wsgi settings, so I'd probably first check to see you really are using 
mod_wsgi. You may be able to simplify that .htaccess file a bunch.

-- 
Mike Seidle

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



Re: I don't get the big picture (admin, etc.)

2010-12-14 Thread Mike Seidle

Cocolombo -

Actually, you are asking some pretty good questions because all of them are 
fundamental, and everyone starting with Django has to answer them. 

On Monday, December 13, 2010 10:25:45 pm cocolombo wrote:
> I read a lot of documentation and books but there are still some very
> basic things that I just don't catch about Django.
> 
> Let's say I want to crate a very basic site for a simple game with no
> graphics, just text.
> 
> 1) Should the players use the admin to loggin ?

Probably not. Most of the time I use Django-admin to administer an 
application, and that freesme from having to spend lots of time building out 
the back end of my app that will be used by a tiny number of people. This in 
turn frees me to develope the front end of my app that will be used by 
thousands.

> 2) Do I use the user objects, to keep information about each players ?
> Or a different class called player ?

It depends on what you want to do. Django's user model lets you specifiy one 
model as a user profile, and so in your case it may make sense for the profile 
model to be called player. 

> 3) Should I create a separate application for the login section of the
> site ?

You may or may not have to create a seperate application. 
> 
> 4) Is registering a new user (confirmation by email, etc) a different
> module or is it part in the admin.

You'll have to do a little assembly. See "Other Built in Views" here:
 http://docs.djangoproject.com/en/dev/topics/auth
 
> 5) I understand the importance of admin to manage my  database, but of
> course, I don't want the players to access directly the database. Do
> the players access the admin with limited privileges, or do they not
> touch the admin whatsoever ?

I don't think in your case you want users using the admin.

> As I said I read a lot, but I am stucked and don't understand the "big
> picture" of an application (or is it a project) ans it's relation with
> the admin.

Look at the admin as the control panel for your game's administrators.  It can 
be used to access and modify pretty much everthing.

> Thanks for taking the time to answer such questions that must be so
> trivial to many of you.

Two immutable truths: a broken clock is accurate two times per day, and 
everyone was new once.


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



Re: Newbie question: How should I structure my very simple project / app?

2010-10-19 Thread Mike Seidle
Waza -


Django should be ideal for your project.  It should be a snap once you figure 
out how Django's put together.

*Skip Do as others have suggested and do the tutorial. It will help you better 
understand MVC.

* Skip the AJAX stuff unitl you have the above figured out. The magic ponies 
sometimes get in the way of more important details while you are learning.



On Tuesday, October 19, 2010 07:52:34 am wawa wawawa wrote:
> Hi All,
> 
> I'm new to Django (and to be honest, a little bit hazy on the subtleties of
> MVC, but if you don't try, you don't learn).
> 
> I want to create a simple web frontend for a Python program I have already
> (mostly) written and I'd like to use Django (which may be overkill... not
> sure).
> 
> - Users have a bunch of externally generated XML files. (Could be one,
> could be many (max of 20?). Possibly in an zip or tar.gz archive).
> - Users access the Django app and can upload via a simple form (with funky
> Ajax uploadiness - including as many ponies and rainbows as might be
> necessary)
> - A backend script will process this XML, performing all manner of
> fantastical space/time-bending magic (which will not take longer than 5 to
> 10 secs... Max tested with many, many input files is about 40seconds).
> - The output will be produced and the user will have the option to download
> as CSV or possibly PDF. Possibly with functionality to allow the report to
> be mailed to them when complete (so user identity needs to be built in).
> 
> Very vague I know. But a very simple web app I think. Essentially, the
> backend script summarizes the input files into a summary per file and a
> total summary of the presence and count of certain keys / values or
> combinations of data. There's a set of logical rules that I have yet to
> invent which will be used when parsing the input XML (for example: if value
> "B" exists in "A" with attribute "Z" but not attribute "X" then count,
> otherwise do not).
> 
> The reason I want to use Django is:
> - I know I will be asked to add all sorts of functionality to this. Django
> is extensible, powerful.
> - I don't want to be responsible for maintaing the "rules" and would love
> to be able to expose this via an admin interface so anyone (with
> authorization) can add or edit rules logic.
> - I've already got the bulk of the parsing script written in Python.
> 
> I guess I need:
> - a handler for the input files.
> - a way to pass these file serially to my backend script (I presume I would
> use the filesystem for this? The input files can be anywhere from 2K to 1MB
> in very extreme cases.)
> - a mechanism to separate different user sessions.
> - a way to accumulate the results of each file parse and then report on the
> total (store the results in the DB?)
> - a mechanism to present and archive the reports (and then this leads to a
> way to look up old reports).
> 
> So, given this paucity of requirements and the horrendously unclear
> explanation above, what suggestions might you lot have? (Apart from "RTFM",
> of course!)
> 
> - Do / Don't use Django?
> - Structure of projects / Apps?
> - Any key external apps / modules that might be useful (e.g. for handling
> for uploads)
> - Any gotchas when invoking backend scripts?
> ...
> 
> I'm really just looking for a nudge in the right direction.
> 
> Thanks in advance for any tips, pointers or help you can give.
> 
> Thanks
> 
> Waza

-- 

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