Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
ok, thanks everyone

2011/3/31 Łukasz Rekucki :
> On 31 March 2011 18:50, Lic. José M. Rodriguez Bacallao
>  wrote:
>> well, I don't know if this is ok, but I solved the problem adding a
>> name='help_subject' tu the urlconf line
>
> Sorry, I couldn't answer earlier, but yes - that is exactly what you
> should do. Class-based views can't be referenced by using dot
> notation, so you must name them and reverse them by name.
>
> Django expects a string in form of ".". A
> class-based view is not a module, so it has no chance of success. Even
> if it somehow was able to get the as_view method from the class, there
> is no way to tell to which URL it was bound (look at how as_view()
> works for more details).
>
> Naming all your URLs is a good practice anyway.
>
> --
> Łukasz Rekucki
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
well, I don't know if this is ok, but I solved the problem adding a
name='help_subject' tu the urlconf line

On Thu, Mar 31, 2011 at 12:37 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> sorry, I have atypo in the previous code, this is the las line:
>
> (r'(?P[0-9A-Za-z-]+)', HelpSubject.as_view()),
>
> On Thu, Mar 31, 2011 at 12:36 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> I am getting a this error:
>> TemplateSyntaxError at /help/
>>
>> Caught NoReverseMatch while rendering: Reverse for
>> 'apps.help.views.HelpSubject.as_view()' with arguments '()' and
>> keyword arguments '{'slug': u'gdsgdgdg'}' not found.
>>
>> On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
>>  wrote:
>>> I mean url tag: {% url ... %}
>>>
>>> this is what I am using: Leer
>>> mas...
>>>
>>> directory structure:
>>>
>>> site
>>>  |--> url.py
>>>  |--> apps (included in the python path)
>>>        |--> help
>>>               |--> models.py
>>>               |--> views.py
>>>               |--> urls.py
>>>
>>> where:
>>> "apps" is a package (is in the python path)
>>> "help" is my application
>>> "HelpSubject" is a class based view, here is the definition:
>>>
>>>
>>> class HelpSubject(DetailView):
>>>    template_name = 'help/help_subject.html'
>>>    context_object_name = 'help_subject'
>>>    queryset = HelpSubject.objects.filter(published=True)
>>>
>>> and here is the two lines in url.py and apps/help/url.py
>>>
>>> url.py:
>>> (r'^help/', include('help.urls')),
>>>
>>> apps/help/url.py:
>>> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>>>
>>> 2011/3/31 Łukasz Rekucki :
>>>> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>>>>  wrote:
>>>>> use the tag:
>>>>> url
>>>>
>>>> What do you mean by that ? Do you mean the {% url %} template tag, or
>>>> the `url` function commonly used in urls.py module. Give us some
>>>> examples of what you want to achieve and what problems you have.
>>>> --
>>>> Łukasz Rekucki
>>>>
>>>> --
>>>> 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 
>>>> django-users+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at 
>>>> http://groups.google.com/group/django-users?hl=en.
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Lic. José M. Rodriguez Bacallao
>>> Centro de Biofisica Medica
>>> -
>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
>>> mismo.
>>>
>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>> por profesionales
>>> -
>>>
>>
>>
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
sorry, I have atypo in the previous code, this is the las line:

(r'(?P[0-9A-Za-z-]+)', HelpSubject.as_view()),

On Thu, Mar 31, 2011 at 12:36 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> I am getting a this error:
> TemplateSyntaxError at /help/
>
> Caught NoReverseMatch while rendering: Reverse for
> 'apps.help.views.HelpSubject.as_view()' with arguments '()' and
> keyword arguments '{'slug': u'gdsgdgdg'}' not found.
>
> On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> I mean url tag: {% url ... %}
>>
>> this is what I am using: Leer
>> mas...
>>
>> directory structure:
>>
>> site
>>  |--> url.py
>>  |--> apps (included in the python path)
>>        |--> help
>>               |--> models.py
>>               |--> views.py
>>               |--> urls.py
>>
>> where:
>> "apps" is a package (is in the python path)
>> "help" is my application
>> "HelpSubject" is a class based view, here is the definition:
>>
>>
>> class HelpSubject(DetailView):
>>    template_name = 'help/help_subject.html'
>>    context_object_name = 'help_subject'
>>    queryset = HelpSubject.objects.filter(published=True)
>>
>> and here is the two lines in url.py and apps/help/url.py
>>
>> url.py:
>> (r'^help/', include('help.urls')),
>>
>> apps/help/url.py:
>> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>>
>> 2011/3/31 Łukasz Rekucki :
>>> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>>>  wrote:
>>>> use the tag:
>>>> url
>>>
>>> What do you mean by that ? Do you mean the {% url %} template tag, or
>>> the `url` function commonly used in urls.py module. Give us some
>>> examples of what you want to achieve and what problems you have.
>>> --
>>> Łukasz Rekucki
>>>
>>> --
>>> 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 
>>> django-users+unsubscr...@googlegroups.com.
>>> For more options, visit this group at 
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>>
>>
>>
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -----
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
I am getting a this error:
TemplateSyntaxError at /help/

Caught NoReverseMatch while rendering: Reverse for
'apps.help.views.HelpSubject.as_view()' with arguments '()' and
keyword arguments '{'slug': u'gdsgdgdg'}' not found.

On Thu, Mar 31, 2011 at 12:33 PM, Lic. José M. Rodriguez Bacallao
 wrote:
