Re: Does imports of related models affect cascade deletion?

2015-07-30 Thread Marc Aymerich
On Thu, Jul 30, 2015 at 3:38 PM, Markus Amalthea Magnuson wrote: > Hey, > > I stumbled upon a piece of code and a comment that says this: > > Deleting a model object that has related objects will only cascade delete > those objects if their models have been imported. > > Is this true? I have not f

Annotations with nested Sums

2015-07-10 Thread Marc Aymerich
Hi, I need to do some annotations that require a nested sumation, I have Bills that have Lines that in turn have Sublines: Bill -> Line -> SubLine In order to calculate the total bill price I need to add all sublines of every line, and then all lines of a bill. queryset.annotate( total=Sum(F('

Re: What is the ideal web server to use with Django?

2015-05-15 Thread Marc Aymerich
On Fri, May 15, 2015 at 10:33 AM, Tom Evans wrote: > On Thu, May 14, 2015 at 4:18 PM, Marc Aymerich wrote: >> On Thu, May 14, 2015 at 11:26 AM, Tom Evans wrote: >>> On our app servers we typically use Apache with worker MPM and >>> mod_wsgi, although we have a few ngi

Re: What is the ideal web server to use with Django?

2015-05-14 Thread Marc Aymerich
On Thu, May 14, 2015 at 11:26 AM, Tom Evans wrote: > > On Thu, May 14, 2015 at 4:36 AM, reduxionist > wrote: > > The question you asked Tom was "Doesn't Apache create new process for each > > request [thus eating memory when serving large amounts of static files > > during traffic peaks]?", and

Re: Ensure an object is saved even when the atomic bock rollsback

2015-05-08 Thread Marc Aymerich
On Fri, May 8, 2015 at 6:43 PM, Marc Aymerich wrote: > > > On Fri, May 8, 2015 at 5:50 PM, Carl Meyer wrote: > >> Hi Marc, >> >> On 05/08/2015 07:15 AM, Marc Aymerich wrote: >> > I'm using atomic requests, but one of my views needs to save a

Re: Ensure an object is saved even when the atomic bock rollsback

2015-05-08 Thread Marc Aymerich
On Fri, May 8, 2015 at 5:50 PM, Carl Meyer wrote: > Hi Marc, > > On 05/08/2015 07:15 AM, Marc Aymerich wrote: > > I'm using atomic requests, but one of my views needs to save a model > > regardless of wheter the current transaction rolls back or not. > > >

Ensure an object is saved even when the atomic bock rollsback

2015-05-08 Thread Marc Aymerich
HI, I'm using atomic requests, but one of my views needs to save a model regardless of wheter the current transaction rolls back or not. I'm confused about how to proceed with the current autocommit behaviour. Do I need to use a different db connection? or perhaps there is some way of telling dja

Re: [ANNOUNCE] Django 1.8 released

2015-04-03 Thread Marc Aymerich
On Wed, Apr 1, 2015 at 10:46 PM, Tim Graham wrote: > Django 1.8, the next long-term support release, is now available: > > https://www.djangoproject.com/weblog/2015/apr/01/release-18-final/ > > With the release of Django 1.8, Django 1.6 has reached end-of-life. As > such, Django 1.6.11 is the fin

Re: Running middleware within ATOMIC_REQUESTS transaction

2015-03-12 Thread Marc Aymerich
On Tue, Mar 10, 2015 at 5:38 PM, Marc Aymerich wrote: > > > On Tue, Mar 10, 2015 at 5:15 PM, Marc Aymerich > wrote: > >> >> >> On Tue, Mar 10, 2015 at 5:12 PM, Marc Aymerich >> wrote: >> >>> Hi, >>> I have a middleware that perfor

Re: Running middleware within ATOMIC_REQUESTS transaction

2015-03-10 Thread Marc Aymerich
On Tue, Mar 10, 2015 at 5:15 PM, Marc Aymerich wrote: > > > On Tue, Mar 10, 2015 at 5:12 PM, Marc Aymerich > wrote: > >> Hi, >> I have a middleware that performs some operations at the end of each >> request. >> >> What I have found is that middlew

Re: Running middleware within ATOMIC_REQUESTS transaction

2015-03-10 Thread Marc Aymerich
On Tue, Mar 10, 2015 at 5:12 PM, Marc Aymerich wrote: > Hi, > I have a middleware that performs some operations at the end of each > request. > > What I have found is that middlewares do not run inside the > ATOMIC_REQUESTS transaction. But I want the ATOMIC_REQUESTS transactio

Running middleware within ATOMIC_REQUESTS transaction

2015-03-10 Thread Marc Aymerich
Hi, I have a middleware that performs some operations at the end of each request. What I have found is that middlewares do not run inside the ATOMIC_REQUESTS transaction. But I want the ATOMIC_REQUESTS transaction to rollback if an exception is being raised on my middleware. Any idea on how to so

Re: Python: Assign variable in if statement?

2014-11-30 Thread Marc Aymerich
On Sun, Nov 30, 2014 at 12:30 PM, ThomasTheDjangoFan wrote: > Hi guys, > > coming from php I am wondering if there is a way to do something like this > in Python/Django: > > if variable = get_a_value_from_function(): > new_stuff = variable > > Of course I can use > > variable = get_a_value_from_

AppConfig where to execute initialization queries?

2014-10-06 Thread Marc Aymerich
Hi, I have been bitten by unexpected behaviors when running tests because on AppConfig.ready() I was initializing some stuff that depends on DB stored data. Reading the django docs I've found a warning that specifically suggests not to do this [1]. But then I wonder where this kind of initializatio

Re: django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Marc Aymerich
On Tue, Jul 8, 2014 at 12:54 PM, Frank Bieniek < frank.bien...@produktlaunch.de> wrote: > Hi Marc, > > this should fix it: > > File "/home/orchestra/django-orchestra/orchestra/apps/accounts/models.py", >> line 9, in Account >> user = models.OneToOneField(get_user_model(), >> related_name='acc

django.core.exceptions.AppRegistryNotReady

2014-07-08 Thread Marc Aymerich
Hi, Wanted to try 1.7 and I'm hit by an exception that don't know how to solve :) running current 1.7.x branch, here full runserver output: orchestra@orchestra:~/panel$ python manage.py runserver 0.0.0.0: /usr/local/lib/python2.7/dist-packages/djcelery/managers.py:77: RemovedInDjango18Warning

Re: Inlines in admin

2014-04-07 Thread Marc Aymerich
On Mon, Apr 7, 2014 at 3:04 PM, Emanuel wrote: > Hi all! > > I'm have the following models: > > Class A(models.Model): > pass > > > Class Z(models.Model): > pass > > > Class B(models.Model): > a = models.ForeignKey(a) > z = models.ForeignKey(Z) > >def __unicode__(self)

Annotate concat() of two fields

2014-03-29 Thread Marc Aymerich
Hi, I want to annotate the concatenation of two string fields, something like Domain.objects.annotate(annotation=F('field1')+F('field2')) however it is not possible to use F expressions on annotate(). I'm trying to accomplish the same thing using extra() however I don't know how to do it right,

Re: AssertionError: u'ns.example.com.' == 'ns.example.com.' ?

2014-02-12 Thread Marc Aymerich
On Wed, Feb 12, 2014 at 8:01 PM, Larry Martell wrote: > On Wed, Feb 12, 2014 at 1:56 PM, Marc Aymerich wrote: >> I'm running my Django app tests and I'm getting a random and very >> annoying assertion error >> >> =

AssertionError: u'ns.example.com.' == 'ns.example.com.' ?

2014-02-12 Thread Marc Aymerich
I'm running my Django app tests and I'm getting a random and very annoying assertion error == FAIL: test_rest_dns_delete (orchestra.apps.dns.zones.tests.functional_tests.tests.RESTBind9MasterBackendTest) --

Re: Django ORM & DB backend coupling

2013-12-24 Thread Marc Aymerich
On Tue, Dec 24, 2013 at 4:15 PM, Rakan Alhneiti wrote: > Hello all, > > I was discussing the topic with a couple of my friends that Django's ORM is > / is not tightly coupled with databases in general. My point of view was > that django is not tightly coupled because you can write custom DB backen

Re: Django ORM & DB backend coupling

2013-12-24 Thread Marc Aymerich
On Tue, Dec 24, 2013 at 4:15 PM, Rakan Alhneiti wrote: > Hello all, > > I was discussing the topic with a couple of my friends that Django's ORM is > / is not tightly coupled with databases in general. My point of view was > that django is not tightly coupled because you can write custom DB backen

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

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

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

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

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

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: 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&

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

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

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

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

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

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: 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,

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: settings and constants on a reusable app

2012-06-29 Thread Marc Aymerich
On Fri, Jun 29, 2012 at 11:08 AM, Thomas Rega wrote: > Am 28.06.12 17:30, schrieb Marc Aymerich: > >> Hi, >> I'm developing a reusable application and I'm having troubles with >> constant values on settings. >> >> Imagine that the reusable ap

settings and constants on a reusable app

2012-06-28 Thread Marc Aymerich
Hi, I'm developing a reusable application and I'm having troubles with constant values on settings. Imagine that the reusable application comes with the following settings.py # MY_APP/settings.py from django.conf import settings MY_CONSTANT = 'C1' MY_OTHER_CONSTANT = 'C2' MY_SETTING = getattr(se

Re: Use Django to implement my GUI!

2012-05-19 Thread Marc Aymerich
On Sat, May 19, 2012 at 8:01 PM, Eugène Ngontang wrote: > Hi Jani. > I don't know why you say > > " 3) Are you now trying to figure out how to plug in Django in "Adming > module/PC with GUI block"?" > > My admin module and the gui do not share anything. They are not on the same > pc. > Gui is for

Re: Process Related Object when Saving

2012-05-17 Thread Marc Aymerich
On Wed, May 16, 2012 at 7:15 AM, ghachey wrote: > Hi again; > > Looking at the source code I realised that form.save_m2m() must be > called. > > def save_related(self, request, form, formsets, change): > >        form.save_m2m() >        for formset in formsets: >            self.save_formset(requ

Re: Tools for extending the admin?

2012-05-01 Thread Marc Aymerich
On Tue, May 1, 2012 at 5:43 PM, Roy Smith wrote: > I'm working on a site which makes extensive use of admin, and we're starting > to look at extending/customizing it.  I am aware of django-admin-tools > and django-grappelli.  Are there other projects I should be looking at for > admin extension/cu

Re: kind of template introspection question.

2012-04-30 Thread Marc Aymerich
On Mon, Apr 30, 2012 at 4:22 PM, Marc Aymerich wrote: > Dear all, > > Each model of my application has an associated template. This template > should be rendered each time that their context changes. So this is an > example to clarify this cryptic explanation: > > clas

kind of template introspection question.

2012-04-30 Thread Marc Aymerich
Dear all, Each model of my application has an associated template. This template should be rendered each time that their context changes. So this is an example to clarify this cryptic explanation: class ModelA(models.Model): class ModelB(models.Model): a = models.ForeignKey(ModelA) c

[OT] Job offer for django developer

2012-04-05 Thread Marc Aymerich
We are an Spanish based organization looking for a Django developer for an European project related to commuinity networks (guifi.net, FunkFeuer and AWMN). The project is called CONFINE (http://confine-project.eu) and its goal is to create a testbed platform allowing researches to deploy their netw

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Marc Aymerich
On Sun, Apr 1, 2012 at 9:42 PM, Pedro Vasconcelos wrote: > Hello Marc! > > Thanks for replying. Unfortunately I cant realised how to get the current > value, change it and populate the form using a ModelForm. I've tried it > actually. > sure, you can do it on form __init__ method something like

Re: Preprocess data before showing it on Admin

2012-04-01 Thread Marc Aymerich
On Sun, Apr 1, 2012 at 9:25 PM, Pedro Vasconcelos wrote: > Hello! > > Anyone knows how preprocess data before showing it on Admin (change page)? > >  __      __      ___ > /      \    /              \    /       \ > |  DB  | -> | PREPROCESSOR | -> | ADMIN | > \__/    \_

Re: Report generation-reportlab

2012-03-31 Thread Marc Aymerich
On Sat, Mar 31, 2012 at 12:38 PM, Ganesh Kumar wrote: > Hi guys, > > I am new to django reportlab. I want to generate pdf. file to select > mysql (table) content. How to proceed with reportlab, I can do with > some other tool. > please guide me. your valuable suggestion. > I'll use pisa, it allow

OT: just posting at djangojobs when suddenly...

2012-03-30 Thread Marc Aymerich
... something familiar comes up :) http://s18.postimage.org/j9dc6ufa1/Screenshot_5.png -- 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: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:47 AM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman > wrote: >> On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >>> >>> Hi!, >>> I've overrided the save() method of one of my ModelF

Re: Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 7:40 PM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 6:28 PM, Marc Aymerich wrote: >> Hi guys, >> I have an application that execute some tasks after an object is >> modifyed through django admin interface. In order to do that

Re: Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 6:28 PM, Marc Aymerich wrote: > Hi guys, > I have an application that execute some tasks after an object is > modifyed through django admin interface. In order to do that I'm > subscribed to django.contrib.admin.models.EntryLog post_save signal > a

Best approach to execute tasks inside django admin views

2012-03-29 Thread Marc Aymerich
Hi guys, I have an application that execute some tasks after an object is modifyed through django admin interface. In order to do that I'm subscribed to django.contrib.admin.models.EntryLog post_save signal and for each signal I execute a celery task. As you migh know django admin views are runnin

Re: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:47 AM, Marc Aymerich wrote: > On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman > wrote: >> On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >>> >>> Hi!, >>> I've overrided the save() method of one of my ModelF

Re: strange problem deleting objects

2012-03-29 Thread Marc Aymerich
On Thu, Mar 29, 2012 at 11:15 AM, Daniel Roseman wrote: > On Thursday, 29 March 2012 00:06:29 UTC+1, Marc Aymerich wrote: >> >> Hi!, >> I've overrided the save() method of one of my ModelForms and I'm >> performing a delete of some related objects dependi

strange problem deleting objects

2012-03-28 Thread Marc Aymerich
Hi!, I've overrided the save() method of one of my ModelForms and I'm performing a delete of some related objects depending on some form fields values. The thing is I'm getting differents behaviours dependening on how the deletion is performed, consider: 1) self.instance.delete() 2) MyModel.object

reverse urls on admin

2012-03-23 Thread Marc Aymerich
Hi, I've overrided the get_urls() of one of my ModelAdmin in order to provide some extra views. what I did is: def get_urls(self): """Returns the additional urls used by the Contact admin.""" select_urls = patterns("", url("^contract_pack/(?P\d+)/", inc

Re: filtered admin change-list

2012-03-23 Thread Marc Aymerich
On Sun, Mar 18, 2012 at 12:07 AM, omerd wrote: > Hi, > > I want to be able to show parts of the change list, by the user that > view it. > The case is that every super-user can create instances of a certain > model. I wan't that in the change-list page of that model in the admin > site, every user

Re: A little InlineModelAdmin help please?

2012-03-15 Thread Marc Aymerich
On Thu, Mar 15, 2012 at 9:32 PM, Jeff Blaine wrote: > Easier for me to just draw you a picture: > >            ++ >            |   noodle               | >            ++ >                 |             | >                 |             | >          

Know all signals available within a project

2012-03-10 Thread Marc Aymerich
Hi!, Any idea about how can I get a list of all available signals? -- 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, send email to djang

Re: Why on_delete attribute is not available on GenericForeignKey?

2012-03-07 Thread Marc Aymerich
On Wed, Mar 7, 2012 at 9:13 PM, akaariai wrote: > I believe the reason is efficiency. If there were an on_delete > argument for GFKs every object deletion of any class would need to do > a query to check if there happens to be any GFK related objects. In > addition, Django can't guarantee foreign

Why on_delete attribute is not available on GenericForeignKey?

2012-03-07 Thread Marc Aymerich
The django docs says: Unlike ForeignKey, GenericForeignKey does not accept an on_delete argument to customize this behavior; if desired, you can avoid the cascade-deletion simply by not using GenericRelation, and alternate behavior can be provided via the pre_delete signal. Does anyone knows why?

Re: Keeping filters when adding in the admin interface

2012-03-02 Thread Marc Aymerich
On Fri, Mar 2, 2012 at 2:18 PM, Mauro Sánchez wrote: > El día 29 de febrero de 2012 19:04, Marc Aymerich > escribió: >> On Wed, Feb 29, 2012 at 10:55 PM, Marc Aymerich wrote: >>> On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote: >>>> Hello, if I have the f

Re: null field issue

2012-03-01 Thread Marc Aymerich
On Fri, Mar 2, 2012 at 12:15 AM, wrote: > Hi Marc, > >  if I remember correctly (can't check now), the documentation clearly states > that you should avoid using null=True on CharField unless you have a good > reason. Your example is a textbook reason why is it recommended - having two > disti

null field issue

2012-03-01 Thread Marc Aymerich
I have a model with a filed like name = models.CharField(max_length=255, blank=True, null=True) With Django admin I've created some instances of that model without filling name field. Now I'm querying that model with name__isnull=True and the filter doesn't return any single object!! acctually

Re: Keeping filters when adding in the admin interface

2012-02-29 Thread Marc Aymerich
On Wed, Feb 29, 2012 at 10:55 PM, Marc Aymerich wrote: > On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote: >> Hello, if I have the following Model: >> >> class A: >>    name >> >> class B: >>    name >>    a = models.ForeignKey(A) >

Re: Keeping filters when adding in the admin interface

2012-02-29 Thread Marc Aymerich
On Wed, Feb 29, 2012 at 8:22 PM, Mauro Sánchez wrote: > Hello, if I have the following Model: > > class A: >    name > > class B: >    name >    a = models.ForeignKey(A) > > class C: >    name >    b = models.ForeignKey(B) > > And let's suppose that in the Admin Site I have a Filter in the C list

Dynamic mixin pattern, what do you think?

2012-02-23 Thread Marc Aymerich
Hi, I'm developing a web hosting control panel and I've decided to split it into several reusable applications: (a) One subset of this reusable applications are those which implement the typical services of an ISP, such as: dns, web, mailing lists, databases, vps, and so on... (b) Then there are

Re: Creating a hospital erp (hospital management) in Django

2012-02-18 Thread Marc Aymerich
On Sat, Feb 18, 2012 at 2:52 PM, Saadat wrote: > Alec, I've tried including this css file everywhere, but it doesn't show up > anywhere. What exactly do i do with it to include this script on any page, > say index. i tried doing it through html as well as django. I don't know what > I'm doing w

Re: Need details re: deletion of a referenced model instance

2012-02-15 Thread Marc Aymerich
On Wed, Feb 15, 2012 at 12:37 AM, Marc Aymerich wrote: > On Tue, Feb 14, 2012 at 8:02 PM, Jeff Blaine wrote: >> Hi all, >> >> I'm having trouble detecting changes that happen to a M2M field behind the >> scenes: as a result of one of the *referenced objects being

Re: Need details re: deletion of a referenced model instance

2012-02-14 Thread Marc Aymerich
On Tue, Feb 14, 2012 at 8:02 PM, Jeff Blaine wrote: > Hi all, > > I'm having trouble detecting changes that happen to a M2M field behind the > scenes: as a result of one of the *referenced objects being deleted* > > I'm using Django 1.3.1 with PostgreSQL 8 > > Let's say we have the following simpl

Re: dynamic permissions

2012-02-05 Thread Marc Aymerich
On Sun, Feb 5, 2012 at 3:59 PM, Vittorino Parenti wrote: > i've a model with document'categories and a model with documents. i > want set permissions per categories: add invoices, download invoices > and so on (invoice is an example of category). > Thanks, > Vittorino > Did you mean on Django adm

Re: Filter admin inlines

2012-02-05 Thread Marc Aymerich
On Sun, Feb 5, 2012 at 1:43 PM, NENAD CIKIC wrote: > Hello, > I have three models > X > Lang > Y > where the purpose of Y is to provide X fields in other languages. > So I have Y as > Y > x foreignkey on X > lang ForeignKey on Lang > additionalfields... > > I have created the ModelAdmin for Lang.

Re: online transactions with python

2012-01-31 Thread Marc Aymerich
On Tue, Jan 31, 2012 at 5:43 AM, jj_Diego wrote: > Well... > > I'm form Perú and nowadays I'm working with my friends on a proyect > based on python... > > but our first difficulty its the online transactions using  credit > cards (visa, mastercard, diners club) in aweb store > > If anybody knows

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

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

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: 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: 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: 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: 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: 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: 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(

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

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

  1   2   3   >