Re: Better feedback for admin users

2012-10-17 Thread Marc Aymerich
On Wed, Oct 17, 2012 at 12:21 AM, Daniele Procida wrote: > I am starting to customise the admin classes for my models so that I can > provide extra feedback to the user. > > For example I want to report - in the admin page - useful information about > how the system will interpret the current st

Re: Django Development environment

2011-08-27 Thread Marc Aymerich
On Tue, Aug 23, 2011 at 12:07 AM, 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.). Ubuntu + chroot with debian squeeze installed via debootstrap gedit svn ddt -- Marc -- You

Re: Using gedit for django development

2011-09-13 Thread Marc Aymerich
2 On Tue, Sep 13, 2011 at 2:12 AM, Micah Carrick wrote: > I've written a blog post on using gedit, the default text editor in GNOME, > as a Django IDE. If you're a Linux user and you've never considered using > gedit for development then this may be an interesting read for you. > > http://www.mi

DjangoCon US 2011 Videos

2011-09-20 Thread Marc Aymerich
Hi, Anyone know if the talks from past djangocon US will be availabe for online watching? any posible date? Thanks -- Marc -- 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 u

Re: DjangoCon US 2011 Videos

2011-09-21 Thread Marc Aymerich
On Wed, Sep 21, 2011 at 11:46 PM, David Watson wrote: > Looks like they are online now http://blip.tv/djangocon > regards, > David > Wow, great news!! I'm going to check it out right now :) > On Wed, Sep 21, 2011 at 2:21 PM, Jason Keene wrote: >> >> I agree, was hoping these would already be up

Re: Module or plugin architecture

2011-10-01 Thread Marc Aymerich
On Sat, Oct 1, 2011 at 8:56 AM, Tony wrote: > Hello, > > I am new to Django and I have a question about module or plugin > architecture. > Is it possible to write a module with Django and add it to a current > Django application. > It depends basically on each concrete project, if there is implem

Re: Second coming of Java?

2011-10-13 Thread Marc Aymerich
On Wed, Oct 12, 2011 at 10:52 PM, ydjango wrote: > What do you think? > > http://www.cringely.com/2011/10/the-second-coming-of-java/ > > "When SSDs gain enough capacity there will be a shift from the Ruby > world back to the Java world. Not for prototyping, because, well, it’ > I'm not sure if S

Re: best practice

