Re: CSRF missing token

2010-12-09 Thread Ilian Iliev
Hi,

you have to include the request context to use CSRF token.

from django.template import RequestContext

return render_to_response('index.html', locals(), context_instance =
RequestContext(request))

Greeting,
Ilian Iliev

On Thu, Dec 9, 2010 at 2:08 AM, martvefun  wrote:

> Hello,
>
> I've a login form which give me an CSRF error.
> In the documentation, I read that I needed to have in my code :
>
> # views.py
> ...
>csrf_token = {}
>csrf_token.update(csrf(request))
>return render_to_response('index.html', locals())
>
> # index.html
> ...
>
> {% csrf_token %}
>
> But I've an error that the two tokens are different
> I guess the problem is in the generation of the token :
>
> 
> name='csrfmiddlewaretoken' value='{'csrf_token':
> }' />
>
>
> It should use value="{'csrf_ instead of value='{'csrf._..
>
> Any idea how to fix ?
>
> Thanks
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

-- 
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: Returning value directly to another function

2010-12-09 Thread Ilian Iliev
Hi

what exactly is the problem with the if check?
Why is it so bad?

On Thu, Dec 9, 2010 at 4:21 PM, Quetzacotl  wrote:

> Hello, this is rather python problem, but maybe You can help. What i
> want to do is to return value in another function calling from other
> function.
>
> It doesnt mean i want this:
>
> def Func():
> return 1
>
> def Func2():
> return Func()
>
> I want function Func to return 1 directly in Func2 as it is Func2
> returning it.
>
> I have this problem because view function has to return response
> object and my function that adds element to database (comments)
> returns HttpResponseRedirect or context dict with form that has
> errors.
> If it returns redirect then i want view function to return it, if it
> return context then i dont want to return it but rather give it to
> render_to_response.
>
> It comes to this:
>
> def Add():
> #form valid, add to db
> return { 'redirect': HttpResponseRedirect('url'), }
>
> #form not valid
> return { 'form': form, 'redirect': 0, }
>
> def View(request):
> add = Add()
> if add['redirect']!=0:
>  return add['redirect']
>
> return render_to_response(template,add)
>
> Thing i dont want here is if statement checking if there is redirect,
> so i want within function Add return HttpResponseRedirect as it is
> View function.
>
> I dont know if this is possible.
>
>
>
>
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

-- 
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: Problems installing south as part of django-cms

2010-12-09 Thread Ilian Iliev
The simplest solution:

remove south from the list of installed application, run
./manage.py syncdb
this will create you tables the way thay have to be and everything will
be ok.
This will not fix your south problem, but will allow you to use django cms.
If you later fix the south, just run
./manage.py migrate cms --fake

to fake all cms migrations currently in the project.

On Thu, Dec 9, 2010 at 7:13 PM, wilbur  wrote:

> Hello,
>
> I am having a hell of a time getting Django-CMS up and running. I am
> using Django 1.1.1, and South 0.7.3 (by way of using easy_install
> south systemwide, though my Ubuntu synaptic package manager says
> 0.6-1) on Ubuntu 10.04 (Lucid). I am following the CMS tutorial at
> http://readthedocs.org/projects/ojii/django-cms/docs/tutorial.html.
> When I try to run import south from the manage.py shell, I get the
> following error:
>
> There is no South database module
> 'south.db.south.db.django.db.backends.postgresql_psycopg2' for your
> database. Please either choose a supported database, check for
> SOUTH_DATABASE_ADAPTER[S] settings, or remove South from
> INSTALLED_APPS.
>
> I have south in the INSTALLED_APPS, and my database in settings.py is:
>
> DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2'
>
> Any detailed help would be much appreciated,
>
> Bill
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

-- 
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: Problems installing south as part of django-cms

2010-12-09 Thread Ilian Iliev
Hi,

the problem look to be that cms is not in your python path.
It should work without hard copying it in other directory.
Are you able to import this middleware from the python interpeter?
If not check your python path.

On Thu, Dec 9, 2010 at 11:25 PM, wilbur  wrote:

> Hello and thank you,
>
> Removing south worked fine. I initially had problems loading
> middleware classes to settings.py for the following:
>
>#'cms.middleware.page.CurrentPageMiddleware',
>#'cms.middleware.user.CurrentUserMiddleware',
>#'cms.middleware.toolbar.ToolbarMiddleware',
>#'cms.middleware.media.PlaceholderMediaMiddleware',
>
> I subsequently hard copied the cms middleware modules to :
>
> /usr/lib/pymodules/python2.6/django/middleware/cms/middleware
>
> with the following settings.py entries:
>
>'django.middleware.cms.middleware.page.CurrentPageMiddleware',
>'django.middleware.cms.middleware.user.CurrentUserMiddleware',
>'django.middleware.cms.middleware.toolbar.ToolbarMiddleware',
>
> 'django.middleware.cms.middleware.media.PlaceholderMediaMiddleware',
>'django.middleware.cache.FetchFromCacheMiddleware',
>
> But, now I get the error:
>
> CMS Permission system requires
> cms.middleware.user.CurrentUserMiddleware.
> Please put it into your MIDDLEWARE_CLASSES in settings file
>
> I have verified that the paths are correct, and the
> CurrentUserMiddleware class exists in the user module??
>
> Thanks
>
>
>
>
>
> On Dec 9, 1:00 pm, Ilian Iliev  wrote:
> > The simplest solution:
> >
> > remove south from the list of installed application, run
> > ./manage.py syncdb
> > this will create you tables the way thay have to be and everything will
> > be ok.
> > This will not fix your south problem, but will allow you to use django
> cms.
> > If you later fix the south, just run
> > ./manage.py migrate cms --fake
> >
> > to fake all cms migrations currently in the project.
> >
> >
> >
> > On Thu, Dec 9, 2010 at 7:13 PM, wilbur  wrote:
> > > Hello,
> >
> > > I am having a hell of a time getting Django-CMS up and running. I am
> > > using Django 1.1.1, and South 0.7.3 (by way of using easy_install
> > > south systemwide, though my Ubuntu synaptic package manager says
> > > 0.6-1) on Ubuntu 10.04 (Lucid). I am following the CMS tutorial at
> > >http://readthedocs.org/projects/ojii/django-cms/docs/tutorial.html.
> > > When I try to run import south from the manage.py shell, I get the
> > > following error:
> >
> > > There is no South database module
> > > 'south.db.south.db.django.db.backends.postgresql_psycopg2' for your
> > > database. Please either choose a supported database, check for
> > > SOUTH_DATABASE_ADAPTER[S] settings, or remove South from
> > > INSTALLED_APPS.
> >
> > > I have south in the INSTALLED_APPS, and my database in settings.py is:
> >
> > > DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2'
> >
> > > Any detailed help would be much appreciated,
> >
> > > Bill
> >
> > > --
> > > 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.
> >
> > --
> > eng. Ilian Iliev
> > Web Software Developer
> >
> > Mobile: +359 88 66 08 400
> > Website: ilian.i-n-i.org
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

