tree structured data

2008-07-13 Thread MarC
or ForeignKey pointed to himself from the admin site. Any help will be very appreciated! Thanks in advance, MarC --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, s

Importing schema from xsd file

2010-05-10 Thread MarC
Hi, I'm relatively new to Django and I've seen that there is some work done to export a Django model to an XSD spec (http://bitbucket.org/ eegg/django-model-schemas/wiki/Home). Does anybody know any library to go the other way round (from XSD to Django)? Best MarC -- You received th

Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
/1.2/howto/custom-model-fields/#howto-custom-model-fields instructions? Can anybody share his or her experience on this? Thanks in advance! Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Re: Creating a new model field that includes two or more existing model fields (ie. xsd's complex type equivalent)

2010-05-19 Thread Marc
I have just come up myself with an easy way to implement it: Inheriting from a model class that includes these fields. However I don't like it at all aesthetically. Do I really have to do it like this? On May 19, 3:26 pm, Marc wrote: > Hi all, > I would like to make my code more

os.listdir() not returning unicode

2011-11-20 Thread Marc
Hello, I have an application that uses os.listdir(u'some path') that should return a list of unicode strings. This works fine as long as I use the manage.py runserver server. As soon as I deploy on Apache with mod_wsgi, I get the Caught UnicodeDecodeError while rendering: 'ascii' codec can't dec

Re: os.listdir() not returning unicode

2011-11-20 Thread Marc
OK I found a clue regarding that issue: print(sys.getfilesystemencoding()) at the console prompt produces 'UTF-8' whereas in the failing script ' ANSI_X3.4-1968'. I now understand why the conversion fails (in that case Python returns a byte string and this is not documented in Python doc). Is the

Re: os.listdir() not returning unicode

2011-11-22 Thread Marc
Thanks Tom for your post. I had read an interesting thread on that subject on groups.google.com/group/modwsgi/browse_thread/thread/ ac729cc408ca516b/ but could get any success trying to put some locale related environment variables in /usr/sbin/envvars. In fact the only required variable to return

save_model on django.contrib.auth.admin.UserAdmin not called by password change form

2011-11-30 Thread Marc
Hello, I would like to get control on the password change form of the admin site. I put the following code in the admin.py: class MyUserAdmin(UserAdmin): def save_model(self, request, obj, form, change): ... admin.site.unregister(User) admin.site.register(User, MyUserAdmin) The problem is t

How to intercept password change in admin module ?

2011-12-01 Thread Marc
Hello, I reformulate my previous question having not no answer. I would like to get control on the password change form of the admin site (let us say record some trace in another table). I put the following code in the admin.py: class MyUserAdmin(UserAdmin): def save_model(self, request, ob

Re: How to intercept password change in admin module ?

2011-12-01 Thread Marc
Thanks for your suggestion. Yes it is. Save_model is called when I modify the User but not when I change the password using the dedicated form. -- 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@goo

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Marc
Thanks, i'll play with that and see what I can come up with. Docs are good, but sometimes really hard to read/find what you need :) On Fri, May 3, 2013 at 7:46 AM, Shawn Milochik wrote: > > https://docs.djangoproject.com/en/1.5/howto/custom-model-fields/#converting-database-values-to-python-obj

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Marc
So Tom: i can't use those methods Shawn pointed out? What I was hoping I can do is override the code that builds the SQL query. Further looking I think thats correct; as I did get a module working I found and played with which uses those methods and they don't seem to manipulate the query that is

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Marc
;,... would be very handy as then you could use all sorts of the powerful features in a DB. I get that it may then make the use of an ORM less "useful", but it sure would be easier than having to always due RAW sql calls on the object to get the same result. On Fri, May 3, 2013 at 8:37

Re: Admin module - modify SQL Query used for Edit and Save Models

2013-05-03 Thread Marc
ed at this stage. On 2013-05-03 9:50 AM, "Shawn Milochik" wrote: > On Fri, May 3, 2013 at 8:37 AM, Marc wrote: > > So Tom: i can't use those methods Shawn pointed out? What I was hoping I >> can do is override the code that builds the SQL query. >> Further lookin

Re: Django 1.7 - What are you most excited about?

2014-07-30 Thread marc
Hi, aggree in all points Russel, these features are also my favourite ones. - html email support in different places and the password reset mail template makes life much easier. Greetings, Marc Am Mittwoch, 30. Juli 2014 06:54:21 UTC+2 schrieb Russell Keith-Magee: > > Hi Ryan,

Re: update a field of a related table on form save

2014-07-30 Thread marc
Hi Brad, i would register a 'post_save' signal (https://docs.djangoproject.com/en/dev/ref/signals/#post-save) on the first model and then, just hit the save method on the Application model, this will automaticly update the time. Cheers, Marc Am Mittwoch, 30. Juli 2014 03:26:21 UTC

Re: Django package to convert Less to CSS

2014-07-30 Thread marc
Hi, are you using a virtualenv? Your lessc installation seems to point to a ruby one. (/Library/Ruby/Gems/2.0.0/gems/ less-2.4.0/bin/lessc) Be shure to have the correct path, try `which lessc` to see where it points to. Cheers Marc Am Mittwoch, 30. Juli 2014 04:08:47 UTC+2 schrieb Chen

Re: Unable to create migration with Error - One or more models did not validate:

2014-07-30 Thread marc
Hi, you've added a relation to the AssetPollingConfig model which is not defined. Cheers Am Mittwoch, 30. Juli 2014 13:34:52 UTC+2 schrieb Subodh Nijsure: > > Hello, > > I have following model definition and when I try to create a migration > using command, 'python manage.py schemamigration

Re: (ModelForm) confusion

2014-07-30 Thread marc
Hi, you are calling 'is_valid' in your view, which should be an method call: a_valid = aform.is_valid*()* m_valid = mform.is_valid*()* p_valid = pform.is_valid*()* There where a few hooks in your view, for example: you check for 'is_valid()' but there is no code to execute after. I've changed

Re: how to ride submit_line.html

2014-07-30 Thread marc
Hi, have a look there: http://stackoverflow.com/questions/8442724/django-admin-disable-editing-and-remove-save-butttons-for-a-specific-model Guess it is the right way to go. Cheers Am Mittwoch, 30. Juli 2014 13:32:18 UTC+2 schrieb Akshay Mukadam: > > How can we override the submit_line.html to

Re: internationalization (i18n)

2014-07-30 Thread marc
Hi, have a look at: http://www.i18nguy.com/unicode/language-identifiers.html The localization in django is based on region and language codes, some of them are the same (like 'de') and some split (like 'en-us'). For 'mr' you'll need to add the area code of india iirc. Cheers Am Mittwoch, 30.

Re: internationalization (i18n)

2014-07-30 Thread marc
Here's a list of locales in Django: https://github.com/django/django/tree/master/django/conf/locale Am Mittwoch, 30. Juli 2014 14:47:03 UTC+2 schrieb ma...@tubeards.com: > > Hi, > > have a look at: http://www.i18nguy.com/unicode/language-identifiers.html > > The localization in django is based on

Re: Static Files not Loading

2014-07-30 Thread marc
Hi, STATIC_PATH should be STATIC_ROOT. Cheers Am Mittwoch, 30. Juli 2014 17:10:17 UTC+2 schrieb Steven Williams: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi, > > I just asked around on IRC and no one was able to help me. Also the > entries on StackOverflow are not that helpful

building a xenserver web client

2014-07-31 Thread marc
Hi, is anyone interested in co-building a full featured web client for xenserver instances? Since version 6.2 the update procedures are really a pain which is one of my reasons to think about an (maintained) opensource client. Ideas are welcome. Cheers -- You received this message because yo

Re: building a xenserver web client

2014-07-31 Thread marc
Openstack is huge. I'll prefer a lightweight solution, maybe just HTML/CSS (if there is already a good Soap client for JS). But this should be compatible to most of the API features provided by xen. Am Donnerstag, 31. Juli 2014 17:39:53 UTC+2 schrieb cmawe...@gmail.com: > > You mentioned "full f

Re: django manage.py commands not displaying

2014-08-27 Thread marc
Can you please post the content of your manage.py? Cheers Am Dienstag, 26. August 2014 15:28:43 UTC+2 schrieb RSS: > > sorry my bad English > > i`m working on hosting > > project structure: > --myenv > --rsskg.ru > public_html > --virtaulenv-1.9 > > $ cd projects.ru/public_html > $ source ~/m

Re: HttpResponse methods difference

2014-08-28 Thread marc
As you see in: https://github.com/django/django/blob/master/django/http/response.py#L370 all three methods have different usecases. .write(string) <- adds content .tell() <- returns the length of content .flush() <- just passing, does nothing (since at lease v1.5) Cheers Am Donnerstag, 28. Aug

Re: django 1.7 Groups

2014-09-15 Thread marc
Hi, changing the base Group model is not very easy. My suggestion is to create a ManyToMany relation on your Company model. class Company(models.Model): groups = models.ManyToManyField("auth.Group") The design allows in theory many companies to have the same group, but this you c

Need something like the removed Q.add_to_query method

2014-10-16 Thread marc
uld return only rows which has both (or more) matching key-value pairs in *attributes*. I read that in 1.5 there was a possibility to override the Q() object to achieve this. Is there any other way without writing raw SQL? Thanks in advance, Marc -- You received this message because you are su

is it worth waiting to the 1.0 release?

2006-03-12 Thread MarC
runk/"; close enough to the final 1.0 version and safe/stable enough? Thank you very much, MarC PS: I'm a lindy hopper from Barcelona, so django means a lot for me XD great work! --~--~-~--~~~---~--~~ You received this message because you are s

Re: is it worth waiting to the 1.0 release?

2006-03-14 Thread MarC
James Bennett wrote: > On 3/12/06, MarC <[EMAIL PROTECTED]> wrote: > >>Is "svn co http://code.djangoproject.com/svn/django/trunk/"; close enough to >>the final 1.0 version >>and safe/stable enough? > > > It's safe enough for use, but the n

Dynamic creation of models

2018-02-06 Thread Marc
(1.11 and 2.02)? Thank you Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group,

Re: Dynamic creation of models

2018-02-06 Thread Marc
instead of trying to do what Django is not designed for and > doesn't support well with concepts like "dynamic models". > > We do similar thing with certain uploadable reports and it works pretty > fine. > > On 6.2.2018 13.35, Marc wrote: > > Hello >

Re: Dynamic creation of models

2018-02-06 Thread Marc
This is an interesting article against document databases, I am sure though that there are equally valid arguments for http://www.sarahmei.com/blog/2013/11/11/why-you-should-never-use-mongodb/ On Tuesday, February 6, 2018 at 1:14:41 PM UTC, Marc wrote: > > Thank you Jani, for taking the t

Problems with file upload and model forms

2008-11-20 Thread Marc Barranco
Hi! I'm trying to upload a file like the example in documentation in Django (http://docs.djangoproject.com/en/dev/topics/http/file- uploads/) with the "Forms from Models". But I can't upload the file because the form always return the error "this field is required" although selecting a file before

Re: Problems with file upload and model forms

2008-11-21 Thread Marc Barranco
Oh yeah!! It was that! Thank you veru much Alex :) I forgot to put the template code, Here it is (mayb useful for some other): --upload.html-- {% for field in form %} {{ field.label_tag }} {{ field }}

Re: Combine model form with a formset

2008-12-13 Thread Marc DM
If you want to edit them together in the admin then do this for your admin class # class BookInline(admin.TabularInline) model = Book extra = 2 class AuthorOptions(admin.ModelAdmin) inlines = [BookInline] admin.register(Author, AuthorOptions) #--

Re: request.FILES always empty

2009-01-05 Thread Marc Boivin
> > > > value="Submit" name="btn_submit" > > id="bnt_submit" /> > > > >

Re: I'm moving to Oxford

2009-01-14 Thread Marc Boivin
Glad you let the whole Django community know ;) On 09-01-14, at 08:52, "Will McGugan" wrote: > Hi, > > I'm sending this out to everyone in my gmail contacts, because I'm > lazy. Apologies if you don't need to know this. > > I'm moving to Oxford tomorrow (Thursday 15th). Please get in touch

How to timestamp with MySQL?

2009-01-15 Thread Marc Barranco
Hi there, I created a model with a date field in order to have a timestamp of when has been the last modification of the object. As in the basic tutorial I wrote my model as: data = models.DateTimeField () Wich should be in SQL: "data" timestamp with time zone NOT NULL (ref: http://docs.djan

Call for translations / translation reviews

2008-06-15 Thread Marc Fargas
nd read through the translation. Thanks, Marc Links: * http://code.djangoproject.com/ticket/6836 Vietnamese * http://code.djangoproject.com/ticket/7141 Estonian * http://code.djangoproject.com/ticket/7413 Hebrew update * http://code.djangoproject.com/ticket/7458 Lit

Re: tree structured data

2008-07-16 Thread Marc Vinyes
thanks Frantisek, Rusell and Oscar a lot for your tips! --~--~-~--~~~---~--~~ 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 thi

Re: OperationalError: (1054, "Unknown,column ' ...) for ForeignKey

2008-08-20 Thread Marc Vinyes
Thanks a lot for your help Malcom. Malcolm Tredinnick escribió, El 18/08/2008 0:03: > > On Sun, 2008-08-17 at 23:51 +0200, MarC wrote: >> Hi again, >> I'm still fighting against it and reading related posts in the mailing list >> archive with no >> succes

Re: Admin: design question

2008-09-13 Thread Marc Boivin
Keith Eberle wrote: >Maybe you can do something similar to what's in this post (using queryset): >http://groups.google.com/ > > > group/django-users/browse_thread/thread/c59b3807631d2914/a07cabfb4725447d?lnk=gst&q=restrict+users+to+their+own+data#a07cabfb4725447d It is valid, tested and working

constraint unique with models.Model

2009-12-27 Thread Marc Aymerich
omain = models.ForeignKey(virtual_domains) source = models.CharField(max_length=50) destination = models.CharField(max_length=60) I haven't any idea how to declare a unique constraint between 'source' and 'domain'. Any help¿¿ Thanks a lot! Marc -- You received this message because yo

Re: constraint unique with models.Model

2009-12-27 Thread Marc Aymerich
On Mon, Dec 28, 2009 at 5:15 AM, Karen Tracey wrote: > On Sun, Dec 27, 2009 at 11:08 PM, Marc Aymerich wrote: > >> hi guys! >> >> I'm writing my first project with django and I have doubts in how to >> declare a constraint unique for two fields of the same tabl

Mysql triggers with django

2009-12-28 Thread Marc Aymerich
Hello, Is possible to implement mysql triggers with django?? there are some documentation about it? 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-us...@googlegrou

Re: Mysql triggers with django

2009-12-28 Thread Marc Aymerich
ate) VALUES(@service,NEW.member_id,NEW.name,0,0,CURTIME(),CURTIME()); END IF; END; """ def create_trigger(app, created_models, verbosity, **kwargs): from django.db import connection cursor = connection.cursor() cursor.execute(sql) signals.post_syncdb.connect(create_trigge

Re: Mysql triggers with django

2009-12-28 Thread Marc Aymerich
On Tue, Dec 29, 2009 at 5:47 AM, Marc Aymerich wrote: > well, I found this one. > > http://www.eflorenzano.com/blog/post/database-triggers-arent-evil-and-they-actually-kin/ > > I've tried to implement something like that in mysql with my model bu

Creating a ISP control panel with Django.

2009-12-29 Thread Marc Aymerich
questions: -Is using this signal is the best way? If this signal fail (don't insert a row in orders table), is the default behaviour cancelling obj.save() function? or domain is saved anyway in the database? If that's the case,can the function that calls obj.save() know that the signal has f

overriding models.delete()

2010-01-01 Thread Marc Aymerich
on :( What am I doing wrong? Thanks in advance!! 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-us...@googlegroups.com. To unsubscribe from this group, send email to d

Re: overriding models.delete()

2010-01-01 Thread Marc Aymerich
On Sat, Jan 2, 2010 at 6:28 AM, Marc Aymerich wrote: > I'm overriding save() and delete() methods of the class models. The > override of the save() method works properly but unfortunately I'm in > troubles trying to override models.delete method. For example, I try to do

Re: Cannot reach development server in a rackspace cloud server

2010-01-04 Thread Marc Aymerich
On Mon, Jan 4, 2010 at 12:04 PM, simonecare...@gmail.com < simonecare...@gmail.com> wrote: > > python2.5 manage.py runserver 0.0.0.0:8000, but i can't point my web > > browser to that address. > > Of course I mean MY.IP.ADDRESS:8000. :) > > > > On Jan 4, 12:01 pm, "simonecare...@gmail.com" > wrot

Help with a query :$

2010-01-04 Thread Marc Aymerich
any idea in how can I get all users for a company? Thanks a lot! 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-us...@googlegroups.com. To unsubscribe from this group, send email to

Re: TypeError: 'CharField' object is not callable

2010-01-04 Thread Marc Aymerich
On Tue, Jan 5, 2010 at 5:24 AM, hakova wrote: > Hi all, > > I am a 'very' inexperienced django user with no programming > background, so please be gentle with me :). > > I just typed the following models.py file under my project_name/ > app_name: > > # -*- coding: utf-8 -*- > from django.db impo

Re: Help with a query :$

2010-01-04 Thread Marc Aymerich
On Tue, Jan 5, 2010 at 8:09 AM, greatlemer wrote: > On Jan 5, 4:00 am, Marc Aymerich wrote: > > Hi! > > I have a model like this: > > > > class company(models.model): > > name = models.CharField(mx_length=20) > > class employee(models.model): > > c

Re: newbie: mysql backend "Error was: cannot import name conversions" with subversion build of django

2010-01-05 Thread Marc Aymerich
On Tue, Jan 5, 2010 at 8:38 AM, harijay wrote: > Hi I just started using the subversion build of django and mysql- > python with python 2.6.3 > Both django (svn 12103) and _mysql (MySQLdb rev 635) work fine and can > be imported from the command line python without any error messages. > I created

newbie, how to load js in admin panel

2010-01-08 Thread Marc Aymerich
of combinations without any good result :( In all situations my browser can't find the js :(. Thanks a lot! And and excuse my English ;) Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to d

Re: newbie, how to load js in admin panel

2010-01-09 Thread Marc Aymerich
On Sat, Jan 9, 2010 at 6:37 AM, Marc Aymerich wrote: > Hi all! > > I'm trying to load this <http://www.djangosnippets.org/snippets/1492/> js > in one of the admin panel views. but seems that I'm unable to configure > django properly in order to be able media

Help with little complex queryset

2010-09-15 Thread Marc Aymerich
need it in a queryset version in order to use in a ModelForm like this: class VirtualHostForm(ModelForm): def __init__(self, user, *args, **kwargs): super(VirtualHostForm, self).__init__(*args, **kwargs) self.fields['ServerName'].queryset = """names&q

passing queryset filter as GET argument on Admin

2010-09-17 Thread Marc Aymerich
Many 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more opti

How to avoid nested references

2010-09-23 Thread Marc Aymerich
ey(service) user = models.ForeignKey(User) price = models.CharField(max_length=64) Thanks a lot. -- 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-us...@googlegroups.com.

Re: How to avoid nested references

2010-09-23 Thread Marc Aymerich
On Thu, Sep 23, 2010 at 7:37 PM, Daniel Roseman wrote: > On Sep 23, 6:26 pm, Marc Aymerich wrote: > > Hi > > I'm trying to define two clases, one of them is a relational class > between > > services and users, so it has two foreign keys, one to services and >

problem with saving a form

2010-09-26 Thread Marc Aymerich
r.es.forms import * from django.contrib.localflavor.es.es_provinces import PROVINCE_CHOICES class MemberForm(ModelForm): cifnif = ESIdentityCardNumberField() phone = ESPhoneNumberField() phone2 = ESPhoneNumberField() fax = ESPhoneNumberField() province = forms.ChoiceField(choices=PROVINCE

Re: problem with saving a form

2010-09-26 Thread Marc Aymerich
On Sun, Sep 26, 2010 at 8:51 PM, Marc Aymerich wrote: > I'm trying to make a ModelForm in order to edit an existing object of the > class 'member'. So I followed this documentation: > > > http://docs.djangoproject.com/en/dev/topics/forms/modelforms/#the-save-method

Re: problem with saving a form

2010-09-26 Thread Marc Aymerich
On Sun, Sep 26, 2010 at 10:34 PM, Karen Tracey wrote: > On Sun, Sep 26, 2010 at 4:15 PM, Marc Aymerich wrote: > >> It seems that the condition request.method == 'POST' is never true :( >> whyy?? > > > What does the template that contains the form look

Re: problem with saving a form

2010-09-26 Thread Marc Aymerich
On Sun, Sep 26, 2010 at 10:15 PM, Marc Aymerich wrote: > > > On Sun, Sep 26, 2010 at 8:51 PM, Marc Aymerich wrote: > >> I'm trying to make a ModelForm in order to edit an existing object of the >> class 'member'. So I followed this documentation: >&g

Re: possible model relations?

2010-10-08 Thread Marc Aymerich
ght direction? > > in http://docs.djangoproject.com/en/dev/topics/forms/modelforms/ look for save_m2m() -- 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-us...@googlegroups.com. To

Re: Admin Many-to-Many on a regular Form?

2010-10-10 Thread Marc Aymerich
up and then edit which users are in the group > based on this widget. The catch for me is I need to do it through the > standard part of my site, not the admin interface. > +1 I'm also interested on this! > -- > Marc -- You received this message because you are subscribed to t

distinct doesn't work on admin actions¿?

2010-10-12 Thread Marc Aymerich
.all().values_list('entity', flat=True).distinct()) [] Here the output of selecting all order elements(4), the output is a little different from the same operation in shell :( [1L, 1L, 1L, 1L] What's happening here? Thanks! -- Marc -- You received this message because y

reverse url of admin list

2010-10-12 Thread Marc Aymerich
#x27; not found." % (lookup_view_s, args, kwargs)) NoReverseMatch: Reverse for 'invoice_invoice' with arguments '()' and keyword arguments '{}' not found. Any idea? -- Marc -- You received this message because you are subscribed to the Google Groups "Dj

Re: reverse url of admin list

2010-10-12 Thread Marc Aymerich
On Tue, Oct 12, 2010 at 7:46 PM, Sævar Öfjörð wrote: > It's called 'changelist' > > So you should call reverse('admin:invoice_invoice_changelist') > Wow Sævar, thank you very much! -- Marc -- You received this message because you are subscribed to the Go

Re: distinct doesn't work on admin actions¿?

2010-10-13 Thread Marc Aymerich
On Wed, Oct 13, 2010 at 3:57 AM, Karen Tracey wrote: > On Tue, Oct 12, 2010 at 6:31 AM, Marc Aymerich wrote: > >> I'm writing an action for the django admin site. My model looks like: >> >> class order(models.Model): >> entity = models.ForeignKey(entity

Re: Admin Many-to-Many on a regular Form?

2010-10-13 Thread Marc Aymerich
way to wrangle them into working. Thanks for sharing this Ak :) -- 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-us...@googlegroups.com. To unsubscribe from this group, send emai

Help with Manager.

2010-10-14 Thread Marc Aymerich
UB('cancel_date','register_date')).filter(diff__gt=period_threshold) or maybe django provides another kind of tool to achieve what i want ? I'll appreciate any kind of orientation :) thanks!! -- Marc -- You received this message because you are subscribed to the Google G

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Jonathan Barratt > On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: > > Hi, > I'm trying to make a Manager for my model "order". I want that it returns > all orders that their 'active period'* is greater than a certain threshold. > With

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
2010/10/14 Marc Aymerich > > > 2010/10/14 Jonathan Barratt > >> On 14 ?.?. 2010, at 22:27, Marc Aymerich wrote: >> >> Hi, >> I'm trying to make a Manager for my model "order". I want that it returns >> all orders that their 'active

Re: Help with Manager.

2010-10-14 Thread Marc Aymerich
old" ,(threshold is a datetime.datetime object, and also 'register_date' field. Anyone knows the correct way to use instances of F() with date field? -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to thi

Re: Help with Manager.

2010-10-15 Thread Marc Aymerich
ine 168, in execute if not self._defer_warnings: self._warning_check() File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 82, in _warning_check warn(w[-1], self.Warning, 3) Warning: Truncated incorrect DOUBLE value: '3 0:0:0' It's only a warning, but I can&#

F() and timedelta. Bug on django?

2010-10-15 Thread Marc Aymerich
:0' On the parent thread http://groups.google.com/group/django-users/browse_thread/thread/5c6beb41fcf961a4 Alec reports that this works on their django installation. More over this pice of django code make use of it: http://code.djangoproject.com/attachment/ticket/10154/dateexpressions.d

Re: F() and timedelta. Bug on django?

2010-10-15 Thread Marc Aymerich
09:00:00, updated=2010-10-15 09:05:00 > mysql: select created - updated yiels 500 > > created=2010-10-15:09:59:00, updated=2010-10-15 10:04:00 > mysql: select created - updated yields 4500 -- Marc -- You received this message because you are subscribed to the Goo

Re: F() and timedelta. Bug on django?

2010-10-15 Thread Marc Aymerich
th this format: MMDDHHMMSS and now all works fine with mysql :) Unfortunately this part of code doesn't be database independent :( Thank you very much alec! -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post t

Re: F() and timedelta. Bug on django?

2010-10-15 Thread Marc Aymerich
On Fri, Oct 15, 2010 at 7:54 PM, Alec Shaner wrote: > On Fri, Oct 15, 2010 at 1:26 PM, Marc Aymerich > wrote: > > > > Instead of use datatime.timedelta I convert it to string with this > format: > > MMDDHHMMSS and now all works fine with mysql :) Unfortunat

Re: F() and timedelta. Bug on django?

2010-10-15 Thread Marc Aymerich
is patch will be merged to trunk soon, then use of F() instances will have a greater sense than now :) br -- 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-us...@googlegroups.com. To

Re: Admin "Bulk Edit"?

2010-10-18 Thread Marc Aymerich
s/ <http://docs.djangoproject.com/en/dev/ref/contrib/admin/actions/> -- 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-us...@googlegroups.com. To unsubscribe from this group, send email

Re: Efficient updates on ManyToMany Relations

2010-10-18 Thread Marc Aymerich
tions. > > Is there a more efficient way of adding the authors once for each > publication, using an iterator and a loop? > > For 1000 publication I would have a minimum of 1000 queries send to > the database. Is it posible to reduce this somehow? http://code.djangoproject.com/ticket

Re: Efficient updates on ManyToMany Relations

2010-10-18 Thread Marc Aymerich
On Mon, Oct 18, 2010 at 8:49 PM, Marc Aymerich wrote: > > > On Mon, Oct 18, 2010 at 6:31 PM, brix wrote: > >> Hello. >> >> Assume I have publications and authors. Like here: >> http://www.djangoproject.com/documentation/models/many_to_many/ >> >>

How django admin knows about related objects on delete?

2010-10-19 Thread Marc Aymerich
another approach more 'elegant' in order to achieve this? 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-us...@googlegroups.com. To unsubscribe from this group, s

Re: How django admin knows about related objects on delete?

2010-10-19 Thread Marc Aymerich
ery much for sharing this !! br Marc -- 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-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...

Re: help with model definition

2010-10-27 Thread Marc Aymerich
g like this? class Base(models.Model): pass class Project(Base): pass class Company(Base): pass class Task(models.Model): base = models.ForeignKey(Base) -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Executing ssh scripts with django

2010-10-31 Thread Marc Aymerich
e some unexpected behavior? I need some "expert" opinion here :) Would you affront this situation in a similar way or would you take a completely different approach? Many thanks!! [1] http://www.quora.com/How-can-I-remotely-execute-a-script-via-SSH-from-a-Django-view -- Marc -

Strange Validation Error

2010-06-06 Thread Marc Serra
Hi, i'm new on Django, and i'm getting a validation error that i don't undestand. Here my models: # -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User from datetime import datetime # Create your models here. class Categoria(models.Model): nom = mod

Re: Executing ssh scripts with django

2010-11-01 Thread Marc Aymerich
servers. In my organization we have only one web server, one DB server and one primary mail server. Does the use of CM make sense on my scenario somehow? Thanks! marc. On Mon, Nov 1, 2010 at 9:29 AM, Knut Ivar Nesheim wrote: > Hi, > > I would strongly suggest looking into using Celery or some

Why my model doesn't get saved?

2010-11-03 Thread Marc Aymerich
save an object into the db when I inherit from multiple class and one of them doesn't call the super save function? Many Thanks! -- Marc -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email t

Re: Why my model doesn't get saved?

2010-11-04 Thread Marc Aymerich
= True def save(self, *args, **kwargs): print "Inside save method!!!" class BaseA(BaseAA): class Meta: abstract = True def save(self, *args, **kwargs): super(BaseA, self).save(*args, **kwargs) print "Inside save method!!!" is trigged, so Ba

Re: Why my model doesn't get saved?

2010-11-04 Thread Marc Aymerich
2010/11/4 Łukasz Rekucki > > On 3 November 2010 22:17, Marc Aymerich wrote: > > Hi, > > I have 2 abstract classes with an overrided save function, class BaseA and > > class BaseB. BaseA trigger the models.Model save function, the other > > doesn't. > >

Re: Why INSERT instead of UPDATE?

2010-11-07 Thread Marc Aymerich
quot;editcourse.html", {'form':form}) > > What do I wrong? Can you paste your course model? -- 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-us...@googlegroups.com.

Re: Excessive tmp table creation for mysql

2010-11-09 Thread Marc Aymerich
go code where this conditions are met or you can just can increase the tmp_table_size and max_heap_table_size thresholds on mysql server. :) [1] http://dev.mysql.com/doc/refman/5.1/en/internal-temporary-tables.html br -- Marc -- You received this message because you are subscribed to the Google Groups &qu

Re: bash: django-admin.py: command not found

2010-11-15 Thread Marc Aymerich
is. In what directory you have installed django? You can solve this problem by making a symbolic link like this: ln -s "$DJANGO-INSTALLED-PATH"/django/bin/django-admin.py /usr/bin/ -- Marc -- You received this message because you are subscribed to the Google Groups "Django users&

  1   2   3   4   >