Re: django formset

2017-04-30 Thread vicalloy
I think you can select the field by class. Or $('name$=-fieldname')
On Fri, 28 Apr 2017 at 19:15 shahab emami  wrote:

> hello
> i search for my question on google and this group by i couldn't find the
> answer.
> maybe I am not a good searcher.D
>
> i have a formset.
> there is a field for birth date in my form then as you know there are a
> few birth date field in my formset. I use this jquery plugin to add form
> dynamically:
>
> https://github.com/elo80ka/django-dynamic-formset
>
> every thing is good until now.  but because I have a date field in my form
> i want to
>
> use this jquery plugin :
>
> Datepicker | jQuery UI
>
>
>
> then user can select date from this calendar .
> but i don't now the id of date field in the form.
> how can i select it with jquery  when i don't now the id of it?
> I tried to find it with inspect element but i understood the id is
> different in every form.
> if you can tell me the idea to solving this problem or
> introduce somewhere that i can read about this i will be thankful.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/26a172d0-cd75-45e3-aa0c-f795dd40d754%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
-- 
Blog: https://haoluobo.com 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAATL4yxHNnBESuaFRW4skObCkjTpuBLe3%2B%2B_TD%3DbmOjjCp5M6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


A new command(create_app) for django, auto generate CRUD files and methods(view/urls/template)

2009-03-02 Thread vicalloy

== Introduce ==
A command(create_app) for django, auto generate CRUD file and
method(view/urls/template).
you can download from:
http://vik.haoluobo.com/blog/wp-content/uploads/2009/03/hidjangoen.zip
== how to use ==
Put django_extensions folder to you project app directory, and add
django_extensions to INSTALLED_APPS.
run command, manage.py create_app 
== demo ==
hidjango is a demo for this command(create_app)。
 1. run "manage.py create_app blog" to create a app named blog.
 1. open \hidjango\settings.py, and add hidjango.blog to INSTALLED_APPS.
 1. run "manage.py syncdb" to initialize db.
 1. open \hidjango\urls.py, and add (r'^',
include('hidjango.blog.urls')), (note: this url map has added, no need
to do again).
 1. run "manage.py runserver" to start django's develop server.
 1. open exploere and input http://127.0.0.1:8000/.
== note ==
 * some code from
django-command-extensions(http://code.google.com/p/django-command-extensions
)。
 * this command is simple now, need to add some option.
== template for create_app ==
=== files ===
{{{
/django_extensions/conf/app_template/
|~templates/
| `~{{ app_name }}/
|   |-base.html
|   |-edit.html
|   |-list.html
|   `-new.html
|~templatetags/
| `-__init__.py
|-__init__.py
|-admin.py
|-forms.py
|-models.py
|-tests.py
|-urls.py
`-views.py
}}}
=== views.py ===
{{{
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from django.shortcuts import render_to_response, get_object_or_404
from django import template
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse

from forms import {{ Model }}Form
from models import {{ Model }}

def list(request, template_name = '{{ model }}/list.html'):
return render_to_response(template_name, {
"{{ model }}s": {{ Model }}.objects.all(),
}, context_instance=template.RequestContext(request))

def new(request, form_class={{ Model }}Form, template_name = '{{ model
}}/new.html'):
if request.method == "POST":
form = form_class(request.POST)
if form.is_valid():
{{ model }} = form.save(commit=False)
{{ model }}.save()
return HttpResponseRedirect(reverse("{{ model }}_list"))
else:
form = form_class()
return render_to_response(template_name, \
{ "form": form }, \
context_instance=template.RequestContext(request))

def edit(request, id, form_class={{ Model }}Form, template_name="{{
model }}/edit.html"):
{{ model }} = get_object_or_404({{ Model }}, id=id)
if request.method == "POST":
form = form_class(request.POST, instance={{ model }})
if form.is_valid():
{{ model }} = form.save(commit=False)
{{ model }}.save()
return HttpResponseRedirect(reverse("{{ model }}_list"))
else:
form = form_class(instance={{ model }})
return render_to_response(template_name, {
"form": form,
"{{ model }}": {{ model }},
}, context_instance=template.RequestContext(request))

def delete(request, id):
{{ model }} = get_object_or_404({{ Model }}, id=id)
{{ model }}.delete()
return HttpResponseRedirect(reverse("{{ model }}_list"))
}}}

--~--~-~--~~~---~--~~
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: mptt usage

2009-02-03 Thread vicalloy

I think mptt have good doc.
http://code.google.com/p/django-mptt/
mptt just a set of function to build tree efficient.

2009/2/3 Muslu Yüksektepe :
> i did try it too but i deleted.
>
>
> 2009/2/3 new_user 
>>
>> Hi, everyone.
>>
>> Recently I've installed mptt app on my project. But I cannot find out
>> how to use it. Should I use it's functions manually, or could I use
>> admin interface to order my models in tree structure?
>>
>> Thx in advance.

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



Hava any way to load django's app dynamic

2008-09-27 Thread vicalloy

Just like trac's plugin, I can upload a app and auto load 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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~--~~~~--~~--~--~---




Re: ANNOUNCE: Django search with Lucene.

2008-07-15 Thread vicalloy
2008/7/15, Spike^ekipS <[EMAIL PROTECTED]>:
>
>
> Hi, django users and developers.
>
> I'm happy to let you know my django application, Django search with
> Lucene(DSL). I try
> to tighly integrate the Lucene with Django, so I find the way to use
> lucene easily in Django.
>
> Django search with Lucene(DSL) supports,
>   * indexing object automatically when object is saved(update, delete
> also applied in index)
>   * search indexed document by django filtering expression
>>>> Person.objects_search.filter(name="spike", age=10)
>   * indexing the existing object  like this,
>>>> Person.objects.filter(pk__gte=100).create_index()
>   * etc.
>
> Make a story short, this is examples,
> ===
> person = Person.objects.create(
> name_first="Spike",
> name_last="Ekips",
> )
>
> person.name_first = "New Spike"
> person.name_last = "New Ekips"
> person.save()
> >>>
> Person.objects.objects_search(name_first="Spike").exclude(name_last="ekips").order_by("-time_added")
> >>>
> Person.objects_search(name_first__icontains="pike").order_by("-time_added")
> >>> Person..objects_search(
> time_added__lte=(datetime.datetime.now() -
> datetime.timedelta(days=10))
> )
> >>> result = Person.objects_search(
> time_added__lte=(datetime.datetime.now() -
> datetime.timedelta(days=10))
> )
>
> >>> for i in result :
> print i.get("name_first")
> print i.name_first
> print i.pk
> print i.get("__uid__")
> print i.get("name_last")
> ===
> object automatically indexed when saved and analyzed and we can digg
> the index db with django model filtering expression.
>
> For more information, visit the project page,
> http://code.google.com/p/django-search-lucene/
> or see the short document at
> http://django-search-lucene.googlecode.com/files/django-search-lucene.pdf
> .
>
> Thanks.
>
> I try to integrated django with PyLucene before,and I find it could't work
with fcgi.
Pylucen in thread must
import PyLucene.PythonThread as thread。
have you test it for fcgi?

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