-- 
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: Create new entry on first save of different model

2010-12-09 Thread Ilian Iliev
Hi,

you can overload the save method of Model1 in a way
that it checks type and if it is machine, create two record in Model2.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

On Thu, Dec 9, 2010 at 11:21 PM, Nick  wrote:

> I am working on a project in which I need to evaluate a field in one
> model and based on its values add entries to another model. I don't
> quite now how to succinctly put that into words which is why searching
> for a solution has been so annoying.
>
> Here is my example
>
> Type_Choices = (
>('Person', 'Person'),
>('Machine', 'Machine'),
>)
>
> class Model1(models.Model):
>type = models.CharField(max_length=100, choices=Type_Choices)
>name = models.CharField(max_length=100)
>
> class Model2(models.Model):
>person_job = models.CharField()
>machine_job = models.CharField()
>
>
> what I'd like to do is evaluate type on Model 1 when and entry is
> first created and then if it evaluates to Machine create two new
> entries in Model2. One for  machine_job = primary and one for
> machine_job = secondary. I only want this to fire on the initial save
> of the Model1 object.
>
> Any help with actual code examples or ways of phrasing this so as not
> to confuse google is appreciated.
>
> --
> 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.



Re: Problems installing south as part of django-cms

2010-12-09 Thread Ilian Iliev
Check whether the toolbar directory has __init__.py in it. Then try

from cms.middleware import toolbar


On Fri, Dec 10, 2010 at 12:20 AM, wilbur  wrote:

> I have checked my python path, and I see:
>
> /usr/local/lib/python2.6/dist-packages/django_cms-2.1.0.beta3-
> py2.6.egg
>
> as one of the directories. If i point to the module I want with:
>
>'cms.middleware.toolbar.ToolbarMiddleware',(##and this path
> DOES exist in the directory structure)
>
> in my MIDDLEWARE_CLASSES, I still get the error:
>
> ImproperlyConfigured: Error importing middleware
> cms.middleware.toolbar: "No module named toolbar"
>
> And, if I go into my Django shell, and type:
>
> import sys
> sys.path (##shows the same python path as above)
> from cms.middleware.toolbar import *
>
> I get:
>
> ImportError: No module named toolbar
>
> I don't understand!
>
> Thanks
>
> On Dec 9, 2:35 pm, Ilian Iliev  wrote:
> > Hi,
> >
> > the problem look to be that cms is not in your python path.
> > It should work without hard copying it in other directory.
> > Are you able to import this middleware from the python interpeter?
> > If not check your python path.
> >
> >
> >
> > On Thu, Dec 9, 2010 at 11:25 PM, wilbur  wrote:
> > > Hello and thank you,
> >
> > > Removing south worked fine. I initially had problems loading
> > > middleware classes to settings.py for the following:
> >
> > >#'cms.middleware.page.CurrentPageMiddleware',
> > >#'cms.middleware.user.CurrentUserMiddleware',
> > >#'cms.middleware.toolbar.ToolbarMiddleware',
> > >#'cms.middleware.media.PlaceholderMediaMiddleware',
> >
> > > I subsequently hard copied the cms middleware modules to :
> >
> > > /usr/lib/pymodules/python2.6/django/middleware/cms/middleware
> >
> > > with the following settings.py entries:
> >
> > >'django.middleware.cms.middleware.page.CurrentPageMiddleware',
> > >'django.middleware.cms.middleware.user.CurrentUserMiddleware',
> > >'django.middleware.cms.middleware.toolbar.ToolbarMiddleware',
> >
> > > 'django.middleware.cms.middleware.media.PlaceholderMediaMiddleware',
> > >'django.middleware.cache.FetchFromCacheMiddleware',
> >
> > > But, now I get the error:
> >
> > > CMS Permission system requires
> > > cms.middleware.user.CurrentUserMiddleware.
> > > Please put it into your MIDDLEWARE_CLASSES in settings file
> >
> > > I have verified that the paths are correct, and the
> > > CurrentUserMiddleware class exists in the user module??
> >
> > > Thanks
> >
> > > On Dec 9, 1:00 pm, Ilian Iliev  wrote:
> > > > The simplest solution:
> >
> > > > remove south from the list of installed application, run
> > > > ./manage.py syncdb
> > > > this will create you tables the way thay have to be and everything
> will
> > > > be ok.
> > > > This will not fix your south problem, but will allow you to use
> django
> > > cms.
> > > > If you later fix the south, just run
> > > > ./manage.py migrate cms --fake
> >
> > > > to fake all cms migrations currently in the project.
> >
> > > > On Thu, Dec 9, 2010 at 7:13 PM, wilbur  wrote:
> > > > > Hello,
> >
> > > > > I am having a hell of a time getting Django-CMS up and running. I
> am
> > > > > using Django 1.1.1, and South 0.7.3 (by way of using easy_install
> > > > > south systemwide, though my Ubuntu synaptic package manager says
> > > > > 0.6-1) on Ubuntu 10.04 (Lucid). I am following the CMS tutorial at
> > > > >http://readthedocs.org/projects/ojii/django-cms/docs/tutorial.html.
> > > > > When I try to run import south from the manage.py shell, I get the
> > > > > following error:
> >
> > > > > There is no South database module
> > > > > 'south.db.south.db.django.db.backends.postgresql_psycopg2' for your
> > > > > database. Please either choose a supported database, check for
> > > > > SOUTH_DATABASE_ADAPTER[S] settings, or remove South from
> > > > > INSTALLED_APPS.
> >
> > > > > I have south in the INSTALLED_APPS, and my database in settings.py
> is:
> >
> > > > > DATABASE_ENGINE = 'django.db.backends.postgresql_psycopg2

Re: slightly complicated radio input question

2010-12-10 Thread Ilian Iliev
Hi,

there is a radio select widget for Django Forms ->
http://docs.djangoproject.com/en/dev/ref/forms/widgets/

On Sat, Dec 11, 2010 at 12:59 AM, yiftah  wrote:

> hi
>
> I want to create a form with django that has a radio selection that
> looks like
>
>  Entire
> Range (as in the file)
>  Specified
> Range:
> Starting time
> 
> Ending time
> 
>  Maximum
> Temperature (ΔTM) only, with
> 
>  Savitzki-Golay
>  polynomial
>  no
> 
>
> any idea how to write the form class to represent this?
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: ilian.i-n-i.org

-- 
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: Problem with my view or template (DRIVES ME NUTS)

2012-03-05 Thread Ilian Iliev
Hi,

first of all use if request.POST, second pehaps you should pass the pk as
part of the action URL.
Do you get any errors or anything?


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Mon, Mar 5, 2012 at 4:54 PM, leaks  wrote:

> I don't get an error... Nothing just happens
>
> my view: (I think the problem is here)
>
> def push(request, pk):
> if request.method == 'POST':
> entry = Entry.objects.get(pk=pk)
> entry.pushes +=1
> entry.save()
>
> My template:
>
> 
> {% for entry in entries.object_list %}
> {{ entry.title }}
> Posted on {{ entry.posted }} by {{ entry.submitter }} | pushed {{
> entry.pushes }} time(s).
> {% if user.is_authenticated %}
> #or maybe here...
> 
> {% csrf_token %}
> 
> 
> 
> {% endfor %}
> 
>
> This is my first project and i haven't really understood how GET and POST
> request's work with models...
>
> Thanks in advance :)
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/8GXXgG28NcQJ.
> 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.
>