2011-11-09 Thread Marc Aymerich
On Wed, Nov 9, 2011 at 10:18 PM, mirco fini wrote: > hello, > > I would like to ask you if anyone knows some best practice developing > webapp with django (e.g. use a lot of simple function (or html pages) > instead of just a few but full of cases > I can recomend 'Clean code', it is a great book

Re: best practice

2011-11-09 Thread Marc Aymerich
On Wed, Nov 9, 2011 at 10:32 PM, Marc Aymerich wrote: > On Wed, Nov 9, 2011 at 10:18 PM, mirco fini wrote: >> hello, >> >> I would like to ask you if anyone knows some best practice developing >> webapp with django (e.g. use a lot of simple function (or html pages) &

Re: best practice

2011-11-10 Thread Marc Aymerich
On Thu, Nov 10, 2011 at 7:24 AM, mirco fini wrote: > fantastic, that was exactly what I was looking for Sure you find interesting this references: DjangoCon 2008: Reusable Apps http://youtu.be/A-S0tqpPga4 Other djangocon talks http://blip.tv/djangocon This stackoverflow question has a good boo

Re: Any help regarding the SAAS based django-web application

2011-12-09 Thread Marc Aymerich
On Thu, Dec 8, 2011 at 2:25 PM, pritesh modi wrote: > Hi guys > > Any one suggest me that how saas architecture based > application is developed in django.which pattern and architecture way whole > application is developed? also application to be pluggable can be reusable > and a

Re: Is there a recommended pattern for creating "replaceable" apps?

2012-11-20 Thread Marc Aymerich
On Tue, Nov 20, 2012 at 4:35 AM, Russell Keith-Magee wrote: > > On Tue, Nov 20, 2012 at 6:28 AM, Chris Cogdon wrote: >> >> Hi folks! >> >> I'm creating an application to manage an art show (with art pieces to view >> and sell, silent and voice auctions, and a sales process). To have this >> work,

Implementing a monitoring system with django.

2012-12-10 Thread Marc Aymerich
Hi, I'm considering to implement a simple monitorization system that basically gathers some data from a set of nodes (<1000 nodes). The gathered data should be stored in order to let users perform some queries and maybe also generate some graphs. I'm looking for advice in what components are best

Re: Implementing a monitoring system with django.

2012-12-11 Thread Marc Aymerich
On Tue, Dec 11, 2012 at 4:32 PM, Bill Freeman wrote: > > > On Mon, Dec 10, 2012 at 2:41 PM, Marc Aymerich wrote: >> >> Hi, >> I'm considering to implement a simple monitorization system that >> basically gathers some data from a set of nodes (<1000 node

Re: Implementing a monitoring system with django.

2012-12-13 Thread Marc Aymerich
now..am running some. Thanks Ephan, those graphs looks really nice! I'm looking into them. > On Tuesday, December 11, 2012 11:09:06 PM UTC+2, Marc Aymerich wrote: >> >> On Tue, Dec 11, 2012 at 4:32 PM, Bill Freeman wrote: >> > >> > >> > On Mon, Dec

Re: Implementing a monitoring system with django.

2012-12-14 Thread Marc Aymerich
On Wed, Dec 12, 2012 at 12:23 PM, Tom Evans wrote: > On Mon, Dec 10, 2012 at 7:41 PM, Marc Aymerich wrote: >> Hi, >> I'm considering to implement a simple monitorization system that >> basically gathers some data from a set of nodes (<1000 nodes). The >> gath

Automating deployments

2013-02-01 Thread Marc Aymerich
Hi, I'm thinking about the best way to provide automatic deployment for the Django project I'm working on. Its a pretty big one and has lots of dependencies, lots of SO packages, Celeryd and other daemons, SO tweaks... and also several people will need to have installed it on their servers (they ar

Re: Django Shopping Cart

2013-02-27 Thread Marc Aymerich
On Wed, Feb 27, 2013 at 10:02 PM, vijay shanker wrote: > hey, i want to write a shopping cart app, please provide some inputs, > useful information, suggestions etc for doing it right . > thanks > have you looked at django-oscar? -- Marc -- You received this message because you are subscrib

Re: FastCGI Recipe for shared hosting

2013-03-03 Thread Marc Aymerich
On Sun, Mar 3, 2013 at 5:33 PM, Tim Johnson wrote: > * Tim Johnson [130302 14:30]: > > * Tom Evans [130301 06:44]: > > > Apache httpd with mod_fastcgi: > > > > > > RewriteCond %{REQUEST_URI} !^/media > > > RewriteCond %{REQUEST_URI} !^/ > > > # repeat for any other directories you want httpd to

Django inline formsets, force initial data to be saved.

2013-03-04 Thread Marc Aymerich
Hi, I've spend several hours trying to figure out how to save inlines with initial data in them. basically I have a very simple model with 2 fields: class DirectIface(models.Model): parent = models.ForeignKey('nodes.Node') name = models.CharField(max_lenght=64) And what I'm doing is defi

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
On Tue, Mar 5, 2013 at 3:11 AM, Russell Keith-Magee wrote: > > > On Mon, Mar 4, 2013 at 10:31 PM, Marc Aymerich wrote: > >> Hi, >> I've spend several hours trying to figure out how to save inlines with >> initial data in them. >> >> basically I have

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
On Tue, Mar 5, 2013 at 3:11 AM, Russell Keith-Magee wrote: > > > On Mon, Mar 4, 2013 at 10:31 PM, Marc Aymerich wrote: > >> Hi, >> I've spend several hours trying to figure out how to save inlines with >> initial data in them. >> >> basically I have

Re: Django inline formsets, force initial data to be saved.

2013-03-05 Thread Marc Aymerich
On Tue, Mar 5, 2013 at 4:43 PM, Marc Aymerich wrote: > > > On Tue, Mar 5, 2013 at 3:11 AM, Russell Keith-Magee < > russ...@keith-magee.com> wrote: > >> >> >> On Mon, Mar 4, 2013 at 10:31 PM, Marc Aymerich wrote: >> >>> Hi, >>> I&

Sending emails, models or views?

2013-06-19 Thread Marc Aymerich
Yep, I'm more or less convinced that the logic needed for sending an email should go into models. But what about the action (method call) of sending the email? what layer should be responsible for triggering an email notification? models or views? This is something I keep wondering myself for a lon

Re: ANNOUNCE: Django 1.6 beta 1 released

2013-06-28 Thread Marc Aymerich
On Fri, Jun 28, 2013 at 3:48 PM, Jacob Kaplan-Moss wrote: > Hi folks -- > > I'm pleased to announce that we've just released Django 1.6 beta 1, > the second in our series of preview releases leading up to Django 1.6 > (due in August). > > More information can be found on our blog: > > > https://ww

Retrieving json stored in TextField as json

2013-10-09 Thread Marc Aymerich
Hi, I'm storing large volumes of json data in a TextFields, Then I have a view that converts this text data into JSON, but this silly operation requires a considerable amount of resources for a large dataset. It would be nice if I'm able to retrieve native JSON directly from the database. As you

Re: Retrieving json stored in TextField as json

2013-10-10 Thread Marc Aymerich
ue': '{"scheduled":2,"total":849,"15min":0.33,"1min":0.51,"5min":0.32}'}] did I missed something? On Thu, Oct 10, 2013 at 1:16 AM, Rafael Durán Castañeda wrote: > I'm using django-json-field [1] for solving the same problem

Re: Retrieving json stored in TextField as json

2013-10-10 Thread Marc Aymerich
On Thu, Oct 10, 2013 at 6:02 PM, Daniel Roseman wrote: > On Thursday, 10 October 2013 10:08:18 UTC+1, Marc Aymerich wrote: >> >> Hi Rafael, thanks ! >> I forgot to mention that I was already using django-jsonfield >> https://github.com/bradjasper/django-jsonfield >&g

Accessing related objects on model.clean()

2013-10-16 Thread Marc Aymerich
Yep, I'm writing some validation logic for a model that is being used in an admin inline form The model looks like this class Child(models.Model): parent = models.ForeignKey(Parent) def clean(self): super().clean() if self.parent.surname != self.surname:

Re: Accessing related objects on model.clean()

2013-10-17 Thread Marc Aymerich
On Wed, Oct 16, 2013 at 11:52 PM, Marc Aymerich wrote: > Yep, > I'm writing some validation logic for a model that is being used in an > admin inline form > > The model looks like this > > class Child(models.Model): > parent = models.ForeignKey(Pa

Re: RestFul with Class Based Views best practice

2013-10-29 Thread Marc Aymerich
On Tue, Oct 29, 2013 at 8:45 PM, pywebdesign wrote: > Hi, > > I am trying to find/develop a best way to name and organize Views class to > be consistent and flexible. > > I am working on a project witch involve an model called Song. It's kind of > a midi song in a database with attibutes about au

form that displays an elements list with checkboxes

2011-05-11 Thread Marc Aymerich
Hi, I want to do a form that displays a list of elements that can be selected with a checkbox and then submit the selected elements, but I haven't found any code sample for this. I'll apreciate if someone can give me a link to an example or any advice on this! Many thanks! -- Marc -- You receiv

Re: form that displays an elements list with checkboxes

2011-05-11 Thread Marc Aymerich
On Wed, May 11, 2011 at 3:24 PM, Daniel Roseman wrote: > On Wednesday, May 11, 2011 2:17:07 PM UTC+1, Marc Aymerich wrote: >> >> Hi, >> I want to do a form that displays a list of elements that can be selected >> with a checkbox and then submit the selected elements,

Custom Managers and Q() Objects

2011-05-16 Thread Marc Aymerich
Hi, my question is, How can I define a custom manager that can handle Q objects? Thanks! -- Marc -- 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

Re: Custom Managers and Q() Objects

2011-05-16 Thread Marc Aymerich
On Mon, May 16, 2011 at 8:53 PM, Shawn Milochik wrote: > On 05/16/2011 02:48 PM, Marc Aymerich wrote: > >> Hi, >> my question is, How can I define a custom manager that can handle Q >> objects? >> >> Thanks! >> > A custom manager, being a sub

Re: Custom Managers and Q() Objects

2011-05-16 Thread Marc Aymerich
On Mon, May 16, 2011 at 10:21 PM, Michal Petrucha wrote: > On Mon, May 16, 2011 at 09:58:40PM +0200, Marc Aymerich wrote: > > Hi Swawm. > > Thanks for your answer. > > > > when I call Model.objects.active_during(Q(Q(ini=some_date, end=some_date) > | > > Q(ini

Re: Custom Managers and Q() Objects

2011-05-17 Thread Marc Aymerich
On Tue, May 17, 2011 at 2:57 PM, Michal Petrucha wrote: > On Mon, May 16, 2011 at 11:54:14PM +0200, Marc Aymerich wrote: > > > > when I call Model.objects.active_during(Q(Q(ini=some_date, > end=some_date) > > > | > > > > Q(ini=other_d

Chained forms

2011-05-31 Thread Marc Aymerich
Hi!, I'm writing an admin action. This action needs to collect some information before execute the "final task". In order to collect this information the user should fill 3 consecutive forms, (once they submitted one, another is rendered). My question is, How can I store the form fields state subm

Re: Chained forms

2011-06-01 Thread Marc Aymerich
On Wed, Jun 1, 2011 at 9:52 AM, bruno desthuilliers wrote: > On May 31, 6:55 pm, Marc Aymerich wrote: >> Hi!, >> I'm writing an admin action. >> This action needs to collect some information before execute the "final >> task". >> In order to

Re: Reasons to use managers

2011-06-03 Thread Marc Aymerich
On Fri, Jun 3, 2011 at 8:30 AM, Amit Sethi wrote: >> functionality to your models. (For "row-level" functionality -- i.e., >> functions that act on a single instance of a model object -- use Model >> methods, not custom Manager methods.) >> > > But what is the benefit of model methods compared to

Re: Reasons to use managers

2011-06-03 Thread Marc Aymerich
On Fri, Jun 3, 2011 at 11:29 AM, Marc Aymerich wrote: > On Fri, Jun 3, 2011 at 8:30 AM, Amit Sethi wrote: >>> functionality to your models. (For "row-level" functionality -- i.e., >>> functions that act on a single instance of a model object -- use Model >>

overriding admin/bashe.html block messages.

2011-06-07 Thread Marc Aymerich
HI I'm trying to override the block messages in order to allow messages with HTML in one of my model changelist pages. After realizing that the tipical override with template extension seems that doesn't work with messages block I go to the original django base.html admin template to try the modif

django transactions.

2011-06-07 Thread Marc Aymerich
Hi, I've activated the 'django.middleware.transaction.TransactionMiddleware' and I've decorated one method with @transaction.commit_on_success With this I expect that if the method raise an exception, django rolls back any database operation executed by this method, even the operations executed by

Re: django transactions.

2011-06-08 Thread Marc Aymerich
On Tue, Jun 7, 2011 at 11:53 PM, Malcolm Box wrote: > n 7 June 2011 15:16, Marc Aymerich wrote: >> >> Hi, >> I've activated the >> 'django.middleware.transaction.TransactionMiddleware' and I've >> decorated one method with @transaction.commi

Get all reverse related objects.

2011-06-11 Thread Marc Aymerich
Hi! Imagine that you have these three models: class Model_A(models.Model): pass class Model_B(models.Model): pass class Model_C(models.Model): model_a = models.ForeignKey(Model_A) model_b = models.ManyToManyField(Model_B) object_Model_A._meta.get_all_related_objects() This shoul

Re: Get all reverse related objects.

2011-06-12 Thread Marc Aymerich
On Sun, Jun 12, 2011 at 4:09 AM, Venkatraman S wrote: > On Sun, Jun 12, 2011 at 12:10 AM, Marc Aymerich wrote: >> >> But, I'm wondering if django provides some generic mechanism to do the >> invers relation? it is,given a Model_C object get all related Model_A >&g

ManyToMany field and deletes

2011-06-12 Thread Marc Aymerich
Hi , I realize that django doesn't delete related objects when M2M field hasn't remaining relations. I don't see why django has this behaviour by default. I think it's a bit problematic because you can have 'orphan objects', and more over a change form for this object will raise a validation except

Re: ManyToMany field and deletes

2011-06-16 Thread Marc Aymerich
On Thu, Jun 16, 2011 at 3:55 PM, Russell Keith-Magee wrote: Hi Russell, many thanks for your answer :) > It has this behaviour because it's the most sensible general approach > when an m2m relation is involved. > > Consider the general case: a relation between Person and Club. A > person can bel

Re: ManyToMany field and deletes

2011-06-16 Thread Marc Aymerich
On Thu, Jun 16, 2011 at 5:36 PM, Tom Evans wrote: > On Thu, Jun 16, 2011 at 4:16 PM, Marc Aymerich wrote: >> On Thu, Jun 16, 2011 at 3:55 PM, Russell Keith-Magee >> wrote: >> >> Hi Russell, many thanks for your answer :) >> >>> It has this behavi

[OT] I never get the task result with django-celery

2011-06-20 Thread Marc Aymerich
Hi, Just right now I installed the django-celery with rabbitMQ and I'm running this simple tests. I define this task on my contacts app: # contacts/tasks.py: from celery.decorators import task @task() def add(x, y): return x + y Then, I execute it with python shell: >>> from contacts.tasks im

Re: [OT] I never get the task result with django-celery

2011-06-20 Thread Marc Aymerich
On Mon, Jun 20, 2011 at 2:01 PM, Marc Aymerich wrote: > Hi, > Just right now I installed the django-celery with rabbitMQ and I'm > running this simple tests. > > I define this task on my contacts app: > > # contacts/tasks.py: > from celery.decorators import

Best way of rendernig ""dynamic"" templates

2011-06-23 Thread Marc Aymerich
Hi, I'm deveolping some reusable apps with the aim of generating apache config files. The schema is: one 'base' app called apache and an arbitrary number of apps that act as OPTIONAL extensions. These extension apps fit with base app on django-admin as inlines forms, and the template is rendered w

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread Marc Aymerich
On Mon, Jun 27, 2011 at 11:03 PM, momo2k wrote: > Hello, > > Is there a way to set dynamic default values for custom fields in the > admin? > > Description of the problem: > > # models.py > # there are two models > class Meal(models.Model): >    name = ... > >    def check_new_price(self, price):

Re: ModelAdmin, custom field: default value?

2011-06-28 Thread Marc Aymerich
On Tue, Jun 28, 2011 at 10:27 AM, Marc Aymerich wrote: > On Mon, Jun 27, 2011 at 11:03 PM, momo2k wrote: >> Hello, >> >> Is there a way to set dynamic default values for custom fields in the >> admin? >> >> Description of the problem: >> >>

Re: Complex Query help - get items from the org to which the user belongs

2011-07-05 Thread Marc Aymerich
On Tue, Jul 5, 2011 at 9:06 PM, Venkatraman S wrote: > I tried asking around in IRC, and stumbled on a few possible solutions, > would be great if someone shed some more light: > > I have the following models: > > class Organization(models.Model): > name= models.CharField(max_le

Re: Complex Query help - get items from the org to which the user belongs

2011-07-06 Thread Marc Aymerich
On Wed, Jul 6, 2011 at 4:46 AM, Venkatraman S wrote: > > On Wed, Jul 6, 2011 at 2:26 AM, Marc Aymerich wrote: > >> Say there are 3 Users in an org : A, B and C with each creating 3,4,5 >> items respectively, and 'A' is the current user; then i need a query which

Re: Complex Query help - get items from the org to which the user belongs

2011-07-06 Thread Marc Aymerich
On Wed, Jul 6, 2011 at 2:46 PM, Venkatraman S wrote: > > > On Wed, Jul 6, 2011 at 2:10 PM, Marc Aymerich wrote: >> >> This one should work: >> Items.objects.filters(created_by__employee__org=A.org) > > Nope. Emp has a FK for User, not the other way round

Re: Speed of search question

2011-07-07 Thread Marc Aymerich
On Thu, Jul 7, 2011 at 8:15 AM, Benedict Verheyen wrote: > On 6/07/2011 12:28, Malcolm Box wrote: >> I think this should work: >> >> Calendar.objects.filter(appointment__owner = request.user) >> >> Try it and see. >> >> Malcolm >> > > Thanks, > > > I'll see if I can make a test script to test this

Re: get all objects that are related to current, reverse look up

2011-07-12 Thread Marc Aymerich
On Tue, Jul 12, 2011 at 4:32 AM, garagefan wrote: > simply put, here's my code > > class ContentBlock(Orderable, Displayable): >  location = models.ManyToManyField(ContentBlockLocation, blank=True, > null=True, help_text="list of locations to display content block") >  page = models.ManyToManyFiel

Re: Inspecting objects

2011-07-12 Thread Marc Aymerich
On Tue, Jul 12, 2011 at 7:25 PM, Lukich wrote: > Hi.  I have just started diving into Django and this question came up > - is there a way for me to examine all the attribute values of an > object?  In Rails there's such a thing as debug statement which spits > out all the details about the object.

insert an inline to a ModelAdmin at runtime

2011-07-15 Thread Marc Aymerich
Hi, I created a method that generates an InlineFormset at runtime and inserts it to a given ModelAdmin. It works perfectly when I call my method directly on admin.py #admin.py admin.site.register(MyModel, MyModelAdmin) insert_generic_plugin_inlines(MyOtherModelAdmin) but it doesn't work when this

Re: insert an inline to a ModelAdmin at runtime

2011-07-15 Thread Marc Aymerich
On Fri, Jul 15, 2011 at 1:35 PM, Marc Aymerich wrote: > Hi, > I created a method that generates an InlineFormset at runtime and inserts > it to a given ModelAdmin. > > It works perfectly when I call my method directly on admin.py > #admin.py > admin.site.register(

Re: Accounting app - design decisions needed

2011-07-18 Thread Marc Aymerich
On Mon, Jul 18, 2011 at 10:54 PM, Andre Terra wrote: > Hello, django-users. > > I'm in need of some serious help on deciding how to design my next project. > Below is my attempt to describe the use case: > > *USE CASE* > I'm writing an accounting app that will be generating unique monthly > repor

Re: Accounting app - design decisions needed

2011-07-19 Thread Marc Aymerich
On Tue, Jul 19, 2011 at 1:13 AM, Andre Terra wrote: > Marc, > > First of all, thank you for your insights. I'll try to clarify things as > best as I can. > > On Mon, Jul 18, 2011 at 7:21 PM, Marc Aymerich wrote: > >> >> >> On Mon, Jul 18, 2011 at 10:54

Re: Database Design Question

2011-07-21 Thread Marc Aymerich
On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote: > On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote: > > ContractProduct.objects.all() > > Following might work also (not sure, but is easy to test in shell for > > example): > > for c in Contract.objects.all(): > > for cp in c.contractprod

Re: Database Design Question

2011-07-21 Thread Marc Aymerich
On Thu, Jul 21, 2011 at 11:33 PM, Marc Aymerich wrote: > > > On Thu, Jul 21, 2011 at 11:11 PM, nixlists wrote: > >> On Thu, Jul 21, 2011 at 4:30 PM, Jani Tiainen wrote: >> > ContractProduct.objects.all() >> > Following might work also (not sure, but is ea

Re: too many queries: populate template from model foreign key lookup

2011-07-24 Thread Marc Aymerich
On Sun, Jul 24, 2011 at 3:10 AM, Gelonida N wrote: > Hi, > > I try to populate a template from a Model with a ForeignKey element) > members of the foreign key element should be displayed. > > If I understand correctly my first attempt resulted in one query for > fetching the entries from my first

Re: turning a Model instance into an instance of one of it's subclasses

2010-12-20 Thread Marc Aymerich
On Mon, Dec 20, 2010 at 8:29 PM, morgan wahl wrote: > Hello all, > > I was wonder if there is a way to turn a model instance into an > instance of a subclass of it's class. E.g.: > > class Document(models.Model): >doctype = models.CharField(max_length=256, blank=True, null=True) > > class Upl

Re: turning a Model instance into an instance of one of it's subclasses

2010-12-20 Thread Marc Aymerich
On Mon, Dec 20, 2010 at 11:00 PM, Morgan Wahl wrote: > On Mon, Dec 20, 2010 at 4:49 PM, Marc Aymerich > wrote: > > > > > > On Mon, Dec 20, 2010 at 8:29 PM, morgan wahl > wrote: > >> > >> Hello all, > >> > >> I was wonder if the

Re: turning a Model instance into an instance of one of it's subclasses

2010-12-20 Thread Marc Aymerich
On Mon, Dec 20, 2010 at 11:14 PM, morgan wahl wrote: > Yes, I had hope that would work, but it doesn't (see my original post). In > your example u.doctype would end up as None instead of 'whatever'. woww, I really need go to sleep :) I don't know the best way to achieve that, btw you can pass

Re: turning a Model instance into an instance of one of it's subclasses

2010-12-20 Thread Marc Aymerich
On Mon, Dec 20, 2010 at 11:34 PM, Marc Aymerich wrote: > > > On Mon, Dec 20, 2010 at 11:14 PM, morgan wahl wrote: > >> Yes, I had hope that would work, but it doesn't (see my original post). In >> your example u.doctype would end up as None instead of 'whatever

Question about MVC design

2010-12-21 Thread Marc Aymerich
I am designing an ISP control panel with django. I split the project in many apps, some will be reusable, others not. Well, one of its features is to provide mechanisms for users to create email accounts on a mail server with a cost. The apps involved on this process are: mails: store the mail acc

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: > Hi there, > > I want to know is there any authentication module base on Linux passwd/ > shadow file for django? > http://atlee.ca/software/pam/module-index.html import pam from django.contrib.auth.models import User class PamBackend: def aut

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich wrote: > > > On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: > >> Hi there, >> >> I want to know is there any authentication module base on Linux passwd/ >> shadow file for django? >> > > http://atlee.

Re: Linux password authentication for django

2010-12-30 Thread Marc Aymerich
On Thu, Dec 30, 2010 at 4:41 PM, Marc Aymerich wrote: > > > On Thu, Dec 30, 2010 at 4:24 PM, Marc Aymerich wrote: > >> >> >> On Thu, Dec 30, 2010 at 6:35 AM, Bill wrote: >> >>> Hi there, >>> >>> I want to know is there any authent

Re: constructor for model, automatically generate field, __init__

2011-01-01 Thread Marc Aymerich
On Sat, Jan 1, 2011 at 9:27 PM, gintare wrote: > > class Word: >fWord=models.CharField(blank=True, default='') >fsmth=models.CharField(blank=True, default='') >def __init__(self, fWord): >self.fWord=fWord >self.fsmth=fWord+fWord > > I need to add entrance to fsmth auto

Re: Generic views

2011-01-11 Thread Marc Aymerich
On Tue, Jan 11, 2011 at 3:02 PM, martinez wrote: > I would like to know if I could work without generic views. > > This issue was discussed in this list a couple months ago: http://groups.google.com/group/django-users/browse_thread/thread/a67d36c94efc2d3f/9cd7c5299ac74f13 -- Marc -- You rec

Re: model best practice

2011-01-13 Thread Marc Aymerich
On Thu, Jan 13, 2011 at 1:45 PM, Олег Корсак wrote: > > hello. My models.py file became very big and actually I can divide that > app for 2-3 different apps. But the problem is that almost all models > are related to one model which is common and will be in different app. > Is it still a good idea

Re: Abstract Model Inheritance and Custom Managers?

2011-01-13 Thread Marc Aymerich
On Thu, Jan 13, 2011 at 9:10 PM, ringemup wrote: > If a manager is defined on an abstract model, do non-abstract child > models inherit the manager? http://docs.djangoproject.com/en/dev/topics/db/managers/#custom-managers-and-model-inheritance -- Marc -- You received this message because you a

Re: following ManyToManyField related objects

2011-01-13 Thread Marc Aymerich
On Thu, Jan 13, 2011 at 6:40 PM, ranadave wrote: > I'm using Django version 1.1.2. > > I'm trying to find all objects that reference object A. > Object B has a ManyToManyField to A. > Object C has the same, but it uses a defined through table. > > When I do: >> related_objs = CollectedObjects() >>

Re: adding fields into another apps forms (in plugin style)

2011-01-19 Thread Marc Aymerich
On Wed, Jan 19, 2011 at 3:00 AM, Michael Buckley wrote: > I have been looking at the docs, but so far I can't find anything to help. > I am looking to set up some kind of plugin system, so for example I set up > my base user registration form, then I might have another app that when > added to INS

DRY and static attribute for multiple classes.

2011-02-01 Thread Marc Aymerich
Hi all, I want to provide an encapsulated static attribute called _registry for several classes. I try to use inheritance in order to make it DRY: all classes inherit from a BaseClass that implements the _registry encapsulation. But with inheritance it doesn't work how I want, because a single ins

Re: DRY and static attribute for multiple classes.

2011-02-01 Thread Marc Aymerich
On Tue, Feb 1, 2011 at 10:22 PM, bruno desthuilliers wrote: > On 1 fév, 22:05, Marc Aymerich wrote: >> Hi all, >> I want to provide an encapsulated static attribute called _registry >> for several classes. >> >> I try to use inheritance in order to make it D

Re: DRY and static attribute for multiple classes.

2011-02-01 Thread Marc Aymerich
On Tue, Feb 1, 2011 at 10:29 PM, Adrian Bool wrote: > > On 1 Feb 2011, at 21:05, Marc Aymerich wrote: > >> Hi all, >> I want to provide an encapsulated static attribute called _registry >> for several classes. >> >> I try to use inheritance in order to mak

inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
Hi! I have a plugin style app that adds "support" for PHP (inserting two admin inlines) into VirtualHostAdmin class, I use this code for the job: admin.site.unregister(VirtualHost) ix = len(VirtualHostAdmin.inlines) VirtualHostAdmin.inlines.insert(ix, PHPVersionInline) VirtualHostAdmin.inlines.ins

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
On Wed, Feb 2, 2011 at 5:19 PM, Daniel Roseman wrote: > On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: >> >> Hi! >> I have a plugin style app that adds "support" for PHP (inserting two >> admin inlines) into VirtualHostAdmin

Re: inserting inlines to an specific admin class affects all of them

2011-02-02 Thread Marc Aymerich
On Wed, Feb 2, 2011 at 5:39 PM, Marc Aymerich wrote: > On Wed, Feb 2, 2011 at 5:19 PM, Daniel Roseman wrote: >> On Wednesday, February 2, 2011 4:00:34 PM UTC, Marc Aymerich wrote: >>> >>> Hi! >>> I have a plugin style app that adds "support"

Override admin popup default url

2011-02-03 Thread Marc Aymerich
Hi, I need to pass some extra parameters in some admin popups. For example, this is the default URL for an arbitrary popup: http://localhost:8081/admin/web/systemgroup/add/?_popup=1 What I want is add a new element on the dict queryset: http://localhost:8081/admin/web/systemgroup/add/?_popup=1&co

Why django not found static files?

2011-02-03 Thread Marc Aymerich
Hi, I just installed the django-admin-tools app but my django installation doesn't load the css, js and other static files. in settings.py I have: STATIC_ROOT = '/home/ucp/trunk/static/' STATIC_URL = '/static/' and when i try to load http://localhost:8081/static/admin_tools/css/dashboard.css I ge

Re: Why django not found static files?

2011-02-03 Thread Marc Aymerich
On Thu, Feb 3, 2011 at 12:51 PM, Marc Aymerich wrote: > Hi, > I just installed the django-admin-tools app but my django installation > doesn't load the css, js and other static files. > > in settings.py I have: > STATIC_ROOT = '/home/ucp/trunk/static/' > STATIC

Re: Why django not found static files?

2011-02-03 Thread Marc Aymerich
On Thu, Feb 3, 2011 at 2:58 PM, Brian Neal wrote: > On Feb 3, 6:04 am, Marc Aymerich wrote: >> On Thu, Feb 3, 2011 at 12:51 PM, Marc Aymerich wrote: >> > Hi, >> > I just installed the django-admin-tools app but my django installation >> > doesn'

Change null representation when you're using choices widget.

2011-02-04 Thread Marc Aymerich
Hi In some choices widgets I want to represent null values as u'No period' instead of u'' I try with: PERIOD_CHOICES = getattr(settings, 'PERIOD_CHOICES', ((None, ugettext('No Period')),

Re: Change null representation when you're using choices widget.

2011-02-04 Thread Marc Aymerich
On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans wrote: > On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich wrote: >> Hi >> In some choices widgets I want to represent null values as u'No >> period' instead of u'' >> >> I try with: >

Re: Change null representation when you're using choices widget.

2011-02-04 Thread Marc Aymerich
On Fri, Feb 4, 2011 at 3:31 PM, Marc Aymerich wrote: > On Fri, Feb 4, 2011 at 12:12 PM, Tom Evans wrote: >> On Fri, Feb 4, 2011 at 11:07 AM, Marc Aymerich wrote: >>> Hi >>> In some choices widgets I want to represent null values as u'No >>> period&#

Re: Change null representation when you're using choices widget.

2011-02-04 Thread Marc Aymerich
On Fri, Feb 4, 2011 at 3:37 PM, Marcos Moyano wrote: > Remove (None, "No Period") from your choices and left the required=False on > your form field. That should work. > but I wanted to do was to change the default value of null value: instead of '--' I want to show "No Period". this seems to

Admin change view and extra form field.

2011-02-04 Thread Marc Aymerich
I have an AdminModel with an overridden form, just for having an extra form field called 'limit'. This field 'limit' is stored in a separated model. Until here I haven't any problem. Now I want to show the saved 'limit' value when I am on admin change_view. Unfortunately the admin change_view met

Re: Admin change view and extra form field.

2011-02-04 Thread Marc Aymerich
On Fri, Feb 4, 2011 at 5:23 PM, Marc Aymerich wrote: > I have an AdminModel with an overridden form, just for having an extra > form field called 'limit'. > > This field 'limit' is stored in a separated model. Until here I > haven't any problem. > > N

Re: How to know if is a update or insert??

2011-02-04 Thread Marc Aymerich
On Fri, Feb 4, 2011 at 10:13 PM, andmart wrote: > Hi, > > I overrided the save_model of ModelAdmin of model Client that is > associated a one User so I can create a user when a client is created. > > Well, how to know if the save_model was called to do a update or a > insert if the object already

Re: Best DRY practices for a view function that will be used by all other views.

2011-02-05 Thread Marc Aymerich
On Sat, Feb 5, 2011 at 9:21 AM, Ken Chida wrote: > I tried my best to search for an answer but my efforts yielded nothing. > Allow me to give you a simple example to illustrate my problem.  Let's > pretend that I want to have a login form on every single page on my > website.  Obviously, the login

Re: How to know if is a update or insert??

2011-02-06 Thread Marc Aymerich
On Sun, Feb 6, 2011 at 2:53 PM, andmart wrote: > In a insert or in a update, the pk is already filled in > ModelAdmin.save_model. > > The creation of object in database is in ModelForm.save. > > So, I think it's not the way to handle it. > > I notivced googling there is a boolean parameter named c

<    1   2   3   >