Re: Multi-table inheritance with parent that can be null?

2008-06-29 Thread zenx
Ok. Everything clear then! Thank you! On 29 jun, 12:36, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote: > On Sun, 2008-06-29 at 02:55 -0700, zenx wrote: > > Can you make a model that inherits from another model with multi-table > > inheritance and that can have a null

Multi-table inheritance with parent that can be null?

2008-06-29 Thread zenx
Can you make a model that inherits from another model with multi-table inheritance and that can have a null parent? Or should do that always with OneToOneFIeld(null=True) ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google

Re: url template tag problem

2007-07-30 Thread zenx
<[EMAIL PROTECTED]> wrote: > On Mon, 2007-07-30 at 19:28 +0000, zenx wrote: > > Hi, > > > I get the following error when trying to use the {% url %} > > templatetag. I have read the documentation several times but cannot > > understand where is the problem: > &g

url template tag problem

2007-07-30 Thread zenx
Hi, I get the following error when trying to use the {% url %} templatetag. I have read the documentation several times but cannot understand where is the problem: AttributeError at /c/albums/wonderful-world/ 'str' object has no attribute 'callback' My urls.py: urlpatterns = patterns('',

accessing request attributes in templatetags?

2007-07-26 Thread zenx
I know you can access request attributes in views, but how to access for example request.user or request.META['REMOTE_ADDR'] in templatetags? I have tried it several ways but really don't know how to do it. Thank you! --~--~-~--~~~---~--~~ You received this

Re: saving many2many relations

2007-07-17 Thread zenx
Thank you Rajesh, I didn't knew that. I will try your solution. Thanks! On 11 jul, 23:16, RajeshD <[EMAIL PROTECTED]> wrote: > Hi, > > > Anyone knows where the problem is? > > If you are using the Admin app to populate tags then the automatic > manipulators first call Receta.save() followed

saving many2many relations

2007-07-10 Thread zenx
Hi, I would like to get a list of tags separated by a comma and be able to save them as related objects for the current object. Currently I have this code. When saving a Receta object it creates the tags objects if they doesn't exist yet and it should save the relations between Tags and Receta,

Re: User profile views - Does something like this make sense?

2007-06-18 Thread zenx
Thank you Gábor! I will make "clear_old" a static method. thanks!!! On 18 jun, 15:27, Gábor Farkas <[EMAIL PROTECTED]> wrote: > zenx wrote: > > I want to show the user the latest users that have seen his profile. > > So everytime a logged user views anot

User profile views - Does something like this make sense?

2007-06-17 Thread zenx
I want to show the user the latest users that have seen his profile. So everytime a logged user views another user's profile a ProfieView object is stored in the database (or the date is updated if the user that is viewing the profile has already viewed it before). I know this can make the

Re: admin filter change_list rows

2007-03-01 Thread zenx
e tric (based on the superduperguruLukeplant great hack) > 4) wait for the new Admin Class (maybe 0.96 will come soon) > > Bye > Picio > > 2007/3/1, zenx <[EMAIL PROTECTED]>: > > > > > Hi, > > > How could I filter the results of my ad

admin filter change_list rows

2007-02-28 Thread zenx
Hi, How could I filter the results of my admin change_list page. I know I can extend the change_list template but that doesn't allow me to filter the results. Is there some easy way to do that? thank you --~--~-~--~~~---~--~~ You received this message because

Django slows file uploads?

2007-02-04 Thread zenx
I have become a little bit disappointed while reading this: http://programming.reddit.com/info/ngua/comments "I have tested numerous files, and an excel file which takes 5 seconds to upload in Rails or another Python framework (like Pylons), will take over 20 seconds to upload in Django, mainly

Re: Generic relations in admin proposal

2006-12-19 Thread zenx
It's not my code, just took a look at it and found it useful. Thank you for looking at it! zenx --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Generic relations in admin proposal

2006-12-18 Thread zenx
Hi, After finding a good solution for generic relations in admin: http://net-x.org/weblog/2006/nov/29/django-generic-relations-made-easier/ I think that it should be implemented in the admin app of the django development version. What do you think about it? Want django developers to take the

Re: GenericForeignKey

2006-12-18 Thread zenx
Now it is!! http://net-x.org/media/GenericRelation-0.1.zip Rob Slotboom ha escrito: > > paulh, take a look at > > thishttp://net-x.org/weblog/2006/nov/29/django-generic-relations-made-eas... > > Hi Antoni, > > Seems interesting but the code isn't yet available I suppose... > > Rob

Re: GenericForeignKey

2006-12-15 Thread zenx
paulh, take a look at this http://net-x.org/weblog/2006/nov/29/django-generic-relations-made-easier/ --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to

Saving info about viewed tags

