Re: custom django-admin commands naming convention

2011-03-08 Thread Marwan Al-Sabbagh
cool thanks, Marwan On Wed, Mar 9, 2011 at 12:14 AM, creecode wrote: > Hello Marwan, > > I don't know if it's common but for my needs it's a must! :-) I have > several apps with custom management commands and I've taken to naming > the commands like... > >

Re: Django and an indirect access to the database tables (over stored procedures calls for data retrieval and modification)

2011-03-08 Thread Vazir
Thanks Michael! Probably I must be more specific. I mean, can I use all the Django modeling stuff (since it's cool in forms and etc), but rewrite the way, models interacts with DB - how they retrieve and update data from/ to DB? There is some examples via raw() for data selects, but nothing about

Re: Payment Gateways

2011-03-08 Thread David Zhou
I use Braintree, and it's been great. -- dz On Tue, Mar 8, 2011 at 4:40 PM, CLIFFORD ILKAY wrote: > On 03/08/2011 09:59 AM, Bill Freeman wrote: >> >> And I can't resist recommending solutions that don't require your to touch >> the credit card number.  If you never

Re: Payment Gateways

2011-03-08 Thread CLIFFORD ILKAY
On 03/08/2011 09:59 AM, Bill Freeman wrote: And I can't resist recommending solutions that don't require your to touch the credit card number. If you never had it, you can't be responsible for compromising it. That is true. Most of the payment processors have some sort of hosted form

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread ronny
Ignore the rest of these guys, and go here: http://south.aeracode.org/docs/tutorial/part1.html#tutorial-part-1 It's called django-south, all the cool kids are using it. Enjoy. :D -ron On Mar 8, 7:34 am, pankaj sharma wrote: > same as categories i have to add

[OFFTOPIC] TUNO: small django app for programmed dents/tweets

2011-03-08 Thread Efrain Juvenal Valles Pulgar
Regards, I write because I posted an app in django which we used in the office to play with the twitter api's, we added identi.ca publications and now we bring it to a web app using the power of django. This app is not ready for production but can put it to work in 10 steps. This web

Customizing how the elements are listed in admin change_list.html

2011-03-08 Thread Thomas Weholt
My app handles photos and the admin shows these photos in a table-like manner as shown in attachment. but I want to show it as google does when you search for images; a bunch of photos spread across the page, like here: http://www.google.no/images?q=django+pony but still inside the admin and

Re: Making a dashboard for the admin

2011-03-08 Thread olarcheveque
You should have a look at django-admin-tools (http://pypi.python.org/ pypi/django-admin-tools). It provides dashboard + toolbar features. On 8 mar, 16:00, Thomas Weholt wrote: > I thinking about making a dashboard for the admin, replace the page > you get to by default

Re: Satchmo Error - Invalid block tag: 'thumbnail', expected 'else' or 'endif'

2011-03-08 Thread anvydigital
I ran into this issue also with the latest version of satchmo and sorl- thumbnail. According to the sorl-thumbnail documentation, the tag needs to be closed like so: {% thumbnail item.image "100x100" crop="center" as im %} {% endthumbnail %} It is quite likely you are (as am I) using code

Re: current recommendations for using email as username

2011-03-08 Thread william ratcliff
It is in the forms. On Tue, Mar 8, 2011 at 4:26 PM, Brian Craft wrote: > On Tue, Mar 8, 2011 at 12:53 PM, william ratcliff > wrote: > > If you look through the code in the django admin, then the limit is set > in > > the database schema. > >

Re: current recommendations for using email as username

2011-03-08 Thread Brian Craft
On Tue, Mar 8, 2011 at 12:53 PM, william ratcliff wrote: > If you look through the code in the django admin, then the limit is set in > the database schema. I've read elsewhere that it's also in all the auth form validations, so you have to subclass all of them. I

Re: custom django-admin commands naming convention

2011-03-08 Thread creecode
Hello Marwan, I don't know if it's common but for my needs it's a must! :-) I have several apps with custom management commands and I've taken to naming the commands like... my_app_name_my_custom_management_command_name.py If find it easier to read the command name if I separate each word

Making a dashboard for the admin

2011-03-08 Thread Thomas Weholt
I thinking about making a dashboard for the admin, replace the page you get to by default with something more relevant for my project, but I don`t want to overwrite the index.html in the django-code, but the django docs says the index.html file cannot be overriden in project template dirs. How do

Re: current recommendations for using email as username

2011-03-08 Thread william ratcliff
If you look through the code in the django admin, then the limit is set in the database schema. On Tue, Mar 8, 2011 at 3:05 PM, Andy wrote: > Is the 30 characters limit enforced by the database or by Django? > > If the limit is set by the database, would altering the DB

Re: current recommendations for using email as username

2011-03-08 Thread Andy
Is the 30 characters limit enforced by the database or by Django? If the limit is set by the database, would altering the DB schema work? On Mar 4, 10:51 pm, Shawn Milochik wrote: > > Email addresses have been allowed since version 1.2 < >

Re: Django and an indirect access to the database tables (over stored procedures calls for data retrieval and modification)

2011-03-08 Thread Michael Radziej
On Tue, 8 Mar 2011 10:11:57 -0800 (PST), Vazir wrote: > there is no way (and no need) of giving a Django models with direct > access to a DB structure (all business logic is already bult in to the > DB), all DB interaction must be done via the stored procedures calls.

Django and an indirect access to the database tables (over stored procedures calls for data retrieval and modification)

2011-03-08 Thread Vazir
Hello! I'm looking for a way to be using Django as an MVC framework, for a very complex database, so there is no way (and no need) of giving a Django models with direct access to a DB structure (all business logic is already bult in to the DB), all DB interaction must be done via the stored

Django inlines with custom form ignores excluded fields?

2011-03-08 Thread Marc Aymerich
HI, I want to use a custom form for one of my admin inlines, but unfortunatly I'm not able to exclude some fields. Seems that GenericStackedInline ignores whatever I put on ModelForm.Meta.exclude. Is this a normal behaviour? or it's a bug? My test classes: class Mon(ModelForm): class Meta:

Re: Why does Django Fail on Date Field?

2011-03-08 Thread octopusgrabbus
Sorry. The error is Exception Type: ValidationError Exception Value: [u'Enter a valid date in -MM-DD format.'] I have printed out for myself to prove that my date is in this format. On Mar 8, 8:24 am, Jirka Vejrazka wrote: > Well, we're missing the bit where you

Re: Treebeard Question

2011-03-08 Thread Tyler Brock
Answer: I was depending on Django's auto_now feature to give me appropriate datetime which apparently isn't available until save. Changed root addition to this and it works like a charm: now = created=datetime.datetime.now() Interaction.add_root(page=page, content=content, user=user,

Re: How to get next and previous element in a forloop in the template

2011-03-08 Thread Bill Freeman
Apart from writing your own for tag, you could, for instance, supply a generator (or equivalent) on your model, or passed in by your view, that returns 3 tuples of (this, prev, next), or perhaps easier to read in the template, toy objects having this, prev, and next attributes (or properties). On

Re: which statements are right?

2011-03-08 Thread Bill Freeman
I'll take a shot. On Mon, Mar 7, 2011 at 11:43 AM, yongzhen zhang <4...@live.cn> wrote: > Hi, > When i am doing some exercises, i found some questions are very to > understand, Could you tell me which sentiences are correct? > 1. Models convert data from relational database form to objects and >

Re: celery tasks and circular imports

2011-03-08 Thread Bill Freeman
The (major part of the work of) import is NOT done every time through. On subsequent passes, the import statement merely looks up the module in sys.modules. This is only slightly more of a performance hit than a direct dictionary look up (depending on how much the compiler inlines when it sees

Re: Payment Gateways

2011-03-08 Thread Bill Freeman
On Mon, Mar 7, 2011 at 6:03 AM, CLIFFORD ILKAY wrote: > You can use whatever you like as long as it has an API and documentation. > We've used SecurePay (an Australian one), InternetSecure, BeanStream, > Authorize.net, and others that I can't remember right now. They

Re: weird ifnotequal issue

2011-03-08 Thread Bill Freeman
That's a weird field name. I could see there being a corner case. If it were me, I'd stick a breakpoint in the ifequal implementation, possibly, if you have a lot of other ifequal tags to get past conditioned (normal python if statement) on having gotten "." in the arguments. Then you can see

Re: current recommendations for using email as username

2011-03-08 Thread Bill Freeman
We've even had problems (converting people's old site accounts) with non-email usernames exceeding 30 characters. On Sat, Mar 5, 2011 at 12:49 AM, creecode wrote: > It would be grand if the max_length was upped. > > On Mar 4, 7:51 pm, Shawn Milochik

Re: Multiple database queries

2011-03-08 Thread VidJa Hunter
I totally agree with the one database solution, which would be my choice, if there were no legal issues attached to the different datasets. On Mon, Mar 7, 2011 at 10:49 PM, Cal Leeming [Simplicity Media Ltd] < cal.leem...@simplicitymedialtd.co.uk> wrote: > Hey Vidja, > > May I ask why so many

Django Dynamic Fixture

2011-03-08 Thread Paulo Cheque
To whom make automated tests in Django must have realized that using fixtures (static data) is a terrible idea. There are a list of lots of tools that help working with fixtures (djangopackages.com/grids/g/ fixtures), but I am just showing a new one, Django Dynamic Fixture

Re: dependend fields

2011-03-08 Thread urukay
one way is to use Ajax call to get choices for dropdown menu. R. On 8. Mar., 09:42 h., "Szabo, Patrick \(LNG-VIE\)" wrote: > Hi, > > I want to make the choices of a dropdown menu dependend on what is > chosen from another field. > > One field is a normal Textfield

Re: Cycle & Include tags

2011-03-08 Thread Russell Keith-Magee
On Tue, Mar 8, 2011 at 9:29 PM, Russell Keith-Magee wrote: > On Tue, Mar 8, 2011 at 11:29 AM, Brian Neal wrote: >> I'm using a recent checkout of Django trunk. >> >> If I have a template "test.html" which is this: >> >> {{ rowcolors }} >> >> the only

Re: csrf_exempt decorator and class based views

2011-03-08 Thread Casey S. Greene
Have you seen this yet: http://docs.djangoproject.com/en/dev/topics/class-based-views/#decorating-class-based-views I think it answers your question. Hope this helps, Casey On 03/08/2011 08:19 AM, Christo Buschek wrote: Hello. I came across a problem that I don't fully understand. I try to

Re: Cycle & Include tags

2011-03-08 Thread Russell Keith-Magee
On Tue, Mar 8, 2011 at 11:29 AM, Brian Neal wrote: > I'm using a recent checkout of Django trunk. > > If I have a template "test.html" which is this: > > {{ rowcolors }} > > the only way I could make cycle and include behave together is to do > this: > > {% for obj in

csrf_exempt decorator and class based views

2011-03-08 Thread Christo Buschek
Hello. I came across a problem that I don't fully understand. I try to implement a view where I want to turn csrf protection off. My view is implemented as a class based view, eg: class BaseHandler(object): """Base class to provide method lookup per HTTP method.""" def __call__(self,

Re: Why does Django Fail on Date Field?

2011-03-08 Thread Jirka Vejrazka
Well, we're missing the bit where you tell us what error are you getting. I don't know about others, but my crystal ball is a bit dusty these days. The models.py snippet you posted is obvious result of inspectdb output, which *may* need some manual tweaking. But it's difficult for us to guess as

Why does Django Fail on Date Field?

2011-03-08 Thread octopusgrabbus
Here is the table: class CsRemove(models.Model): action = models.CharField(max_length=3, db_column='Action') # Field name made lowercase. endpointid = models.IntegerField(primary_key=True, db_column='EndpointId') # Field name made lowercase. devicetype =

Re: date_heiarchy not working

2011-03-08 Thread Karen Tracey
On Mon, Mar 7, 2011 at 4:52 PM, Bobby Roberts wrote: > i've got this in my admin model: > date_heiarchy='ShipDate' > > Shipdate is a DateField. The Date Heiarchy plugin is not showing on > my admin list view... has that been depricated in django 1.2+? > No, it's not be

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread Anoop Thomas Mathew
Pankaj, If there is no relevant data in the db, remove it, create a new db and try syncdb. That'll work. regards, atm ___ Life is short, Live it hard. On 8 March 2011 18:00, Kenneth Gonsalves wrote: > On Mon, 2011-03-07 at 21:34 -0800, pankaj sharma wrote: > > and

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread Kenneth Gonsalves
On Mon, 2011-03-07 at 21:34 -0800, pankaj sharma wrote: > and when i click on college in admin site then it show me error like > this when changing fields within a model, you have to manually change the database table. Syncdb will not do it. -- regards KG http://lawgon.livejournal.com

Re: PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread Brian Bouterse
please don't shout On Tue, Mar 8, 2011 at 12:34 AM, pankaj sharma wrote: > same as categories i have to add affiliation to every college. > so i added > > class Affiliation(models.Model): >title = models.CharField(max_length=100) > >def __unicode__(self): >

PLEASE HELP ME IN ADDING A CATEGORY IN THE ADMIN SITE

2011-03-08 Thread pankaj sharma
same as categories i have to add affiliation to every college. so i added class Affiliation(models.Model): title = models.CharField(max_length=100) def __unicode__(self): return self.title to models.py and added one more field to class of colleges class

Re: Admin list delete and model delete() method

2011-03-08 Thread galago
So if I'll define delete_model in admin - it will work? -- 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

Re: Admin list delete and model delete() method

2011-03-08 Thread Michal Petrucha
> Hi, I have defined delete() method in my model. I use it to clear cache and > delete thumbs. When I delete an element in admin, in it's details (edit > mode) cache is cleared and all thumbs are deleted. > But, when i want to delete several elements at once - checking checkboxes on > the

Re: Bug in Django admin?

2011-03-08 Thread Michael Radziej
Hi Martin! > > It's the wrong URL, you should use > > > > .../admin/appname/booltest/?completed__exact=False > > > > It is the same link, I don't see a difference :) Args--you're right. Stupid fingers :-) I meant .../admin/appname/booltest/?completed__exact=0 Does it work that way for you

Re: How to aggreate in html django

2011-03-08 Thread Tom Evans
On Tue, Mar 8, 2011 at 1:23 AM, sushanth Reddy wrote: > Hi Tom, > > Can you please  add few lines of code example, > to make code more efficient?sorry for troubling. > Currently you query the DB to generate a list of users, and then for each user you query the DB once for

Re: SQL generated for ManyToManyField is incorrect with Django 1.2.1

2011-03-08 Thread Gergely
Ok, it is clear now. SQLite unfortunatelly does not support "ALTER TABLE ADD CONSTRAINT" command. So the "REFERENCES" clause is not possible if the referenced table is missing, there is no alter, and of course django will not re-arrange my definition order. The same applies to many-to-many

Re: When do we stop using Django admin?

2011-03-08 Thread Michael Radziej
On Mon, 7 Mar 2011 21:49:45 -0800 (PST), ajaishankar wrote: > I do know we can tweak the admin to restrict querysets etc. and also > override admin templates - but is admin preferable in this situation? > > Or is it better to treat all this as a front end web app, and

Admin list delete and model delete() method

2011-03-08 Thread galago
Hi, I have defined delete() method in my model. I use it to clear cache and delete thumbs. When I delete an element in admin, in it's details (edit mode) cache is cleared and all thumbs are deleted. But, when i want to delete several elements at once - checking checkboxes on the elements list -

Re: Bug in Django admin?

2011-03-08 Thread Martin Tiršel
Hello, On Mon, 07 Mar 2011 22:12:14 +0100, Michael Radziej wrote: Ahoj Martin, On Mon, 07 Mar 2011 12:49:32 +0100, Martin Tiršel wrote: When I use filter in Django admin (that produces URL .../admin/appname/booltest/?completed__exact=False), I

dependend fields

2011-03-08 Thread Szabo, Patrick (LNG-VIE)
Hi, I want to make the choices of a dropdown menu dependend on what is chosen from another field. One field is a normal Textfield and the other one is created by the model. What is the best and easiest way of doing that ?! Kind regards . . . . . . . . . . . . . . . . . . . . .

custom django-admin commands naming convention

2011-03-08 Thread Marwan Al-Sabbagh
Hi, I need to cron a few jobs for my django app to run daily. I went through the docs on "Writing custom django-admin commands" and thats the direction I'm planning to go to run these jobs. Our company has a number of teams developing different apps and I didn't want the naming of the commands