-- 
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: serialization in Django

2012-03-06 Thread Ilian Iliev
If you are returning json it seems more proper to me to parse it using
JavaScript.
Why exactly do you return json but not a normal dict/object?

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Mar 6, 2012 at 9:14 PM, angel  wrote:

> I am new to django and doing my course project. I am searching for a
> solution for iterating  JSON dictionary  in html page. My django view
> is the following:
>
> def do_GET(self, offset):
>data=get_object_or_404(NewAuction,pk=offset)
>context=serializers.serialize("json",[data])
>data1=json.dumps(context)
>return render_to_response("index.html",{"data1":data1})
> NewAuction is the model and offset is the particular id.
>
> Now I want to display the dictionary using the variable data1 in
> html.I use {{data1}} for this. but I got the following
>
> "[{\"pk\": 5, \"model\": \"Auction.newauction\", \"fields\":
> {\"username\": 1, \"category\": \"furniture\", \"description\": \"Made
> of Wood\", \"end_date\": \"2012-05-01 11:00:00\", \"start_price\":
> \"100\", \"title\": \"Table\", \"start_date\": \"2012-03-04
> 11:24:11\"}}]"
>
> How I can iterate it for displaying like
>
> category:furniture
> description:Made of wood
> 
> ..
> like this.
>
> Is anyone can help me?
>
>
>
> --
> 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.
>
>

-- 
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: Visibility images/css from another directories

2012-05-17 Thread Ilian Iliev
Hi,

can you add some more details. Are you using web server or you have only
the dev one for the moment. If you have web server what is it: Apache,
NginX etc.?

Best wishes,
Ilian Iliev


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Thu, May 17, 2012 at 11:06 AM, Stone  wrote:

> Dear users,
>
> I have a some simple question.
> Let's say that my project (dJango) is stored on the file system here:
> /opt/appl/htdocs
> and media files are stored here:
> /opt/appl/htdocs/media/css
> /opt/appl/htdocs/media/images
>
> All CSS and images are visible under directory /opt/appl/htdocs w/o
> problem.
>
> Another images and css are stored here:
> /opt/common/htdocs/media/css
> /opt/common/htdocs/media/images
>
> Is there any way how to visible in dJango all CSS and images
> from directory /opt/common/htdocs/...?>
>
> Thank you in advance
> Petr
>
> --
> 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.
>
>

-- 
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: Visibility images/css from another directories

2012-05-17 Thread Ilian Iliev
This is a bit more general than a Django issue.

Are both css directories going to be server under the same URL?
What will happend if both of them contain files with the same name?
Are you using staticfiles?

And more important why do you have these files out of the project, what is
the reason
to load them from separate directory instead from the project?


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Thu, May 17, 2012 at 1:50 PM, Stone  wrote:

> Sorry,
> now I have only the dev one for the moment,
> but for real usage I will have apache2-2.2.22
>
> Best reagards
> Petr
>
> On 17 kvě, 12:01, Ilian Iliev  wrote:
> > Hi,
> >
> > can you add some more details. Are you using web server or you have only
> > the dev one for the moment. If you have web server what is it: Apache,
> > NginX etc.?
> >
> > Best wishes,
> > Ilian Iliev
> >
> > --
> > eng. Ilian Iliev
> > Web Software Developer
> >
> > Mobile: +359 88 66 08 400
> > Website:http://ilian.i-n-i.org
> >
> >
> >
> >
> >
> >
> >
> > On Thu, May 17, 2012 at 11:06 AM, Stone  wrote:
> > > Dear users,
> >
> > > I have a some simple question.
> > > Let's say that my project (dJango) is stored on the file system here:
> > > /opt/appl/htdocs
> > > and media files are stored here:
> > > /opt/appl/htdocs/media/css
> > > /opt/appl/htdocs/media/images
> >
> > > All CSS and images are visible under directory /opt/appl/htdocs w/o
> > > problem.
> >
> > > Another images and css are stored here:
> > > /opt/common/htdocs/media/css
> > > /opt/common/htdocs/media/images
> >
> > > Is there any way how to visible in dJango all CSS and images
> > > from directory /opt/common/htdocs/...?>
> >
> > > Thank you in advance
> > > Petr
> >
> > > --
> > > 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.
>
> --
> 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.
>
>

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



Site stealing content

2012-09-20 Thread Ilian Iliev
Hello,

the site http://djangoblog.org/ is copying full articles from the community
feed
and presenting them as own(copyright at the website footer) without
mentioning
the original author/source.
I send a complain to the email in the domain whois( pa...@sychrovnet.cz) but
there was no response. From the hosting company told me that unfortunately
then can not do anything without police or court order.
The only step that I can think of now is to send a DMCA notice to Google(
http://support.google.com/bin/static.py?hl=en&ts=1114905&page=ts.cs)
with the hope that they will remove the indexed content.
Please if anyone of you is also suffering from this content stealing send an
DMCA notice or share if you have other ideas how we can stop this.

Thanks in advance,
Ilian Iliev

--
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org
Skype: eng.ilian_iliev

-- 
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: Update Services for Django

2012-09-26 Thread Ilian Iliev
Hi,

in the case of wordpress this is just an XML-RCP call it is used for
pingbacks/tracebacks.
There is similar implementation in zinnia if I remember correctly.
Otherwise you can just create
a method that will get/post to specific URL to notify it about the changed
content.

Greetings,
Ilian Iliev

--
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org
Skype: eng.ilian_iliev



On Wed, Sep 26, 2012 at 6:14 PM, Tom  wrote:

> Hi All,
>
> Wordpress has something called Update Services, a feature that pings
> certain web services when content is created or updated.
>
> http://codex.wordpress.org/Update_Services
>
> Does Django happen to have anything similar? What I'm trying to achieve is
> a way to tell a remote server that a piece of content has either been
> created, updated, or deleted.
>
> Many thanks for any advice or suggestions,
>
> Tom
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/hJLNCftx7qIJ.
> 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.
>

-- 
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: Update Services for Django

2012-09-26 Thread Ilian Iliev
Hi Tom,

I believe here you can find how the pingback is implemented in zinnia but
as you will see
the example is not that simple. Consider if you need so complex one or just
a get/post to
specific URL will be enough.

Greetings,
Ilian Iliev

--
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org
Skype: eng.ilian_iliev



On Wed, Sep 26, 2012 at 7:31 PM, Tom Clark  wrote:

> Hi Ilian,
>
> I couldn't find any reference to pingbacks/trackbacks for Django, could
> you point me in the right direction? :)
>
> Many thanks!
>
>
> On 26 September 2012 16:49, Ilian Iliev  wrote:
>
>> Hi,
>>
>> in the case of wordpress this is just an XML-RCP call it is used for
>> pingbacks/tracebacks.
>> There is similar implementation in zinnia if I remember correctly.
>> Otherwise you can just create
>> a method that will get/post to specific URL to notify it about the
>> changed content.
>>
>> Greetings,
>> Ilian Iliev
>>
>> --
>> eng. Ilian Iliev
>> Web Software Developer
>>
>> Mobile: +359 88 66 08 400
>> Website: http://ilian.i-n-i.org
>> Skype: eng.ilian_iliev
>>
>>
>>
>>
>> On Wed, Sep 26, 2012 at 6:14 PM, Tom  wrote:
>>
>>> Hi All,
>>>
>>> Wordpress has something called Update Services, a feature that pings
>>> certain web services when content is created or updated.
>>>
>>> http://codex.wordpress.org/Update_Services
>>>
>>> Does Django happen to have anything similar? What I'm trying to achieve
>>> is a way to tell a remote server that a piece of content has either been
>>> created, updated, or deleted.
>>>
>>> Many thanks for any advice or suggestions,
>>>
>>> Tom
>>>
>>>
>  --
> 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.
>

-- 
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: Problems trying to use ManyToMany field before saving in a ModelForm

2011-09-12 Thread Ilian Iliev
My advice is to use custom model form and hide these M2M fields if you are
creating a new object.
You can overwrite the init method of the form to do this.

On Mon, Sep 12, 2011 at 6:01 PM, Carlos Brum  wrote:

> Hello guys,
>
> I have a problem to deal with a field ManyToMany in Django. It is
> the following:
>
> When I try to access a list of relations that is my ManyToMany field
> I get an error
>
> "%ModelName% instance needs to have a primary key value before a many-
> to-many relationship Can be used. "
>
> I need to perform validation "before storing the record in the
> database".
> As you can see in the "view" code below, I used "save" in the
> "ModelForm" with "commit = False"
> so would build the ManyToMany relationship  in memory.
>
> This did not work.
>
> I've tried to find the solution on the internet but found nothing that
> work.
>
> Surely someone has been there.
>
> Thanks to collaboration.
>
> ##
> # Source
> ##
> Note: The Model "Group" is the native Django admin
>
> ##
> # Model
> ##
>
> class Application (models.Model):
>
>   . . .
>
>   groups =
> models.ManyToManyField (Group related_name = 'application')
>
>   . . .
>
>   eh_valida def (self):
>
>   validating = True
>
>   # ##
>   # HAVE PROBLEMS HERE. The attribute "self.grupos" is not
> filled. It should be a list.
>   # Error: %ModelForm% instance
>   # Needs to have a primary key value before the
>   # Many-to-many relationship Can be used. "
>   # ##
>
>   meuConjuntoDeGrupos = set (self.grupos)
>
>   # ##
>   . . .
>
>   return validating
>
> ##
> # ModelForm
> ##
> AplicacaoForm class (ModelForm):
>
>   class Meta:
>   model = Application
>
>
> # View
>
> def adiciona_aplicacao (request, idQuestionario):
>
>   form = AplicacaoForm (request.POST)
>
>   if request.method == 'POST':
>
>   if form.is_valid ():
>
>   form.save (commit = False)
>
>   if form.instance.eh_valida ():
>
>   form.save (commit = True)
>   HttpResponseRedirect return (reverse (manager))
>   #
>
>   . . .
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

-- 
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: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread Ilian Iliev
How are you pulling the data from the database in the desktop app - using
pure SQL or using the ORM?

If using the ORM it is possible it to cache the results of the database so
you can run:

mymodel.objects.update()

This should clear the cache.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Sep 13, 2011 at 9:00 AM, puppriss  wrote:

> Greetings All,
>
> Now, you may think me a bit of an asshat for doing it this way, but
>
> I have a MySQL db backend, DJANGO admin, and a self-coded desktop
> application ('InsectApp') written in Python. The 2 apps, DJANGO-Admin &
> InsectApp, both use the same 'settings' file and access the same data (I
> coded InsectApp so it would use the DJANGO database API because I thought it
> would make life easier!).
>
> The problem: is that there are now 2 ways of entering data, one via either
> app. For example, I'm in InsectApp and have imported model 'species'
> (InsectApp.models.speices) - meanwhile I add a new 'species' record via the
> Admin. On returning to InsectApp, I cannot access the new record unless I
> exit and restart the app. I have tried reloading InsectApp.models but it
> doesn't work.
>
> I'm assuming it's something to do with caching the data on first import of
> model 'species', but I have no CACHES in my settings.py. In any case both
> apps use the same settings.py.
>
> Can anyone explain and/or help me? Is there even a way of doing it?
> Thanks in advance
>
> p.s. I need the Admin site because we need certain database info, eg
> species taxonomy, to be updated remotely by taxonomists. The InsectApp is
> for rapid entering of large amounts of data wihtin our local network, which
> would be too clunky using the Admin alone. Hence the 2 apps
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/eSnLEH5uZBkJ.
> 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.
>

-- 
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: Caching/Reload problem - cannot refresh model data

2011-09-14 Thread Ilian Iliev
Hi Tom,

I checked the link you send and probably you are right but
can you explain why this is a bad solution?
Yes using autocommit() or disabling transactions seems more right
are there any downsides of the update() that you are seeing?
Image a case when you want to update the result set without breaking the
transaction(is this possible)?

I am not trolling just asking?

Regards,
Ilian Iliev

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Wed, Sep 14, 2011 at 2:34 PM, Tom Evans  wrote:

> On Wed, Sep 14, 2011 at 8:12 AM, Ilian Iliev  wrote:
> > How are you pulling the data from the database in the desktop app - using
> > pure SQL or using the ORM?
> >
> > If using the ORM it is possible it to cache the results of the database
> so
> > you can run:
> >
> > mymodel.objects.update()
> >
> > This should clear the cache.
> >
>
> Clear 'the cache' - as the side effect of performing a zero row update
> on your model!
>
> I wouldn't do that. The issue the user is hitting is that he is still
> within his original transaction - there is no caching going on. Read
> the documentation on managing transactions:
>
> https://docs.djangoproject.com/en/1.3/topics/db/transactions/
>
> In particular, how to completely disable transaction management, which
> you would probably want to do on the desktop app, and manage them
> manually if you need transactions.
>
>
> https://docs.djangoproject.com/en/1.3/topics/db/transactions/#how-to-globally-deactivate-transaction-management
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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: Caching/Reload problem - cannot refresh model data

2011-09-15 Thread Ilian Iliev
"Any UPDATE or INSERT will always commit the current transaction." ???

If this is correct(which I doubt) then you do not have transactions at all.
As I know
the idea of transaction is to run multiple statements in a way that they are
independent form
the other statements run at the same time?

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Thu, Sep 15, 2011 at 11:43 AM, Tom Evans wrote:

> On Wed, Sep 14, 2011 at 6:57 PM, Ilian Iliev  wrote:
> > Hi Tom,
> > I checked the link you send and probably you are right but
> > can you explain why this is a bad solution?
> > Yes using autocommit() or disabling transactions seems more right
> > are there any downsides of the update() that you are seeing?
> > Image a case when you want to update the result set without breaking the
> > transaction(is this possible)?
> > I am not trolling just asking?
> > Regards,
> > Ilian Iliev
>
> It's bad for future maintenance. Other developers may not know that
> trick, and be confused why you are doing a 'pointless' update, without
> grokking the unannounced side effect. It is always better to be
> explicit rather than implicit.
>
> Any UPDATE or INSERT will always commit the current transaction.
>
> Cheers
>
> Tom
>
> --
> 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.
>
>

-- 
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: Caching static images using memcache/nginx

2011-09-15 Thread Ilian Iliev
How about to set correct headers and make the images cached on user side
instead
of wasting memchached resources?
If you are serving tons of thumbs multiple times I bet that the traffic will
be bigger problem
than the time it took for these images to be read from disk.

Check this post ->
http://ilian.i-n-i.org/caching-web-sites-and-web-applications/ there you
can see which headers you need to set to tell the client browser to cache a
resource.


On Thu, Sep 15, 2011 at 4:51 PM, Thomas Weholt wrote:

> Good point Cliff! I just assumed serving static content would benefit
> from caching, but perhaps my effort is more well spent focusing on
> other aspects of my app right now.
>
> Thanks :-)
>
> Thomas
>
>
> On Thu, Sep 15, 2011 at 3:42 PM, J. Cliff Dyer 
> wrote:
> > What is your goal in doing this?  You are unlikely to see any
> > performance gains from this effort.
> >
> > It won't render any faster for your users.  Sending bytes over the
> > network is far slower than reading them off disk, so it's not likely to
> > be a bottleneck in terms of page loading.
> >
> > Your filesystem is likely caching commonly read items for you already.
> > Trying to outsmart this system is likely to just waste memory and slow
> > things down by caching the wrong things.
> >
> > Have you determined that this is actually a bottleneck in your app?  It
> > seems unlikely that serving static thumbnails is actually the thing
> > slowing your app down.
> >
> > Cheers,
> > Cliff
> >
> >
> > On Thu, 2011-09-15 at 15:24 +0200, Thomas Weholt wrote:
> >> Ok, this might sound a bit off-topic but bear with me.
> >>
> >> I got a templatetag in an app that generates thumbnails (
> >> django-photofile ). In my templates it might look like this
> >>
> >> 
> >>
> >> It will generate a thumbnail of the photo in 100x100 in a folder
> >> served by nginx for all static content and return an url pointing to
> >> the thumbnail, for instance
> >> '/static/thumb/4432lkj432kl5k4l26k_100x100.jpg'.
> >>
> >> This all works nice and dandy, but I want to cache the static photos
> >> using memcache, so that when the page is rendered and the templatetag
> >> returns the url '/static/thumb/4432lkj432kl5k4l26k_100x100.jpg'
> >> nginx will look for it on disk, cache it using memcache and return it
> >> so that the next time the page is rendrered it will be read from the
> >> cache and not from disk.
> >>
> >> I got a folder served by nginx with all my static content (js, css,
> >> images ), including the thumbnails and I want to cache it all ( using
> >> the assigned amount of ram to memcache of course, but I hope this is
> >> handled by memcache ).
> >>
> >> I've read through a few articles about nginx, memcache etc, but still
> >> haven't a clue on how to do this.
> >>
> >> NB! The reason I think/hope this is on topic is the fact I use a
> >> templatetag to generate the url etc. Sorry if it's still of topic.
> >>
> >> --
> >> Mvh/Best regards,
> >> Thomas Weholt
> >> http://www.weholt.org
> >>
> >
> >
> > --
> > 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.
> >
> >
>
>
>
> --
> Mvh/Best regards,
> Thomas Weholt
> http://www.weholt.org
>
> --
> 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.
>
>


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