2006-12-04 Thread zenx
Hi, I have an Objects Model and a Tags Model with a M2M relationship between them. I want to update info about the tags of the object visited by the user updating it everytime the user requests an Object. Is it a crazy idea? I want to know wich tags are the most viewed by the user and wich are

Re: Generating slug for words with accents

2006-11-16 Thread zenx
Spanish info: á é í ó úshould be a e i o u ü should be u ñ should be n I think that's everything in spanish ;) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

stats for object views

2006-11-01 Thread zenx
Hi, I have created a stats field (PositiveIntegerField) in my objects and I want to use it for saving how many times the object has been showed to visitors but I don't want to make a database request everytime an object is viewed due to performance issues. I have seen

generic views serialization support (json, xml, etc.)

2006-10-23 Thread zenx
Hi, are there any plans to add serialization support to generic views? I think it won't be difficult to implement it because generic views are already programmed and they should only get one extra parameter to know which type of document they have to return (html (default), xml, json). It's just

Re: Django color picker -- ColorField?

2006-10-20 Thread zenx
It would be cool if the javascript widget also displayed the hexadecimal color (like #FF) calculating it real time from the RGB selected color. It will be also interesting if people could get the RGB, hex, etc. color by different methods (not only rgb).

Re: getting max and min

2006-10-20 Thread zenx
thank you all! I will do it with raw SQL . thanks for the code. I hope SQLAlchemy will be implemented soon in django. thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Django Hosting

2006-10-20 Thread zenx
It's not UK based but I have hosted some projects in hub-hub.com and I am satisfied with them. It's not super cheap but I think it's ok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post

Re: getting max and min

2006-10-19 Thread zenx
hi, just tried this but doesn't work: q = ArtistaTag.objects.all() nums=[''] for tag in q: num = tag.artista_set.count() nums.append(num) max_art = max(nums) min_art = min(nums) i get a TypeError unsupported operand type(s) for -: 'str' and 'long' :(

getting max and min

2006-10-19 Thread zenx
I want to get the maximum and the minimum values of various numbers. Is the following method the best way to do it? for tag in q: num = tag.artista_set.count() if num_ant: if num < num_ant: min_art = num else:

Re: templatetags: returning more information of every object in a list of objects (not only the objects)

2006-10-19 Thread zenx
thanks! just tried that way and everythings works. Thank you, Malcolm! --~--~-~--~~~---~--~~ 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

templatetags: returning more information of every object in a list of objects (not only the objects)

2006-10-19 Thread zenx
Hi, I have a templatetag that returns a lists of objects. The problem is I want to include another information for every object: I want to include the number of related objects for every object of a ManyToMany relationship. The model ArtistaTag has a ManyToMany relationship with Artistas. So I

file extension validator

2006-10-10 Thread zenx
Hi, I want to make a filefield that only allows to upload mp3 files. I have added the following code to my model: def _manipulator_validate_filefield(self,field_data,all_data): if not self.archivo.endswith(".mp3"): raise validators.ValidationError, 'Please select an mp3

Re: urls and generic views with 2 slugfields

2006-10-02 Thread zenx
I will take a look at it. Thank you! --~--~-~--~~~---~--~~ 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

urls and generic views with 2 slugfields

2006-10-02 Thread zenx
Hi, I've got 3 models: Artist, Album and Song. For getting an artist info I use: (r'^artists/(?P[-\w]+)/$', 'django.views.generic.list_detail.object_detail', dict(info_dict, slug_field='identificador')), I want an url like www.mysite.com/artists/black_eye_peas/albums/album_name for getting

Re: Project level template tags?

2006-09-30 Thread zenx
OK. Thank you! --~--~-~--~~~---~--~~ 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 [EMAIL

Project level template tags?

2006-09-28 Thread zenx
Hi, I was wondering if it was possible to create project level template tags that can be called by any app template. Thank you! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Easy thumbs in your models

2006-09-27 Thread zenx
you're right, that's better. thank you!!! --~--~-~--~~~---~--~~ 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: Easy thumbs in your models

2006-09-27 Thread zenx
In delete function use: super(MyClass, self).delete() instead of super(Artista, self).delete(). I think everything else is ok. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Easy thumbs in your models

2006-09-27 Thread zenx
I needed to make this and I hope it helps some people there. Features: - Generate thumbs from ImageFields when creating the models (file.jpg -> thumbnail saved as: file.thumbnail.jpg) - Showing thumbs in admin - Deleting thumbs when deleting the object In your models.py:

Re: SlugField is not unique?

2006-09-27 Thread zenx
Hi Gábor, I think it's just for making it more flexibile, but in the most cases you will use unique=True in your SlugFields. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this

Re: Error always when deleting objects with ManyToMany (self) relationships

2006-09-26 Thread zenx
Nop, still doesn't work with filter_interface=models.HORIZONTAL. But it worked a couple of times. I will take a further look at it. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to

Re: Error always when deleting objects with ManyToMany (self) relationships

2006-09-26 Thread zenx
Hi Malcom, I have played a little around it and it seems to work ok adding filter_interface=models.HORIZONTAL to the Field. Here is the ticket I've created: http://code.djangoproject.com/ticket/2828#preview Thanks. --~--~-~--~~~---~--~~ You received this

Error always when deleting objects with ManyToMany (self) relationships

2006-09-25 Thread zenx
Hi, I get always the following error when deleting objects with ManyToMany(self) relationships in the admin. Have tried with different models and always getting the same error. Doesn't the admin interface support ManyToMany relationships with the same table? TypeError at

error when deleting model with ManyToManyField

2006-09-25 Thread zenx
TypeError at /admin/artistas/artista/asdf/delete/ getattr(): attribute name must be string this is the many to many field. when I delete it from the model everything works well but when that field is in the model i get the type error. artistas_relacionados =

Cannot have multiple projects running

2006-09-17 Thread zenx
Hi! I've set up django on dreamhost as seen here (http://www2.jeffcroft.com/2006/may/11/django-dreamhost/). Everything works ok with one project, but when I create another project and add another sub-domain for it following all the steps as shown on that site my browser doesn't load that

Re: Uploading.

2006-09-12 Thread zenx
thanks for the tutorial!!! I wil take a look at it :) --~--~-~--~~~---~--~~ 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

Re: Confirmation email during user registration?

2006-08-31 Thread zenx
Iwan, take a look at this too: http://feh.holsman.net/articles/2006/04/30/double-opt-in-user-registration-for-django http://feh.holsman.net/articles/2005/11/20/user-registration Instead of requiring a verification e-mail, it firsts sends the user an e-mail that includes a link for continuing the

admin and dates...

2006-08-31 Thread zenx
Lets see if someone has already dealt with this problem and can help me: I want to administer appointments in admin. I have two classes: === class Client(models.Model): name = models.CharField(maxlength=30) company = models.CharField(maxlength=50) class

Re: Django Books

2006-08-31 Thread zenx
voted too! ;) --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED]