> I mean url tag: {% url ... %}
>
> this is what I am using: Leer
> mas...
>
> directory structure:
>
> site
>  |--> url.py
>  |--> apps (included in the python path)
>        |--> help
>               |--> models.py
>               |--> views.py
>               |--> urls.py
>
> where:
> "apps" is a package (is in the python path)
> "help" is my application
> "HelpSubject" is a class based view, here is the definition:
>
>
> class HelpSubject(DetailView):
>    template_name = 'help/help_subject.html'
>    context_object_name = 'help_subject'
>    queryset = HelpSubject.objects.filter(published=True)
>
> and here is the two lines in url.py and apps/help/url.py
>
> url.py:
> (r'^help/', include('help.urls')),
>
> apps/help/url.py:
> (r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,
>
> 2011/3/31 Łukasz Rekucki :
>> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>>  wrote:
>>> use the tag:
>>> url
>>
>> What do you mean by that ? Do you mean the {% url %} template tag, or
>> the `url` function commonly used in urls.py module. Give us some
>> examples of what you want to achieve and what problems you have.
>> --
>> Łukasz Rekucki
>>
>> --
>> 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 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
I mean url tag: {% url ... %}

this is what I am using: Leer
mas...

directory structure:

site
  |--> url.py
  |--> apps (included in the python path)
|--> help
   |--> models.py
   |--> views.py
   |--> urls.py

where:
"apps" is a package (is in the python path)
"help" is my application
"HelpSubject" is a class based view, here is the definition:


class HelpSubject(DetailView):
template_name = 'help/help_subject.html'
context_object_name = 'help_subject'
queryset = HelpSubject.objects.filter(published=True)

and here is the two lines in url.py and apps/help/url.py

url.py:
(r'^help/', include('help.urls')),

apps/help/url.py:
(r'(?P[0-9A-Za-z-]+)', help.HelpSubject.as_view,

2011/3/31 Łukasz Rekucki :
> On 31 March 2011 17:16, Lic. José M. Rodriguez Bacallao
>  wrote:
>> use the tag:
>> url
>
> What do you mean by that ? Do you mean the {% url %} template tag, or
> the `url` function commonly used in urls.py module. Give us some
> examples of what you want to achieve and what problems you have.
> --
> Łukasz Rekucki
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



about url tag

2011-03-31 Thread Lic . José M . Rodriguez Bacallao
hi folks, I was using django 1.2.5 and generic views to some simple
things, now, I upgrade to django 1.3 and I am trying to use the tag:
url but it doesn't seems to work with django class based generic
views. How to use this tag correctly?

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Failed to build documentation (solved)

2011-03-24 Thread Lic . José M . Rodriguez Bacallao
so, no one?

On Thu, Mar 24, 2011 at 11:42 AM, Lic. José M. Rodriguez Bacallao
 wrote:
> hey, I am using ubuntu 10.10, do I really need to update Sphinx to
> build documentation?
>
> On Thu, Mar 10, 2011 at 3:51 AM, Thomas Guettler  wrote:
>> Hi,
>>
>> the problem is solved, this is just for other people who have the same error.
>>
>> When you try to build the documentation and get the following error:
>>
>>
>>  File "/home/user/_django-trunk/docs/_ext/djangodocs.py", line 86, in run
>>    xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, 
>> self.state)
>> AttributeError: 'module' object has no attribute 'XRefRole'
>>
>> You might be running an old version of Sphinx. Version 0.6 is not supported.
>>
>> You need to use the "-U" Option (update), to get the latest version:
>>
>> Example: easy_install -U --prefix=$HOME Sphinx
>>
>> Without -U easy_install copied the old version from /usr/lib into my home
>> directory.
>>
>>  HTH,
>>    Thomas Güttler
>>
>> --
>> Thomas Guettler, http://www.thomas-guettler.de/
>> E-Mail: guettli (*) thomas-guettler + de
>>
>> --
>> 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 
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
>
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> ---------
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Failed to build documentation (solved)

2011-03-24 Thread Lic . José M . Rodriguez Bacallao
hey, I am using ubuntu 10.10, do I really need to update Sphinx to
build documentation?

On Thu, Mar 10, 2011 at 3:51 AM, Thomas Guettler  wrote:
> Hi,
>
> the problem is solved, this is just for other people who have the same error.
>
> When you try to build the documentation and get the following error:
>
>
>  File "/home/user/_django-trunk/docs/_ext/djangodocs.py", line 86, in run
>    xrefs = roles.XRefRole()('doc', linktext, linktext, self.lineno, 
> self.state)
> AttributeError: 'module' object has no attribute 'XRefRole'
>
> You might be running an old version of Sphinx. Version 0.6 is not supported.
>
> You need to use the "-U" Option (update), to get the latest version:
>
> Example: easy_install -U --prefix=$HOME Sphinx
>
> Without -U easy_install copied the old version from /usr/lib into my home
> directory.
>
>  HTH,
>    Thomas Güttler
>
> --
> Thomas Guettler, http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de
>
> --
> 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 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



xml-rpc

2010-11-01 Thread Lic . José M . Rodriguez Bacallao
is possible tu run xml-rpc code from django_xmlrpc project through
django test server (python manage.py runserver)?

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about file uploading

2010-11-01 Thread Lic . José M . Rodriguez Bacallao
thanks, I was reading this url right now!!!

On Mon, Nov 1, 2010 at 2:49 PM, James  wrote:
> You can use webdav to help accomplish that goal.
>
> See: 
> http://stackoverflow.com/questions/492307/uploading-big-files-over-http/1499819#1499819
>
> (from the link Cal provided)
>
> -james
>
> On Mon, Nov 1, 2010 at 2:19 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> with webdav can I uploading a file, interrupt it the then resume the
>> upload again starting from an offset of the previously uploading file
>> ?
>>
>> On Mon, Nov 1, 2010 at 1:54 PM, James  wrote:
>>> WebDav will not work for you?
>>> -james
>>>
>>> On Mon, Nov 1, 2010 at 1:37 PM, Lic. José M. Rodriguez Bacallao
>>>  wrote:
>>>> yes, I saw that page but this is a complete application, I need
>>>> someting with source code for mimifiying in django
>>>>
>>>> On Mon, Nov 1, 2010 at 1:35 PM, Cal Leeming [Simplicity Media Ltd]
>>>>  wrote:
>>>>> Here, let me google that for you..
>>>>> http://www.radinks.com/upload/plus/resume.php
>>>>> http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=http+upload+resume
>>>>> Please make sure you make reasonable attempt to find the answer yourself 
>>>>> on
>>>>> Google, otherwise the boards get filled with copy pasta.
>>>>> On Mon, Nov 1, 2010 at 6:30 PM, Lic. José M. Rodriguez Bacallao
>>>>>  wrote:
>>>>>>
>>>>>> hi folks, I need to develop an application for uploading big files but
>>>>>> one requirement is that I must be able to resume a partially uploaded
>>>>>> file. How can I achieve this with django, any ideas?
>>>>>>
>>>>>> --
>>>>>> Lic. José M. Rodriguez Bacallao
>>>>>> Centro de Biofisica Medica
>>>>>> -
>>>>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
>>>>>> mismo.
>>>>>>
>>>>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>>>>> por profesionales
>>>>>> -
>>>>>>
>>>>>> --
>>>>>> 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 options, visit this group at
>>>>>> http://groups.google.com/group/django-users?hl=en.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Cal Leeming
>>>>>
>>>>> Operational Security & Support Team
>>>>>
>>>>> Out of Hours: +44 (07534) 971120 | Support
>>>>> Tickets: supp...@simplicitymedialtd.co.uk
>>>>> Fax: +44 (02476) 578987 | Email: cal.leem...@simplicitymedialtd.co.uk
>>>>> IM: AIM / ICQ / MSN / Skype (available upon request)
>>>>>
>>>>> Simplicity Media Ltd. All rights reserved.
>>>>> Registered company number 7143564
>>>>>
>>>>> --
>>>>> 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 options, visit this group at
>>>>> http://groups.google.com/group/django-users?hl=en.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Lic. José M. Rodriguez Bacallao
>>>> Centro de Biofisica Medica
>>>> -
>>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
>>>> mismo.
>>>>
>>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>>> por profesionales
>>>> -
>>>>
>

Re: about file uploading

2010-11-01 Thread Lic . José M . Rodriguez Bacallao
with webdav can I uploading a file, interrupt it the then resume the
upload again starting from an offset of the previously uploading file
?

On Mon, Nov 1, 2010 at 1:54 PM, James  wrote:
> WebDav will not work for you?
> -james
>
> On Mon, Nov 1, 2010 at 1:37 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>> yes, I saw that page but this is a complete application, I need
>> someting with source code for mimifiying in django
>>
>> On Mon, Nov 1, 2010 at 1:35 PM, Cal Leeming [Simplicity Media Ltd]
>>  wrote:
>>> Here, let me google that for you..
>>> http://www.radinks.com/upload/plus/resume.php
>>> http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=http+upload+resume
>>> Please make sure you make reasonable attempt to find the answer yourself on
>>> Google, otherwise the boards get filled with copy pasta.
>>> On Mon, Nov 1, 2010 at 6:30 PM, Lic. José M. Rodriguez Bacallao
>>>  wrote:
>>>>
>>>> hi folks, I need to develop an application for uploading big files but
>>>> one requirement is that I must be able to resume a partially uploaded
>>>> file. How can I achieve this with django, any ideas?
>>>>
>>>> --
>>>> Lic. José M. Rodriguez Bacallao
>>>> Centro de Biofisica Medica
>>>> -
>>>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
>>>> mismo.
>>>>
>>>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>>>> por profesionales
>>>> -
>>>>
>>>> --
>>>> 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 options, visit this group at
>>>> http://groups.google.com/group/django-users?hl=en.
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Cal Leeming
>>>
>>> Operational Security & Support Team
>>>
>>> Out of Hours: +44 (07534) 971120 | Support
>>> Tickets: supp...@simplicitymedialtd.co.uk
>>> Fax: +44 (02476) 578987 | Email: cal.leem...@simplicitymedialtd.co.uk
>>> IM: AIM / ICQ / MSN / Skype (available upon request)
>>>
>>> Simplicity Media Ltd. All rights reserved.
>>> Registered company number 7143564
>>>
>>> --
>>> 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 options, visit this group at
>>> http://groups.google.com/group/django-users?hl=en.
>>>
>>
>>
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>> --
>> 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 options, visit this group at 
>> http://groups.google.com/group/django-users?hl=en.
>>
>>
>
> --
> 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 options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
>
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: about file uploading

2010-11-01 Thread Lic . José M . Rodriguez Bacallao
yes, I saw that page but this is a complete application, I need
someting with source code for mimifiying in django

On Mon, Nov 1, 2010 at 1:35 PM, Cal Leeming [Simplicity Media Ltd]
 wrote:
> Here, let me google that for you..
> http://www.radinks.com/upload/plus/resume.php
> http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=http+upload+resume
> Please make sure you make reasonable attempt to find the answer yourself on
> Google, otherwise the boards get filled with copy pasta.
> On Mon, Nov 1, 2010 at 6:30 PM, Lic. José M. Rodriguez Bacallao
>  wrote:
>>
>> hi folks, I need to develop an application for uploading big files but
>> one requirement is that I must be able to resume a partially uploaded
>> file. How can I achieve this with django, any ideas?
>>
>> --
>> Lic. José M. Rodriguez Bacallao
>> Centro de Biofisica Medica
>> -
>> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
>> mismo.
>>
>> Recuerda: El arca de Noe fue construida por aficionados, el titanic
>> por profesionales
>> -
>>
>> --
>> 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 options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>
>
>
> --
>
> Cal Leeming
>
> Operational Security & Support Team
>
> Out of Hours: +44 (07534) 971120 | Support
> Tickets: supp...@simplicitymedialtd.co.uk
> Fax: +44 (02476) 578987 | Email: cal.leem...@simplicitymedialtd.co.uk
> IM: AIM / ICQ / MSN / Skype (available upon request)
>
> Simplicity Media Ltd. All rights reserved.
> Registered company number 7143564
>
> --
> 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 options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



about file uploading

2010-11-01 Thread Lic . José M . Rodriguez Bacallao
hi folks, I need to develop an application for uploading big files but
one requirement is that I must be able to resume a partially uploaded
file. How can I achieve this with django, any ideas?

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



about site price

2010-10-20 Thread Lic . José M . Rodriguez Bacallao
hi folks, I have a client that need to develop a bet site like this:
http://www.webapuestas.com/
the problem is that I am new in the business and I don't know how much
money can I ask for a
this work, can someone help me and take a look to the site and give me
an approximate cost for
a site like this?

PS: sorry for my English, it's not so good.

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

-- 
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 options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: webcam in a web page

2009-08-21 Thread Lic . José M . Rodriguez Bacallao

let's see those options!!!

On Fri, Aug 21, 2009 at 8:26 AM, Sid wrote:
>
> look at justin.tv as well. I think you can embed your live feed, onto
> a webpage.
>
> -Sid
>
>
> >
>



-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



webcam in a web page

2009-08-20 Thread Lic . José M . Rodriguez Bacallao

hi folks, I need to show a live web cam in my site, does anyone know
how to do that?

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about a web site

2009-07-30 Thread Lic . José M . Rodriguez Bacallao

second one, any advice?

On 7/17/09, Diego Eduardo Ahumada - SICO S.I. S.A.  wrote:
>
> 2009/7/17 Michael :
>> On Fri, Jul 17, 2009 at 1:30 PM, Lic. José M. Rodriguez Bacallao
>>  wrote:
>>>
>>> anyone?
>>>
>>>
>>> On 7/17/09, Lic. José M. Rodriguez Bacallao  wrote:
>>> > hi folks, it's be a long time without writing to the list but now I'm
>>> > back with a simple question, I need to know how much can cost to make
>>> > a site like this:
>>> >
>>> > --
>>> > Lic. José M. Rodriguez Bacallao
>>> > Centro de Biofisica Medica
>>> > -
>>> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
>>> > mismo.
>>> >
>>
>
> Hi! Why you ask? What's your plan? That someone build a site for you,
> or build it for someone and want to know how much you can earn?
>
> Diego
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about a web site

2009-07-17 Thread Lic . José M . Rodriguez Bacallao

anyone?


On 7/17/09, Lic. José M. Rodriguez Bacallao  wrote:
> hi folks, it's be a long time without writing to the list but now I'm
> back with a simple question, I need to know how much can cost to make
> a site like this:  www.juegon.com
>
> --
> Lic. José M. Rodriguez Bacallao
> Centro de Biofisica Medica
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic
> por profesionales
> -------------
>


-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about a web site

2009-07-17 Thread Lic . José M . Rodriguez Bacallao

hi folks, it's be a long time without writing to the list but now I'm
back with a simple question, I need to know how much can cost to make
a site like this:  www.juegon.com

-- 
Lic. José M. Rodriguez Bacallao
Centro de Biofisica Medica
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



resizing an image

2008-02-08 Thread Lic. José M. Rodriguez Bacallao
Hi folks, I know this question isn't from this group but I'll ask
anyway. I need to resize an image (thumbnail) based in the browser
width and height. I want to make my site browser resolution
independent. The only thing I can't get working is this. For example,
a page showing a news entry, the news entry had an image (thumbnail) I
want to display. With a browser resolution of 1000x740, this page
display ok but with a resolution of 780x560, it don't. What can I do?
Right now, I think resize the image based on its size with javascript
but I don't know how to get the image (an element in general) size. I
tried the "element.style.width" but it return an string which I can't
convert to an integer (500px for example, I just want 500). Any
sugestions?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about dpaste

2008-01-17 Thread Lic. José M. Rodriguez Bacallao
Hi folks, I need to know how can I search, explore for codes in
http://dpaste.com/
I really can't figure out how.

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about dbpaste

2008-01-17 Thread Lic. José M. Rodriguez Bacallao
Hi folks, I need to know how can I search, explore for codes in
http://dpaste.com/
I really can't figure out how.

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to create new variable in html file in template

2008-01-09 Thread Lic. José M. Rodriguez Bacallao
Peter is right, use the last snippet just if you feel the need.

On Jan 9, 2008 11:07 AM, Peter Rowell <[EMAIL PROTECTED]> wrote:
>
> On Jan 9, 12:20 am, Gaojiawang <[EMAIL PROTECTED]> wrote:
> > I want to use the local variable in template's html file.
> > like 'count = 0' and how to use it
> > How to do it?
>
> The snippet Jos� links to uses the resolve function of Django's
> templating system, which is good because it stays within the context
> created by the view and thus does not tempt a template writer to do
> arbitrary Python things in the middle of a template.
>
> However, there may be times when you want something a little more
> powerful.
>
> WARNING: If you think you need to use the following tag, think twice:
> it will probably cause you to embed knowledge about your models and/or
> business logic in your templates. This is a Bad Thing (tm).
>
> If you still feel the need, see http://www.djangosnippets.org/snippets/9/
> for arbitrary Python expressions assigned to a variable.
>
>
> >
>



-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to create new variable in html file in template

2008-01-09 Thread Lic. José M. Rodriguez Bacallao
I had just made a template tag to do exactly what you are looking for:
"assign a variable or make a variable in a template", here is the link
to see the code in djangosnippets:

http://www.djangosnippets.org/snippets/539/

I hope this will help.

On Jan 9, 2008 6:04 AM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Sorry, i'm in the habit of using tabs to indent code, so I pressed tab
> while editing that sinippet, then hit enter, which ended up sending
> the message.
>
> Anyways, you could som something like:
>
> {% for o in some_list %}
> 
>  {% cycle '/' '/' '/' '' %}
>  {% endfor %}
>
> That should print a newline for every 3 items, then print a newline
> character on the next item.
>
>
> [EMAIL PROTECTED] wrote:
> > You could use the "cycle" template tag (Documentation).
> >
> > If your separator for a single row was a slash, you could do something
> > like
> >
> > {% for o in some_list %}
> >
> > {% cycle '' 'row2' rowvar %}
> > ...
> > 
> > {% endfor %}
> >
>



-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



tags and related objects

2007-12-24 Thread Lic. José M. Rodriguez Bacallao
suppose I have a set of NewsEntry instances which all has tags. How
can I get for a NewsEntry instance all related NewsEntry objects based
on its tags in a feasible way?
I'm using tagging app from google code.

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about tagging app and tags cloud

2007-12-12 Thread Lic. José M. Rodriguez Bacallao
ok, it fix the problem of the font_size attr but the distribution of
values is too spaced. For example, if I got two tags: politics, linux.
the count for those tags are:
politics: 6
linux: 4

when it generate the font_size attr, for "politics" the size is 6 and
for "linux" the size is 0. It can't be posible.

On Dec 11, 2007 8:48 PM, Kellen <[EMAIL PROTECTED]> wrote:
>
> There's a bug:
> http://code.google.com/p/django-tagging/issues/detail?id=54
>
> For which there is a patch, which changes in tagging/utils.py:
> -thresholds = [math.pow(max_weight - min_weight + 1,
> float(i) / float(steps)) \
> +thresholds = [min_weight + math.pow(max_weight -
> min_weight, float(i) / float(steps)) \
>
> On Dec 11, 10:00 pm, "Lic. Jos� M. Rodriguez Bacallao"
> <[EMAIL PROTECTED]> wrote:
> > I'm controling the font size with CSS, that is not the problem, the
> > problem is with the code for tags cloud that it doesn't generate the
> > font_size attr for some tags.
> >
>
> > On Dec 11, 2007 3:44 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >
> >
> > > Just control the default font size with a little CSS? (presuming
> > > you're using this for [X]HTML output)
> >
> > > On Dec 11, 8:26 pm, "Lic. Jos� M. Rodriguez Bacallao"
> >
> > > <[EMAIL PROTECTED]> wrote:
> > > > hi folks, I need to generate a tags cloud for a model and I'm using
> > > > the tagging app from google code. I do something like this:
> >
> > > > cloud = Tag.objects.cloud_for_model(NewsEntry, 6)
> >
> > > > and generate the html cloud based in the "font_size" attr from the
> > > > tags list "cloud". The problem come when I realize that some of the
> > > > tags in that list (cloud) doesn't contain a "font_size" attr> I was
> > > > looking inside the code of the tagging app and I saw that when the
> > > > "count" attr of the tag is less than any of the values of threshold
> > > > list it doesn't add the "font_size" attr, so, how can I generate the
> > > > tags cloud?
> >
> > > > --
> > > > Lic. Jos� M. Rodriguez Bacallao
> > > > Cupet
> > > > -
> > > > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
> > > > mismo.
> >
> > > > Recuerda: El arca de Noe fue construida por aficionados, el titanic
> > > > por profesionales
> > > > -
> >
> > --
> > Lic. Jos� M. Rodriguez Bacallao
> > Cupet
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
> > mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic
> > por profesionales
> > -
> >
>



-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about tagging app and tags cloud

2007-12-11 Thread Lic. José M. Rodriguez Bacallao
I'm controling the font size with CSS, that is not the problem, the
problem is with the code for tags cloud that it doesn't generate the
font_size attr for some tags.

On Dec 11, 2007 3:44 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Just control the default font size with a little CSS? (presuming
> you're using this for [X]HTML output)
>
> On Dec 11, 8:26 pm, "Lic. Jos� M. Rodriguez Bacallao"
>
> <[EMAIL PROTECTED]> wrote:
> > hi folks, I need to generate a tags cloud for a model and I'm using
> > the tagging app from google code. I do something like this:
> >
> > cloud = Tag.objects.cloud_for_model(NewsEntry, 6)
> >
> > and generate the html cloud based in the "font_size" attr from the
> > tags list "cloud". The problem come when I realize that some of the
> > tags in that list (cloud) doesn't contain a "font_size" attr> I was
> > looking inside the code of the tagging app and I saw that when the
> > "count" attr of the tag is less than any of the values of threshold
> > list it doesn't add the "font_size" attr, so, how can I generate the
> > tags cloud?
> >
> > --
> > Lic. Jos� M. Rodriguez Bacallao
> > Cupet
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo 
> > mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic
> > por profesionales
> > -
> >
>



-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about tagging app and tags cloud

2007-12-11 Thread Lic. José M. Rodriguez Bacallao
hi folks, I need to generate a tags cloud for a model and I'm using
the tagging app from google code. I do something like this:

cloud = Tag.objects.cloud_for_model(NewsEntry, 6)

and generate the html cloud based in the "font_size" attr from the
tags list "cloud". The problem come when I realize that some of the
tags in that list (cloud) doesn't contain a "font_size" attr> I was
looking inside the code of the tagging app and I saw that when the
"count" attr of the tag is less than any of the values of threshold
list it doesn't add the "font_size" attr, so, how can I generate the
tags cloud?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Noob question: Which Linux distribution is "best" for Django?

2007-12-11 Thread Lic. José M. Rodriguez Bacallao
I will recommend Arch, is simple and powerful.

On Dec 11, 2007 1:22 PM, Joe <[EMAIL PROTECTED]> wrote:
>
> To make things easy, you could download VMware Server - run that on
> your windows box and install the prebuilt appliances. That'd make it
> easy to try out a few linux versions. VMware is free as are the
> appliances.
>
> I use ubuntu primarily.
>
> j
>
>
> On Dec 9, 9:57 am, Andreas Pfrengle <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > till now I've been experimenting with Django (development version)
> > under Win2k. But Windows sucks. So I dare to make my first steps with
> > Linux. Most of you will surely say I won't regret this decision ;-).
> > But since I haven't any experience with Linux yet, I want to choose a
> > distribution that is best suited for someone coming from the Windows-
> > world AND suited to establish a Django development environment. Well,
> > I'm not even sure if there will be any great difference between
> > several distributions regarding these aspects. Any comment is welcome.
> >
> > Regards,
> > Andreas
> >
>



-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about nesh.thumbnails

2007-12-05 Thread Lic. José M. Rodriguez Bacallao
hi folks, I'm using the django app "nesh.thumbnails" for my thumbnails
stuff and I got two problems:
1- how can I generate thumbnails for the admin interface using this
app, I try this approach:

def admin_thumbnail(self):
if self.image:
return '{%% load nesh.thumbnails %%} ' %
(self.get_image_url(),)
return ''
admin_thumbnail.short_description = 'Thumbnail'
admin_thumbnail.allow_tags = True

but it doesn't work, then I try this:

def admin_thumbnail(self):
from nesh.thumbnails import *
if self.image:
make_admin_thumbnails(self)
return '' % make_thumbnail(self.get_image_url(), 120)
admin_thumbnail.short_description = 'Thumbnail'
admin_thumbnail.allow_tags = True

it works but this approach got a little problem, when I remove the
object from the database, it doesn't delete the admin thumbnails.
because the way it rename the thumbnails when you set auto_rename =
True. It rename the thumbnails to --. but this is done in the pre_save signal so, when you are
going to save an object the first time, it doesn't have the primary
key number set yet and this had two implications:
1- If there is any object image in the path you are going to save this
image, this new image overwrite the old image.
2- due to the first immplication, if you delete and object with an
image, it will delete the image too, but this image is shared across
all objects added after the object being deleted. This is true for
objects of the same type (model).


2- Is there any way to add templates tags, filters or variables
dinamically to the templates of the admin interface, something like
this:

class TestModel(models.Model):
...
def do_something(self):
return '{{ "col name"|upper }}'
do_something.allow_tags = True
...
class Admin:
list_display = [...,'do_something'...]

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Workflow engine

2007-10-17 Thread Lic. José M. Rodriguez Bacallao
yes, something like that!!!

On 10/17/07, Tim Perrett <[EMAIL PROTECTED]> wrote:
>
>
> When you say 'workflow', do you mean like a JBPM type thing, but in
> python?
>
> Cheers
>
> TP
>
>
> On 17 Oct 2007, at 14:07, Lic. José M. Rodriguez Bacallao wrote:
>
> > hi folks, I need a workflow engine to use with a django web site
> > I'm implementing, does anyone know a good workflow engine for
> > python (or django)?
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Workflow engine

2007-10-17 Thread Lic. José M. Rodriguez Bacallao
hi folks, I need a workflow engine to use with a django web site I'm
implementing, does anyone know a good workflow engine for python (or
django)?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



test models

2007-10-01 Thread Lic. José M. Rodriguez Bacallao
hi everybody, I need to test how my models work outside the browser, with
unit tests but one of my models had an attribute "created_by" representing
the user who created it. Right now I'm using "ThreadLocals" middleware to
get the current user outside views but I don't know how can I test it in
other places other than the browser?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: change list in admin

2007-09-28 Thread Lic. José M. Rodriguez Bacallao
that was the first thing I did but, it didn't work. So, I had to add a
manager to the admin site this way:

class AnyModel(models.Model):
...
class Admin:
manager = CustomManager()

this is an undocumented way

On 9/27/07, jake elliott <[EMAIL PROTECTED]> wrote:
>
>
> hi jose
>
> Lic. José M. Rodriguez Bacallao wrote:
> > how can I limit items in "change list" of the admin interface?
>
> the admin will use your model's default manager (the first specified
> manager) to filter results.
>
> more information here:
>
> http://www.djangoproject.com/documentation/model-api/#modifying-initial-manager-querysets
>
> best,
> jake
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about auth

2007-09-27 Thread Lic. José M. Rodriguez Bacallao
I'll do that

On 9/27/07, Richard Dahl <[EMAIL PROTECTED]> wrote:
>
> There is a row-level-permissions branch, but I do not believe it is
> actively being developed at this time.  I wrote my own role-based permission
> system and integrated it into all of my models that require it.  I have not
> attempted to integrate the permission system into the admin interface
> though.  I have used my own views.  If you just want to limit access to one
> user (+ admin) this can be accomplished relatively easily by storing  the
> user who created the model instance as a FK on the model.  The threadlocal
> middleware can be used to integrate this into your save method of your
> models, if this is required.  You could then create a model.manager to
> filter based on the request.user, and a model method that can evaluate
> whether or not the current user is authorized to edit or delete an
> instance.  My advice would be to check the permissions before every action,
> i.e. check as you create a queryset, when getting an instance for editing,
> when the edited instance is submitted to be saved, when an instance is to be
> deleted, etc...
> If you have any specific questions, I would be more than happy to answer
> what I can.
> -richard
>
>
>
>
> On 9/27/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
> >
> > hi people, I got a little question, how can I make some users add news
> > (model News), modify only news owned by him or even delete his news, not
> > others users news, but only admins can publish all of them?
> >
> > --
> > Lic. José M. Rodriguez Bacallao
> > Cupet
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> > mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic por
> > profesionales
> > -
> >
> >
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: change list in admin

2007-09-27 Thread Lic. José M. Rodriguez Bacallao
I solve this problem adding a custom manager with get_query_set method
overridden to the admin interface. I don't know if this is the right way but
it solve my filtering problems in the change list. Any suggestions?

class AnyModel(models.Model):
...
class Admin:
manager = CustomManager()

On 9/27/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
>
> how can I limit items in "change list" of the admin interface?
>
> --
> Lic. José M. Rodriguez Bacallao
> Cupet
> -
> Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> mismo.
>
> Recuerda: El arca de Noe fue construida por aficionados, el titanic por
> profesionales
> -------------




-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



change list in admin

2007-09-27 Thread Lic. José M. Rodriguez Bacallao
how can I limit items in "change list" of the admin interface?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: about auth

2007-09-27 Thread Lic. José M. Rodriguez Bacallao
yes, I know I can do something like that but, how can I do it in the admin
interface?

On 9/27/07, Tim Chase <[EMAIL PROTECTED]> wrote:
>
>
> > hi people, I got a little question, how can I make some users add news
> > (model News), modify only news owned by him or even delete his news, not
> > others users news, but only admins can publish all of them?
>
> http://www.djangoproject.com/documentation/authentication/#permissions
>
> The stock admin doesn't offer functionality to prevent a user
> from mucking with stuff they don't own, but you can write a
> custom view to handle it for you.  Adding is distinct from
> modifying/deleting.  For adding, you check whatever your
> condition is; for editing/deleting, you have an object that needs
> to have information regarding who created it.
>
> ADD = 'add'
> SAVE = 'save'
> DELETE = 'delete'
>
> @login_required
> dev view_news(request, id=None):
>if request.POST:
>  action = request.requ.get('action', SAVE)
>  if action == ADD and resquest.user.is_staff:
># or whatever check you want... is_staff
># or has_perm('news.can_add')
>pass # add the item
>  else:
>item = get_object_or_404(News, id)
>if item.creator_id == request.user.id:
>  if action == SAVE:
>pass # do save here
>  elif action == DELETE:
>pass # do delete or delete-confirmation here
>  else:
>raise WhatYouTalkinBoutWillisException
>else:
>  return HttpResponseForbidden(
>"I'm sorry, Dave.  You can't do that")
>  return HttpResponseRedirect(wherever)
>else:
>  if id:
>item = get_object_or_404(News, id)
># show the form, populated with the item's data
>  else:
># show a blank form for them to add
>pass # do whatever you want here...
>
>
>
> -tim
>
>
>
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about auth

2007-09-27 Thread Lic. José M. Rodriguez Bacallao
hi people, I got a little question, how can I make some users add news
(model News), modify only news owned by him or even delete his news, not
others users news, but only admins can publish all of them?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: admin site and parent/child relationship

2007-08-31 Thread Lic. José M. Rodriguez Bacallao
podrias ser un poco mas explicito, entiendo vagamente tu idea, podrias
ponerme un ejemplo?

On 8/31/07, Diego <[EMAIL PROTECTED]> wrote:
>
>
> Hola José, necesito representar un modelo similar al Country/State,
> pero quiero que a un determinado State se acceda solo a traves de la
> interface del Country al que pertenece.
> Tenes idea como puedo hacer eso utilizando la interface admin??
>
> Muchas gracias, saludos desde Argentina
>
> On 30 ago, 16:05, "Lic. José M. Rodriguez Bacallao" <[EMAIL PROTECTED]>
> wrote:
> > Hi people, I got a little problem with the admin page, I have models to
> > represent Country/State situation and a Person model that
> reference  Country
> > and State models but I want in admin that when I change a country of a
> > person, the list of states get updated to states of that country. How
> can I
> > do that?
> >
> > --
> > Lic. José M. Rodriguez Bacallao
> > Cupet
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> > mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic por
> > profesionales
> > -
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: admin site and parent/child relationship

2007-08-30 Thread Lic. José M. Rodriguez Bacallao
ok, thanks

On 8/30/07, Alex Koshelev <[EMAIL PROTECTED]> wrote:
>
>
> There is no way to do so in django admin now.
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



admin site and parent/child relationship

2007-08-30 Thread Lic. José M. Rodriguez Bacallao
Hi people, I got a little problem with the admin page, I have models to
represent Country/State situation and a Person model that reference  Country
and State models but I want in admin that when I change a country of a
person, the list of states get updated to states of that country. How can I
do that?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Meta options`

2007-08-27 Thread Lic. José M. Rodriguez Bacallao
how can I add my custom options to the Meta model class?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: modeling db inheritance

2007-08-27 Thread Lic. José M. Rodriguez Bacallao
could you please be more specific?

On 8/25/07, Michael Elsdoerfer <[EMAIL PROTECTED]> wrote:
>
>
> I needed a very similar thing and I ultimately decided to use a "type"
> char
> field in the base model that would contain the model name of the subtype.
>
> Michael
>
> > -Original Message-
> > From: django-users@googlegroups.com [mailto:
> [EMAIL PROTECTED]
> > On Behalf Of Ernesto Rodriguez Reina
> > Sent: Friday, August 24, 2007 7:38 PM
> > To: Django users
> > Subject: modeling db inheritance
> >
> >
> > Hello,
> > I'm need to model a table inheritance in a new project i'm working on,
> but
> > i
> > don't know the best way to do it.
> >
> > Here is an explample of what i need:
> >
> > class User(models.Model):
> >   firstname  = models.CharField(maxlength=100)
> >   lastname  = models.CharField(maxlength=100)
> >
> > # This should inherit User
> > class Student(models.Model):
> >   school= models.ForeignKey(School)
> >
> > # This should inherit User
> > class Teacher(models.Model):
> >   school= models.ForeignKey(School)
> >   students  = models.ManyToMany(Students)
> >
> > # This should inherit User
> > class Manager(models.Model):
> >   pass
> >
> > I think it could be adding a ForeingKey to User, but, how to know,
> having
> > a
> > User if it is Student, Teacher or Manager?
> >
> > Any ideas?
> >
> > Best Reagards,
> >
> > --
> > Lic. Ernesto Rodríguez Reina
> > Facultad de Matemática y Computación, UH.
> > http://profesores.matcom.uh.cu/~erreina/
> >
> >
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: modeling db inheritance

2007-08-24 Thread Lic. José M. Rodriguez Bacallao
Primero, en django.contrib.auth.models esta definido un modelo User que
tiene los datos que necesitas, para eso, debes poner en INSTALLED_APP en tu
settings.py la sgte app:
django.contrib.auth

tu models.py o como se llame debera quedar asi:

from django.db import models
from django.contrib.auth.models import User

class School(models.Model):
pass

class Student(models.Model):
   school= models.ForeignKey(School)

class Teacher(models.Model):
   school= models.ForeignKey(School)
   students  = models.ManyToMany(Students)

ademas, la herencia en el ORM de django no esta implementada la herencia,
eso es un ticket pendiente, lo que debes hacer es simularla con un
ForeignKey (no uses el OneToOneField). Ademas, si lo que tienes es muchos
modelos que comparten los mismo atributos y estos ademas son unos cuantos
(una herencia), te puedo mandar snippet de codigo que hace eso mismo,
declaras una clase aparte cualquiera donde tengas esos atributos y luego
utilizas el snippet que te mandare si lo deseas.


On 8/24/07, Ernesto Rodriguez Reina <[EMAIL PROTECTED]> wrote:
>
>
> Hello,
> I'm need to model a table inheritance in a new project i'm working on, but
> i
> don't know the best way to do it.
>
> Here is an explample of what i need:
>
> class User(models.Model):
> firstname  = models.CharField(maxlength=100)
> lastname  = models.CharField(maxlength=100)
>
> # This should inherit User
> class Student(models.Model):
> school= models.ForeignKey(School)
>
> # This should inherit User
> class Teacher(models.Model):
> school= models.ForeignKey(School)
> students  = models.ManyToMany(Students)
>
> # This should inherit User
> class Manager(models.Model):
> pass
>
> I think it could be adding a ForeingKey to User, but, how to know, having
> a
> User if it is Student, Teacher or Manager?
>
> Any ideas?
>
> Best Reagards,
>
> --
> Lic. Ernesto Rodríguez Reina
> Facultad de Matemática y Computación, UH.
> http://profesores.matcom.uh.cu/~erreina/
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: insert or update

2007-08-21 Thread Lic. José M. Rodriguez Bacallao
how can I vote?

On 8/21/07, Peter Melvyn <[EMAIL PROTECTED]> wrote:
>
>
> On 8/21/07, George Vilches <[EMAIL PROTECTED]> wrote:
>
> > http://code.djangoproject.com/ticket/4879
> > If you need that functionality, add a vote for it. :)
>
> Yes, I need such functionality :)
>
> Peter
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



insert or update

2007-08-21 Thread Lic. José M. Rodriguez Bacallao
how can I know programatically if an operation in a model is an insert,
update or delete?
I just want to extend the admin log to log any action in my application
models. Right now,
admin app only log actions executed by itself.

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: how to display an error

2007-08-09 Thread Lic. José M. Rodriguez Bacallao
I think U don't understand the question. What I want is in admin interface,
displey the row representing a field with and error in red like ther other
normal fields in django, right now I'm checking if the field has errors in
the save() method of my model.

On 8/9/07, Grupo Django <[EMAIL PROTECTED]> wrote:
>
>
> You can use the shell.
> Run python manage.py shell within your project path.
> Import your model:
> from app.models import foo
> f = foo( bar=2 )
> f.save()
>
> now you can check all the variables you want. f.id returns the id of
> the new created object.
>
>
> On Aug 9, 1:29 pm, "Lic. José M. Rodriguez Bacallao"
> <[EMAIL PROTECTED]> wrote:
> > if I have a model with save method overrided to check if some values in
> my
> > model are ok, how can I display the field(s) with errors in red in admin
> > like django admin does when an error occur with that field(s)?
> >
> > --
> > Lic. José M. Rodriguez Bacallao
> > Cupet
> > -
> > Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
> > mismo.
> >
> > Recuerda: El arca de Noe fue construida por aficionados, el titanic por
> > profesionales
> > -
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



about templates tags

2007-08-09 Thread Lic. José M. Rodriguez Bacallao
can I include more than one template tag definition in a single template tag
file? Right  now I was trying  to do that and I can't.

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



how to display an error

2007-08-09 Thread Lic. José M. Rodriguez Bacallao
if I have a model with save method overrided to check if some values in my
model are ok, how can I display the field(s) with errors in red in admin
like django admin does when an error occur with that field(s)?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Menu implementation

2007-08-06 Thread Lic. José M. Rodriguez Bacallao
yes

On 7/18/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
>
> Lic. José M. Rodriguez Bacallao wrote:
> > Have anybody implemented a tree with django, for example, a menu?
> >
>
> tree = ui or data structurer?  (guessing the answer is yes to both)
>
> Carl K
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: related_name

2007-08-06 Thread Lic. José M. Rodriguez Bacallao
right now, I find out how but, anyway, I'll give U an example:

every ForeigmKey have a related_name parameter in its constructor, the
problem is how to change that value once we construct the ForeignKey object.
I did so changing the value of the: foreignkey_object.rel.related_name at
runtime.

On 8/4/07, Amirouche <[EMAIL PROTECTED]> wrote:
>
>
>
>
> On Aug 1, 10:07 pm, "Lic. José M. Rodriguez Bacallao"
> <[EMAIL PROTECTED]> wrote:
> > how can I change the "related_name" value in a ForeignKey field
> dynamically
> > at model creation time?
> >
>
> What do you really mean I don't understand, give an example
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



(another) admin and edit_inline

2007-08-03 Thread Lic. José M. Rodriguez Bacallao
Why when I have a model edited inline other (for example, Model B is edited
inline model A, admin is for model A) and model B have a DateTimeField field
with auto_now_add = True (creation_date = DateTimeField(auto_now_add = True)
), when I save the model the second time, it raise this error:
app_name_model_B.creation_date may not be NULL.
Is this normal? What can I do?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django admin and edit_inline

2007-08-02 Thread Lic. José M. Rodriguez Bacallao
if I have a model edited inline with other in the admin site, how can
I specified  the ordering of the inline edited model fields and it
don't show up in admin first page?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



related_name

2007-08-01 Thread Lic. José M. Rodriguez Bacallao
how can I change the "related_name" value in a ForeignKey field dynamically
at model creation time?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



related_name

2007-08-01 Thread Lic. José M. Rodriguez Bacallao
how can I change the "related_name" value in a ForeignKey field dynamically
at model creation time?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Lic. José M. Rodriguez Bacallao
take a look at:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

On 7/19/07, James Bennett <[EMAIL PROTECTED]> wrote:
>
>
> On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote:
> > A view knows the logged in user through request.user but i could not
> > find if a signal has this information somewhere.
>
> No, this information is not available in the default signals. This is
> because Django can be used completely independently of its
> authentication system and completely indepdendently of its HTTP
> request/response system (e.g., you can set up cron jobs, use Django as
> a backend to a non-web application, etc.); if the request object and
> auth system were that tightly coupled to the model layer, a lot of
> uses wouldn't be possible.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Does a pre/post_save signal know who is the user currently logged in?

2007-07-19 Thread Lic. José M. Rodriguez Bacallao
take a look at:
http://code.djangoproject.com/wiki/CookBookThreadlocalsAndUser

On 7/19/07, James Bennett <[EMAIL PROTECTED]> wrote:
>
>
> On 7/19/07, Xanthus <[EMAIL PROTECTED]> wrote:
> > A view knows the logged in user through request.user but i could not
> > find if a signal has this information somewhere.
>
> No, this information is not available in the default signals. This is
> because Django can be used completely independently of its
> authentication system and completely indepdendently of its HTTP
> request/response system (e.g., you can set up cron jobs, use Django as
> a backend to a non-web application, etc.); if the request object and
> auth system were that tightly coupled to the model layer, a lot of
> uses wouldn't be possible.
>
> --
> "Bureaucrat Conrad, you are technically correct -- the best kind of
> correct."
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Menu implementation

2007-07-18 Thread Lic. José M. Rodriguez Bacallao
Have anybody implemented a tree with django, for example, a menu?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



recursive relation

2007-07-16 Thread Lic. José M. Rodriguez Bacallao
How can I make a recursive one-to-many relation?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: little problem

2007-07-13 Thread Lic. José M. Rodriguez Bacallao
thanks, that work more efficient that my way of do it, I was getting the
user from the database to see if the user exist. I like your solution, is
pretty clean and simple. Thanks a lot.

On 7/13/07, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
>
>
> On 7/13/07, JeffH <[EMAIL PROTECTED]> wrote:
> >
> > if getattr(model_instance, 'id', None) is None:
> >   model_instance.created_by = whatever
> >
>
> Also take a look at ``hasattr()``:
> http://docs.python.org/lib/built-in-funcs.html#l2h-35
>
> Jacob
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



little problem

2007-07-13 Thread Lic. José M. Rodriguez Bacallao
Hi, I got a little problem. I need to store in a model the first user who
created it (created_by) and the user who last modified it
(last_modified_by). So, with the second one, there is no problem, every time
a user save the object, the pre_save signal is dispatched and I catch it so
I can set the "last_modified_by" field to current user but, right there, I
need to set the "created_by" field and I don't know how to do it, my
algorithm is pretty simple:

if model_instance.created_by is not set:
set model_instance.created_by to current user
.
.
.
continues with save

the problem here is how to know if model_instance.created_by field is set or
not, I think that it can be known if a can figure out if save method  is
going to insert or update, but, how  I know it?


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: one model per file

2007-07-12 Thread Lic. José M. Rodriguez Bacallao
Benjamin is right, I forgot that detail!!

On 7/12/07, Benjamin Slavin <[EMAIL PROTECTED]> wrote:
>
> On 7/12/07, Lic. Jos� M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
> > the idea here is like Jeremy say, make django think that it has a module
> or
> > package named models, here, in __init__.py file I'm telling that the
> > directory models is a package and for all your models to be accessible to
> > django U must import all of them.
>
> This is how we handle breaking apart model files for large
> applications.  The only thing that should be added is that you need to
> explicitly define the application in the Meta class.  To clarify:
>
> /foos/models/Bar.py
> 
> class Bar(models.Model):
> 
> class Meta:
> app_label='foos'
>
> This way Django will be able to recognize your model as 'foos.Bar'
> (important for the Django ORM innards).
>
> Note:  If you start to see 'module is not callable' (or similar)
> errors, make sure you've added the imports to __init__.py properly.
>
> Hope this helps,
>  - Ben
>
> >
>


-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: one model per file

2007-07-12 Thread Lic. José M. Rodriguez Bacallao
Benjamin is right, I forgot that detail!!

On 7/12/07, Benjamin Slavin <[EMAIL PROTECTED]> wrote:
>
> On 7/12/07, Lic. Jos� M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
> > the idea here is like Jeremy say, make django think that it has a module
> or
> > package named models, here, in __init__.py file I'm telling that the
> > directory models is a package and for all your models to be accessible to
> > django U must import all of them.
>
> This is how we handle breaking apart model files for large
> applications.  The only thing that should be added is that you need to
> explicitly define the application in the Meta class.  To clarify:
>
> /foos/models/Bar.py
> 
> class Bar(models.Model):
> 
> class Meta:
> app_label='foos'
>
> This way Django will be able to recognize your model as 'foos.Bar'
> (important for the Django ORM innards).
>
> Note:  If you start to see 'module is not callable' (or similar)
> errors, make sure you've added the imports to __init__.py properly.
>
> Hope this helps,
>  - Ben
>
> >
>


-- 
Lic. Jos� M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic
por profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Is there any way to custom group models in the admin panel?

2007-07-12 Thread Lic. José M. Rodriguez Bacallao
I would like to know if this is posible in a simple and clean way, if anyone
has the answer, please, post it.

On 7/11/07, Sebastian Macias <[EMAIL PROTECTED]> wrote:
>
>
> By default models are grouped by app. I really need to be able to
> break down that grouping a little bit more. I will have an app with
> probably 40-50 models and would like to group those logically instead
> of having them all listed under my app name.
>
> Thanks,
>
> Sebastian
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: one model per file

2007-07-12 Thread Lic. José M. Rodriguez Bacallao
right now I'm working with this layout, multiple files with models
definitions, look an example:

project dir:
|___app dir
 |__models (this is a package)
  |___ __init__.py (here I import all my models: from fileX
import modelX...)
  |___ fileX.py (here I can define for example: modelX)
  |___ fileZ.py (here I can define another models: modelZ,
modelsA)
|___app dir

the idea here is like Jeremy say, make django think that it has a module or
package named models, here, in __init__.py file I'm telling that the
directory models is a package and for all your models to be accessible to
django U must import all of them. In this example the __init__.py file would
look like this:

from fileX import modelX
from fileZ import modelZ, modelA

sorrey for my english, it's not so good.



On 7/12/07, Jeremy Dunck <[EMAIL PROTECTED]> wrote:
>
>
> On 7/12/07, LaundroMat <[EMAIL PROTECTED]> wrote:
> ...
> > I don't exactly see what you'd want to do this though. It's a lot
> > easier to stick to the standard.
>
> Perhaps he's using a source control system with pessimistic locking.
>
> So, yeah, you can do this:
>
> app_dir/
>   models.py -> "from sub_model import *"
>   sub_model.py -> define some models here.
>
> The important thing, though, is that your models need to be accessible
> as app_dir.models.*; Django makes that pathing assumption right now.
> There's some desire, but no urgency, to remove that limitation.
>
> For now, just use import *.  :)
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: Eclipse and PyDev setup

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi, I'm using Eclipse with pydev for development too. My suggestions for a
project is to create a pydev project without the src folder. later, U have
to tell eclipse in the project properties that your workspace is a source
folder and is an external source folder too.

On 7/11/07, Petra Javornicka <[EMAIL PROTECTED]> wrote:
>
>
> > I'm a django newbie, just finished the tutorial.  I would like to do my
> > development under Eclipse.  PyDev want to have a "src" folder under the
> > project, which does not really fit the django default directory
> structure.
>
> I'm a Django newbie as well and I've had a similiar/same problem.
> Originally,
> I decided to force Pydev use  =  folder
> i.e. with remapped src folder.
>
> But I encountered problems with setting of python and/or src path: if
> it was OK for Apache and mod_python, it was not OK for Pydev and vice
> versa and dtto form development server.
>
> Finally I changed Pydev to its defaults i.e.
>
> //src//
>
> And everything works fine now. But as I wrote: I'm a beginner and
> maybe it is possible to configure all three systems this way - perhaps
> some skilled Django users/developers will enlighten this.
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



DRY violation

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi people, I got a little problem with the DRY principle. I have a lot of
models with a common attribute: created_by, which is an attribute to store
the user who created that object but, in all my models I have to define the
save() method over and oven again to store the user manually before django
ORM save the object to database. The problem is that I love the DRY
principle and I don't want to repeat the definition of save() method, I just
don't want. Any suggestion here?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



DRY violation

2007-07-11 Thread Lic. José M. Rodriguez Bacallao
Hi people, I got a little problem with the DRY principle. I have a lot of
models with a common attribute: created_by, which is an attribute to store
the user who created that object but, in all my models I have to define the
save() method over and oven again to store the user manually before django
ORM save the object to database. The problem is that I love the DRY
principle and I don't want to repeat the definition of save() method, I just
don't want. Any suggestion here?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



contenttypes

2007-07-02 Thread Lic. José M. Rodriguez Bacallao
Hi everyone, I really need some help on the contentypes app, could someone
explain me how it work with an example, I have read a little explanation on:
http://feh.holsman.net/articles/2006/06/03/django-contenttype but its very
vague. Could someone help me please?

-- 
Lic. José M. Rodriguez Bacallao
Cupet
-
Todos somos muy ignorantes, lo que ocurre es que no todos ignoramos lo
mismo.

Recuerda: El arca de Noe fue construida por aficionados, el titanic por
profesionales
-

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



classes

2007-06-07 Thread Lic. José M. Rodriguez Bacallao
how can I know insede a method the type of my class dynamicaly?

-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Authenticated user

2007-06-06 Thread Lic. José M. Rodriguez Bacallao
Hi people, here I come again, this time with a little question:

suppose I got this model:

from django.contrib.auth.models import User

class Item(models.Model):
created_by = models.ForeignKey(User, editable = False)

I set editable = False because I don't want this field appears in the admin
interface but it need to be in the database table. So, what I want is when a
user create an Item, it automatically  insert  the logged user id  in
created_by field. I thought I can do that overriding the save method of my
model class but the problem is how can I know the currently logged user?
Any suggestions?

-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dynamic fields in models

2007-06-05 Thread Lic. José M. Rodriguez Bacallao
problem resolved, here is how I did it, just a little change to my original
code, setattr by add_to_class, with this, I can add common attributes to a
lot of models without having to inherit more than once or having a base
class for all of them, beside, it just create one table, not two:

def common_attrs(cls, common):
attrs = dir(common)
for attr in attrs:
if isinstance( getattr(common, attr), models.Field ):
#setattr( cls, attr, getattr(common, attr) )
cls.add_to_class(attr, getattr(common, attr) )
return cls

class Content:
title = models.CharField( maxlength = 50 )
description = models.CharField( maxlength = 100 )
created_by = models.ForeignKey( User )
creation_date = models.DateTimeField( auto_now_add = True )
pub_date = models.DateTimeField()
exp_date = models.DateTimeField()


class NewsItem(models.Model):
text = models.TextField()

def __str__(self):
return self.title

class Admin: pass
NewsItem = common_attrs(NewsItem, Content)


On 6/5/07, Branton Davis <[EMAIL PROTECTED]> wrote:
>
>
> Cool!
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: dynamic fields in models

2007-06-05 Thread Lic. José M. Rodriguez Bacallao
problem resolved, here is how I did it, just a little change to my original
code, setattr by add_to_class, with this, I can add common attributes to lot
of models without having to inherit more than once or having a base class
for all my models :

def common_attrs(cls, common):
attrs = dir(common)
for attr in attrs:
if isinstance( getattr(common, attr), models.Field ):
#setattr( cls, attr, getattr(common, attr) )
cls.add_to_class(attr, getattr(common, attr) )
return cls

class Content:
title = models.CharField( maxlength = 50 )
description = models.CharField( maxlength = 100 )
created_by = models.ForeignKey( User )
creation_date = models.DateTimeField( auto_now_add = True )
pub_date = models.DateTimeField()
exp_date = models.DateTimeField()


class NewsItem(Content, models.Model):
text = models.TextField()

def __str__(self):
return self.title

class Admin: pass
NewsItem = common_attrs(News, Content)


On 6/5/07, Branton Davis <[EMAIL PROTECTED]> wrote:
>
>
> Cool!
>
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



any django users in Cuba?

2007-06-05 Thread Lic. José M. Rodriguez Bacallao
there is any django users in Cuba or just a cuban user?

-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



dynamic fields in models

2007-06-04 Thread Lic. José M. Rodriguez Bacallao
hi people, I want to do a little thing, I want to add fields dynamically  to
a  model so when  I run python manage.py  syncdb, those fields  get added to
the database table, for example:

def common_attrs(cls, common):
attrs = dir(common)
for attr in attrs:
if isinstance( getattr(common, attr), models.Field ):
setattr( cls, attr, getattr(common, attr) )
return cls

class Content:
title = models.CharField( maxlength = 50 )
description = models.CharField( maxlength = 100 )
created_by = models.ForeignKey( User )
creation_date = models.DateTimeField( auto_now_add = True )
pub_date = models.DateTimeField()
exp_date = models.DateTimeField()

class News(Content, models.Model):
text = models.TextField()
News = common_attrs(News, Content)

but when I run python manage.py syncdb or sql ..., those fields never get
added to the database table, anyone could help me?

-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: problem representation

2007-06-04 Thread Lic. José M. Rodriguez Bacallao
that is repeating a lot of common information about my models, what about
DRY, reusing, etc?

On 6/4/07, Joseph Heck <[EMAIL PROTECTED]> wrote:
>
>
> Maybe a foreign key relationship would work, but you might just
> consider adding all those attributes to each model. Unless you think
> you'll end with really sparse tables, it may be worth it for the
> simplicity.
>
> You wouldn't want to use a one-to-one table for common elements among
> different models.
>
> -joe
>
> On 6/4/07, Lic. José M. Rodriguez Bacallao <[EMAIL PROTECTED]> wrote:
> > Hi for everyone. I'm stuck with django, I want to represent this
> situation:
> >
> > I have a lot of content types like, news, images, urls, etc. All of them
> > have common attributres like creation date, expiration date, publication
> > date, title and so on. The problem is how to represent this with django
> > models so I don't have to repeat all of those attributes in all models.
> > Until now, I represented this situation like a
> Generalization/Specialization
> > relationship with a on-to-one relation but I don't want to use it due to
> > this relation is going to change in future versions of django so, I
> don't
> > know what to do, anyone could help me?
> >
> >
> > --
> > Lic. José M. Rodriguez Bacallao
> > Informatics Science University
> > Habana-Cuba.
> >  >
> >
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Cupet

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



problem representation

2007-06-04 Thread Lic. José M. Rodriguez Bacallao
Hi for everyone. I'm stuck with django, I want to represent this situation:

I have a lot of content types like, news, images, urls, etc. All of them
have common attributres like creation date, expiration date, publication
date, title and so on. The problem is how to represent this with django
models so I don't have to repeat all of those attributes in all models.
Until now, I represented this situation like a Generalization/Specialization
relationship with a on-to-one relation but I don't want to use it due to
this relation is going to change in future versions of django so, I don't
know what to do, anyone could help me?


-- 
Lic. José M. Rodriguez Bacallao
Informatics Science University
Habana-Cuba.

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



Re: django models

2007-05-28 Thread Lic. José M. Rodriguez Bacallao
So, if I add a ForeignKey field to my model it simply add a
"related_model_id" column to my table, let me ask something, how django
enforce that when I add a repeated value to that field it will an error, I
mean, a foreign key value that does not exist in the original table in a one
to many relationship?

On 5/28/07, Marc Fargas <[EMAIL PROTECTED]> wrote:
>
>
> Hi Jos�,
> As the documentation says, the best alternative right now is to set a
> ForeignKey from one of the models to the other, on which you should
> place the ForeignKey really depends on every specific case, normaly it
> should go to the one that "cannot live with the other" (hence, the
> dependent one).
>
> ForeignKey simply adds a "related_model_id" column to hold the id of the
> other model and both models get the appropiate attributes/methods to
> find their relatives.
>
> Hope this helps,
> Marc
>
> El lun, 28-05-2007 a las 11:45 -0400, Lic. Jos� M. Rodriguez Bacallao
> escribi�:
> > Hi every one, first of all, sorry about my english, it's not so good
> > but I'm still learning. Well, I'm new to django and right now I come
> > from zope (2/3) and plone. I find django very exciting but I got a
> > little problem, how can I specify a Generalization/Especialization
> > relation in django, I mean, the better way. Until now, I specify it by
> > a OneToOne relationship but reading the documentation about models I
> > saw that the semantic of this relationship will change, so, right now,
> > I don't know what to do to be forward compatible, anyone can help me?
> >
> > --
> > Lic. Jos� M. Rodriguez Bacallao
> > Informatics Science University
> > Habana-Cuba.
> > >
>
> >
>


-- 
Lic. José M. Rodriguez Bacallao
Informatics Science University
Habana-Cuba.

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---



django models

2007-05-28 Thread Lic. José M. Rodriguez Bacallao
Hi every one, first of all, sorry about my english, it's not so good but I'm
still learning. Well, I'm new to django and right now I come from zope (2/3)
and plone. I find django very exciting but I got a little problem, how can I
specify a Generalization/Especialization relation in django, I mean, the
better way. Until now, I specify it by a OneToOne relationship but reading
the documentation about models I saw that the semantic of this relationship
will change, so, right now, I don't know what to do to be forward
compatible, anyone can help me?

-- 
Lic. José M. Rodriguez Bacallao
Informatics Science University
Habana-Cuba.

--~--~-~--~~~---~--~~
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]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---