-- 
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: Caching static images using memcache/nginx

2011-09-16 Thread Ilian Iliev
I am not 100% sure. It is better to check it I think it is configurable but
I am
not sure what is the default behavior.

On Thu, Sep 15, 2011 at 9:52 PM, Thomas Weholt wrote:

> Aha! That's briliant, but doesn't nginx set those headers for me when
> returning a static resource like a image?
>
> Thomas
>
> On Thu, Sep 15, 2011 at 4:52 PM, Ilian Iliev  wrote:
> > How about to set correct headers and make the images cached on user side
> > instead
> > of wasting memchached resources?
> > If you are serving tons of thumbs multiple times I bet that the traffic
> will
> > be bigger problem
> > than the time it took for these images to be read from disk.
> >
> > Check this post ->
> > http://ilian.i-n-i.org/caching-web-sites-and-web-applications/ there you
> > can see which headers you need to set to tell the client browser to cache
> a
> > resource.
> >
> >
> > On Thu, Sep 15, 2011 at 4:51 PM, Thomas Weholt 
> > wrote:
> >>
> >> Good point Cliff! I just assumed serving static content would benefit
> >> from caching, but perhaps my effort is more well spent focusing on
> >> other aspects of my app right now.
> >>
> >> Thanks :-)
> >>
> >> Thomas
> >>
> >>
> >> On Thu, Sep 15, 2011 at 3:42 PM, J. Cliff Dyer 
> >> wrote:
> >> > What is your goal in doing this?  You are unlikely to see any
> >> > performance gains from this effort.
> >> >
> >> > It won't render any faster for your users.  Sending bytes over the
> >> > network is far slower than reading them off disk, so it's not likely
> to
> >> > be a bottleneck in terms of page loading.
> >> >
> >> > Your filesystem is likely caching commonly read items for you already.
> >> > Trying to outsmart this system is likely to just waste memory and slow
> >> > things down by caching the wrong things.
> >> >
> >> > Have you determined that this is actually a bottleneck in your app?
>  It
> >> > seems unlikely that serving static thumbnails is actually the thing
> >> > slowing your app down.
> >> >
> >> > Cheers,
> >> > Cliff
> >> >
> >> >
> >> > On Thu, 2011-09-15 at 15:24 +0200, Thomas Weholt wrote:
> >> >> Ok, this might sound a bit off-topic but bear with me.
> >> >>
> >> >> I got a templatetag in an app that generates thumbnails (
> >> >> django-photofile ). In my templates it might look like this
> >> >>
> >> >> 
> >> >>
> >> >> It will generate a thumbnail of the photo in 100x100 in a folder
> >> >> served by nginx for all static content and return an url pointing to
> >> >> the thumbnail, for instance
> >> >> '/static/thumb/4432lkj432kl5k4l26k_100x100.jpg'.
> >> >>
> >> >> This all works nice and dandy, but I want to cache the static photos
> >> >> using memcache, so that when the page is rendered and the templatetag
> >> >> returns the url '/static/thumb/4432lkj432kl5k4l26k_100x100.jpg'
> >> >> nginx will look for it on disk, cache it using memcache and return it
> >> >> so that the next time the page is rendrered it will be read from the
> >> >> cache and not from disk.
> >> >>
> >> >> I got a folder served by nginx with all my static content (js, css,
> >> >> images ), including the thumbnails and I want to cache it all ( using
> >> >> the assigned amount of ram to memcache of course, but I hope this is
> >> >> handled by memcache ).
> >> >>
> >> >> I've read through a few articles about nginx, memcache etc, but still
> >> >> haven't a clue on how to do this.
> >> >>
> >> >> NB! The reason I think/hope this is on topic is the fact I use a
> >> >> templatetag to generate the url etc. Sorry if it's still of topic.
> >> >>
> >> >> --
> >> >> Mvh/Best regards,
> >> >> Thomas Weholt
> >> >> http://www.weholt.org
> >> >>
> >> >
> >> >
> >> > --
> >> > 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 unsubsc