Re: AJAXWidgetComboBox in admin?

2006-08-31 Thread zenx
thank you!!! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED]

Re: Django Books

2006-08-31 Thread zenx
Picio, sorry for the misunderstanding! You will find the links that Jeremy has posted very useful :D (PS: I'm from Spain) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: Django Books

2006-08-30 Thread zenx
Hi Picio, I don't know when it will be published, but a book is coming: http://www.amazon.com/gp/product/1590597257 It is written by Adrian Holovaty and Jacob Kaplan-Moss (django developers) and as far as I know it will be also avaible for free download as PDF :D

Re: Django Books

2006-08-30 Thread zenx
And you can find the starting tutorial you are asking for here: http://www.djangoproject.com/documentation/ take a look at "installation guide" and "Tutorial: Writing your first Django app" --~--~-~--~~~---~--~~ You received this message because you are

Re: AJAXWidgetComboBox in admin?

2006-08-30 Thread zenx
Thanks Matthew!!! I'm anxious to look at the code :D --~--~-~--~~~---~--~~ 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

AJAXWidgetComboBox in admin?

2006-08-29 Thread zenx
Just wanted to know if there are any implementations of the AJAXWidgetComboBox for the ForeignKey relationship inputs in the admin forms (instead of using raw_id_admin=True) http://code.djangoproject.com/wiki/AJAXWidgetComboBox Thank you! --~--~-~--~~~---~--~~

Re: upload files to another server

2006-08-24 Thread zenx
Thank you both!!! That's very helpful! I will read the howto carefully ;) --~--~-~--~~~---~--~~ 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

Re: my private django repository goes public

2006-08-24 Thread zenx
Thank you!!! --~--~-~--~~~---~--~~ 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 [EMAIL PROTECTED]

Re: upload files to another server

2006-08-24 Thread zenx
Thank you Jacob! If anybody can point me to any link about setting up NFS with Django I would be grateful. Thanks!!! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group,

Re: upload files to another server

2006-08-23 Thread zenx
Thank you! I will take a look at it. --~--~-~--~~~---~--~~ 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

upload files to another server

2006-08-23 Thread zenx
I was reading some django performance tips: http://www.jacobian.org/writing/2005/dec/12/django-performance-tips/ One of them is: "Use a separate media server" But how could I upload files with Django FileField or ImageField to another webserver than the one using django?

HTTPS access

2006-08-23 Thread zenx
"Ruby has different libraries that provide higher-level access to network protocols such as FTP, HTTP or HTTPS. This article shows the usage of net::http, net::https, open-uri and the rio library." (http://www.juretta.com/log/2006/08/13/ruby_net_http_and_open-uri/) I would like django to connect