Re: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Ilian Iliev
Hi,

ModelForm should automatically create a dropdown list for your foreign key.
If there is nor such drop-down created probably you are doing something
wrong.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Sep 20, 2011 at 1:26 PM, Jonas Geiregat  wrote:

> Hello,
>
> I have a UserProfile model:
>
> class UserProfile(FacebookProfileModel):
>user = models.ForeignKey(User, unique=True)
>lastfm_user = models.CharField(max_length=20, blank=True)
>
> This should be turned into a real HTML form , I which to use the ModelForm
> class for this.
>
> class UserProfileForm(ModelForm):
>class Meta:
>model = UserProfile
># I can select lastfm_user or any other properties I have
> defined in the UserProfile model
># But what if I wanted to only show the user__username field
> in the form ?
>
># This doesn't work
>fields = ('user__username',)
>
> I've searched the docs , read the page about creating froms from models but
> didn't found any clues.
> Is this even possible at all ?
>
> Now I'm implementing the form by hand , which is a lot of work , being able
> to use the ModelForm would speed up this process.
>
> Regards,
>
>
> Jonas Geiregat
> jo...@geiregat.org
>
>
>
>
>
> --
> 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.
>
>

-- 
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: Does ModelForm follow ForeignKey relations ?

2011-09-20 Thread Ilian Iliev
So you want to edit the User object through the ModelForm of the other
model, or you just want to display it?


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Sep 20, 2011 at 4:37 PM, Jonas Geiregat  wrote:

>
> > Hi,
> >
> > ModelForm should automatically create a dropdown list for your foreign
> key.
> > If there is nor such drop-down created probably you are doing something
> wrong.
> >
>
> I don't want the dropdown list I want the values of the foreinkey to be
> expaneded into fields
>
> For example I have user as ForeignKey to the contrib.auth.models.User
> model. This model has username as field.
>
> I want to display the username field of the user foreinkey.
>
> --
> 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.
>
>

-- 
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: Reuse admin for views when some fields are from remote sources

2011-09-26 Thread Ilian Iliev
If these fields are not field in the model class you won't see them in the
add/edit of the admin.
If you want to show them in the view(list) section of the admin you can
define them as properties,
example:

class MyModel(models.Model):
# field here

@property
def remote_property(self):
return remote_property

class MyModelAdmin(admin.ModelAdmin)
list_display = ( 'remote_property', 'other_model_field')

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Mon, Sep 26, 2011 at 2:11 PM, cesar.ortiz  wrote:

> Hi,
>
> We have some fields that will appear in the view that we won't to be
> part of the model. They are from other system and we don't wish to
> store them in order to avoid the problems that will arise with the
> duplication of data.
> We also would like to reuse the admin as much as possible in order to
> avoid to create our own templates.
>
> Those remote fields will be read/written to the remote system.
> Which would be the best way to implement this behaviour in django?
>
> Thanks,
>
> -- César
>
> --
> 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.
>
>

-- 
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: Reuse admin for views when some fields are from remote sources

2011-09-26 Thread Ilian Iliev
If you want to make these editable you should declare your own form
for the admin and overwrite the save method.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org



On Mon, Sep 26, 2011 at 7:37 PM, cesar.ortiz  wrote:

> It works for the List View, but it doesn't work for the Edit View
>
> On 26 sep, 13:40, Ilian Iliev  wrote:
> > If these fields are not field in the model class you won't see them in
> the
> > add/edit of the admin.
> > If you want to show them in the view(list) section of the admin you can
> > define them as properties,
> > example:
> >
> > class MyModel(models.Model):
> > # field here
> >
> > @property
> > def remote_property(self):
> > return remote_property
> >
> > class MyModelAdmin(admin.ModelAdmin)
> > list_display = ( 'remote_property', 'other_model_field')
> >
> > --
> > eng. Ilian Iliev
> > Web Software Developer
> >
> > Mobile: +359 88 66 08 400
> > Website:http://ilian.i-n-i.org
> >
> >
> >
> >
> >
> >
> >
> > On Mon, Sep 26, 2011 at 2:11 PM, cesar.ortiz 
> wrote:
> > > Hi,
> >
> > > We have some fields that will appear in the view that we won't to be
> > > part of the model. They are from other system and we don't wish to
> > > store them in order to avoid the problems that will arise with the
> > > duplication of data.
> > > We also would like to reuse the admin as much as possible in order to
> > > avoid to create our own templates.
> >
> > > Those remote fields will be read/written to the remote system.
> > > Which would be the best way to implement this behaviour in django?
> >
> > > Thanks,
> >
> > > -- César
> >
> > > --
> > > 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.
>
> --
> 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.
>
>

-- 
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: MYSQL Installation error

2011-09-26 Thread Ilian Iliev
Probably your MtSQL is not working, Try to telnet to this port to check
is it open and is something listening on it.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Mon, Sep 26, 2011 at 11:32 PM, PremAnand Lakshmanan
wrote:

> Im trying to install mysql and get the following error,
>
> Any idea on this error?
>
> >>> import pymysql
> >>> conn = pymysql.connect(host='localhost', port=3306, user='root',
> passwd=None
> , db='mysql')
> Traceback (most recent call last):
>   File "", line 1, in 
>   File "build\bdist.win32\egg\pymysql\__init__.py", line 72, in Connect
>   File "build\bdist.win32\egg\pymysql\connections.py", line 465, in
> __init__
>   File "build\bdist.win32\egg\pymysql\connections.py", line 607, in
> _connect
>   File "C:\Python27\lib\socket.py", line 224, in meth
> return getattr(self._sock,name)(*args)
> socket.error: [Errno 10061] No connection could be made because the target
> machi
> ne actively refused it
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-users@googlegroups.com.
> To unsubscribe from this group, send 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-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: Dynamic parameters in django URLs

2011-09-29 Thread Ilian Iliev
I had the same case a while ago but I decided always to keep all the params,
and fill them with 'all' if empty i.e.

/type/ redirects to /type/all/all/
/type/subtype/ redirects to type/subtupe/all

Otherwise if you are absolute sure that it is inpossible for type,subtype
and category to mach
you may run multiple queries in the view to check which one of them responds
to the correct keyword.
But I found this one a little bit "confusing" about the users.


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Thu, Sep 29, 2011 at 1:36 PM, Dejan Noveski  wrote:

> Hi,
>
> I want to add dynamic urls to my site for faceting purposes. E.g:
> /(type)/(subtype)/(category)/
> But I also want something like this to work: /(type)/(subtype)/ or
> /(type)/(category)/ or /(subtype)/(category)/ or just /(category)/ |
> /(type)/ | /(subtype)/
>
> Is there any clean way of doing this without declaring each possible
> combination of url params?
>
> Thanks
>
> --
> --
> Dejan Noveski
> <http://twitter.com/dekomote>
>
> --
> 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.
>

-- 
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: [Admin] Form Fields Rendering Completely Incorrectly

2011-09-30 Thread Ilian Iliev
As stated in dcumentation:
https://docs.djangoproject.com/en/dev/ref/models/fields/#textfield

A large text field. The admin represents this as a  (a multi-line
input).
You should use CharField instead of TextField

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Fri, Sep 30, 2011 at 2:01 PM, Nikhil Somaru  wrote:

> Hi All,
>
> Django Version: 1.3
> OS: Mac OS X Lion
> Browsers: Chrome, Safari, FF
> Other: Virtualenv
>
> The models are only registered with admin, there are no ModelAdminclasses. 
> For some reason, all
> TextField's on all models (even those with really small max_length's)
> render as textarea, even those which have the parameter choices passed to
> them (they should be a drop-down box). The class being applied to them is
> vLargeTextField.
>
> This is a brand-new Django project, there is no custom css/html and the
> devserver is returning 200 (OK) for all requests.
>
> Your help is appreciated.
> --
> Yours,
> Nikhil Somaru
>
>  --
> 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.
>

-- 
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: Django Forms: Radio buttons and label displayed in the same line?

2011-09-30 Thread Ilian Iliev
Hi, you can do it with CSS styling, custom widget or custom HTML.
Check this link for the custom HTML approach -
http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/
This is not the best one but if you need it only for a single place go for
it.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Fri, Sep 30, 2011 at 11:03 PM, voss  wrote:

> Hello all,
>
> Is it possible to display radio buttons and label in the same line using
> Django forms? Below is an example:
>
> _Choices = (
> (1,'A'),
> (2,'B'),
> (3,'C'),
> )
>
> class QuestionForm(forms.Form):
> question  = forms.ChoiceField(label='Please choose one!',
> choices=_Choices, widget=forms.RadioSelect())
>
> How to display "Please choose one!",  A, B, and C all on the same line?
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/97uo1h7c90IJ.
> 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.
>

-- 
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: __unicode__ and u'%s'?

2011-10-01 Thread Ilian Iliev
Hi,

just ensure that your files and DB connection are using Unicode and
return self.name will be enough.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Sat, Oct 1, 2011 at 10:11 AM, Victor Hooi  wrote:

> heya,
>
> What's the recommended best practice for printing model fields in
> __unicode__?
>
> Currently, I'm using (simply because the Django docs do):
>
> def __unicode__(self):
> return u'%s' % (self.name)
>
> What's the rationale behind using the unicode literal u'%s'? Is it always
> needed, versus just return self.name?
>
> And should I be using .format() instead? Or using something else?
>
> Cheers,
> Victor
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/T1ENoBx4HooJ.
> 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.
>

-- 
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: Django Forms: Radio buttons and label displayed in the same line?

2011-10-01 Thread Ilian Iliev
I am glad I could help.

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org



On Sat, Oct 1, 2011 at 2:07 AM, voss  wrote:

>  Hi eng. Ilian Iliev,
>
> I visited your page (
> http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/)
> and now my code works!
>
> After visiting the page, though, I realized that I'd asked a stupid
> question. What I ended up doing is that I started a Python interactive
> interpreter, printed the form as HTML, copied and pasted it to the template
> , and did some CSS styling as you suggested. It is now working with my
> original views.
>
> Once again, thank you for the great link! It is very helpful!!
>
> cheers,
>
> voss
>
>
> On 9/30/11 3:13 PM, Ilian Iliev wrote:
>
> Hi, you can do it with CSS styling, custom widget or custom HTML.
> Check this link for the custom HTML approach -
> http://ilian.i-n-i.org/django-forms-choicefield-and-custom-html-output/
> This is not the best one but if you need it only for a single place go for
> it.
>
>  --
> eng. Ilian Iliev
> Web Software Developer
>
> Mobile: +359 88 66 08 400
> Website: http://ilian.i-n-i.org
>
> On Fri, Sep 30, 2011 at 11:03 PM, voss  wrote:
>
>> Hello all,
>>
>> Is it possible to display radio buttons and label in the same line using
>> Django forms? Below is an example:
>>
>> _Choices = (
>> (1,'A'),
>> (2,'B'),
>> (3,'C'),
>> )
>>
>> class QuestionForm(forms.Form):
>> question  = forms.ChoiceField(label='Please choose one!',
>> choices=_Choices, widget=forms.RadioSelect())
>>
>> How to display "Please choose one!",  A, B, and C all on the same line?
>>
>> Thank you!
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Django users" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/django-users/-/97uo1h7c90IJ.
>> 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.
>>
>
>
>  --
> 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.
>
>
>  --
> 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.
>

-- 
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: effective adding records in Django site admin

2011-10-04 Thread Ilian Iliev
Hi,

you can always create custom admin page for your models by extending
the default admin.


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Oct 4, 2011 at 8:01 AM, veva...@yandex.ru  wrote:

> Good morning!
> Could you tell me, is there any solution to add several records?
> 1) Now we can click Add, this gives us an empty version of the edit
> page. I believe it is comfortable to have a Copy button, clicking Copy
> would give us a page with a copy of a previuosly selected record, we
> could edit several fields in it and save a new record.
> 2) One more comfortable tool, I believe, would be 2-dimensional form
> for group addings records: rows corresponds to one field, columns to
> another, cells to third. Saving such a form would create several
> records, one for every filled cell.
> May be such solutions are exist ? If not, could you give me any
> advice?
> Thank you very much!
>
> --
> 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.
>
>

-- 
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: Randomly clearing database tables

2011-10-04 Thread Ilian Iliev
Hi,

this sounds like a bad configuration of the tests database.
Is it possible that your test are clearing your database?
Have you made some special test configuration?

-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

On Tue, Oct 4, 2011 at 5:11 PM, msbuck  wrote:

> Twice now, I have had most of my django tables cleared from my
> database including my app tables. Obviously I need to track this down.
> In addition to the two tables created by my app, the AUTH_USER,
> AUTH_USER_USER_PERMISSIONS and DJANGO_ADMIN_LOG are cleared. The
> AUTH_PERMISSION, DJANGO_CONTENT_TYPE, and DJANGO_SESSION tables were
> not cleared. Just to be clear, the tables still exist, there just
> isn't any data in them.
>
> I am using Eclipse with the PyDev plug-in to start the development
> server. I also run my tests from Eclipse. I am using the development
> server and connecting to an Oracle database. Immediately before this
> happened, I was killing and restarting the development server while
> working on an implementation problem (I was trying to get pdf
> generation working). My app is fairly simple ... two tables, one has a
> foreignKey to the other. I have written Django tests which use a
> fixture to feed in data.
>
> The only theory I have so far is that somehow the test framework's
> clean-up code gets executed. I've looked a little at the testing
> framework code but haven't gotten very far to see if this is a
> plausible theory.
>
> This is a rare occurrance (the other time this happened was a month
> ago). Our group is new to Django so this is a rather upsetting
> situation and makes people more reluctant to try it.
>
> Any help or thoughts are appreciated.
>
> --
> 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.
>
>

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

2011-12-13 Thread Ilian Iliev
Or you can change your field to IntegerField instead of CharField if you
are planning to have only Integer
values for the choices.


-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org


On Tue, Dec 13, 2011 at 9:53 AM, Mike Dewhirst wrote:

> On 13/12/2011 5:21pm, kenneth gonsalves wrote:
>
>> On Tue, 2011-12-13 at 17:16 +1100, Mike Dewhirst wrote:
>>
>>> THINGS = ( (0, 'Thing Zero'),
>>> (1, 'Thing One'), )
>>>
>>
>> what happens when you do:
>>
>> THINGS = ( ('0', 'Thing Zero'),
>> ('1', 'Thing One'), )
>>
>
>
> By golly it worked! Must have missed that in the docs.
>
> Thanks Kenneth
>
> Mike
>
>
> --
> 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+unsubscribe@**
> googlegroups.com .
> For more options, visit this group at http://groups.google.com/**
> group/django-users?hl=en<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-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: Multi widget?

2011-01-03 Thread Ilian Iliev
Two widgets to one field? Can you specify this little bit more?

On Mon, Jan 3, 2011 at 12:29 PM, robos85  wrote:

> Hi,
> what I want to do, is to add 2 widgets to 1 field. So far I have:
>
> content =
> forms.CharField(widget=forms.Textarea(attrs={'class':'add_editor'}),)
>
> But I also want to add some medi to it (tinymce .js files). How can I do
> that?
>
>  --
> 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.
>



-- 
eng. Ilian Iliev
Web Software Developer

Mobile: +359 88 66 08 400
Website: http://ilian.i-n-i.org

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