maybe something like this...
class Employee(models.Model):
# your employee model fields here, no FKs to Contact or
Assignment models
...
class EmployeeAssignment(models.Model):
active = models.BooleanField() # I added this
employee = models.ForeignKey(Employee)
...
class
hi,
is there any advantage or disadvantage or best practices in forming
urls? like which set are much better?
domain/employee/1
domain/edit_employee/1
domain/inactive_employee/1
or
domain/employee/1
domain/employee/1/edit/
domain/employee/1/inactive/
thanks
james
Thanks Mike.
-LJ
On Aug 10, 12:23 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> New to the group, so I thought I'd post my favorite
>
> Django video:http://video.google.com/videoplay?docid=-70449010942275062
> Django
>
New to the group, so I thought I'd post my favorite
Django video: http://video.google.com/videoplay?docid=-70449010942275062
Django book:
http://www.amazon.com/Pro-Django-Development-Done-Right/dp/1590597257/ref=pd_bbs_sr_1/104-7275500-7139960?ie=UTF8=books=1186719760=8-1
Cheers,
Mike
Hi all
I tried out all three for an application that I was writing. This would be used
by
non-computer persons for a wiki thing.
* I liked Markdown syntax as it was very readable. It did not have support for
a
simple table syntax - for that you use normal HTML. Likewise you can insert
HTML
Hi,
On 8/9/07, Collin Grady <[EMAIL PROTECTED]> wrote:
>
> Add an __init__ function to your form that you can pass request to.
>
> def __init__(self, request=None, *args, **kwargs):
> self.request = request
> super(MyForm, self).__init__(*args, **kwargs)
>
> Something like
hi,
On Aug 10, 11:25 am, "Kai Kuehne" <[EMAIL PROTECTED]> wrote:
> On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > hi,
>
> > > def list_filter(request):
> > > """Update session filter"""
> > > # request['filter'] is a hidden field. frankly, I don't know if
> > > this is
hi collin,
On Aug 10, 11:26 am, Collin Grady <[EMAIL PROTECTED]> wrote:
> What do you mean by "get the history" ?
the employee could have new contract & assignment as months goes by.
the employee_contract & employee_assignment tells of their recent
contract & assignment. while the employee
AlrightI'm sorry guys this is taking so long to get figured out.
I'm trying my best. It a lot shorter than when I started and I'm no
longer using any for statements. Here is my view:
def searchresult(request):
if request.method == 'POST':
NOT_PICKED =
What do you mean by "get the history" ?
--~--~-~--~~~---~--~~
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
On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
>
> hi,
>
> > def list_filter(request):
> > """Update session filter"""
> > # request['filter'] is a hidden field. frankly, I don't know if
> > this is really needed.
> > # I added it in case I add another form to the template
> >
Reverse the field order in the form, otherwise not that I'm aware of.
--~--~-~--~~~---~--~~
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
hi,
> def list_filter(request):
> """Update session filter"""
> # request['filter'] is a hidden field. frankly, I don't know if
> this is really needed.
> # I added it in case I add another form to the template
> if request.method == 'POST' and request['filter'] == '1':
>
hi,
On Aug 9, 11:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> He means that you can remove:
>
> employee = models.ForeignKey(Employee)
>
> from your 'EmployeeAssignment' and 'EmployeeContract' models because
> the relationship is already defined in your 'Employee' model. You can
>
Hi,
On 8/10/07, james_027 <[EMAIL PROTECTED]> wrote:
> Hi Kai,
> Could you share you code how your save your filter in session?
Yes:
def list_filter(request):
"""Update session filter"""
# request['filter'] is a hidden field. frankly, I don't know if
this is really needed.
# I added
We have been experiencing fastcgi processes dying.
The error in the lighttpd log is
unexpected end-of-file (perhaps the fastcgi process died): pid: 0
socket: unix:/usr1/local/oper/class.sock
2007-08-09 12:10:33: (mod_fastcgi.c.3215) response not received,
request sent: 641 on socket:
hi,
Are the context processors executed only when you pass a request
context from view to template? The documentation mentions that a
requestcontext could accept an optional argument which is a context
processor, is it the same as putting the context processor in the
context processor settings
I'm watching on some light markup languages that can be used in Python
- what they can and what they can't do. I'm planning to use one in a
"sandbox" on my sites and more or less in other apps with some extra
plugins.
Markdown:
+ simple, easy to understand
+ there is showdown - markdown in JS so
Hi Kai,
>
> Do you mean that the filter works on the first page but
> is lost when you go to another page? If yes:
> I save my filter in a session and filter on each page using
> that filter values (the values that were given to the input fields
> of the filter form). I don't know whether this
I cannot explain it, I was able to solve this problem by deleting
cache of my browser.
Young-Jin
On Aug 9, 12:53 pm, John <[EMAIL PROTECTED]> wrote:
> It would appear to
> Be a problem with your cookie.py
> File.In order for me to help you further I will need
> To see The source of said
Hi Greg,
> myset.add(styles)
You don't need the myset part anymore.
> It's bringing back the right records (not filtered though), however
> they are not visible. Probably because of a list within a list.
Right. I assume that you were using the set idiom to eliminate
duplicate records of
Cool cars, tuning & styling, modified cars, many upgrades...
http://tuning-styling.blogspot.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
A number of people, myself included, have asked this list how the admin
interface's slick javascript many-to-many widget can be used in templates
outside admin. None of the answers given solved the issue for me, but they
did point me in the right direction. After a day of reading the source, I
RajeshD,
I implemented what you said. Here is my attempt:
choice_ids = [c.id for c in y]
styles = Style.objects.filter(sandp__choice__in=choice_ids)
if ('color' in request.POST) and (request.POST['color'] <>
NOT_PICKED):
styles = styles.filter(color_cat=request['color'])
I have run across an issue trying to implement the clean method.
I have 2 fields an annotation type and annotation value. I am trying
to validate that if one
value is entered the other value cannot be blank or empty.
Initially, I tried to implement the clean method at the field level.
The
Try changing this fragment:
for q in y:
styles = Choice.objects.get(id=q.id).style_set.all()
to something like this:
choice_ids = [c.id for c in y]
styles = Style.objects.filter(choice__id__in=choice_ids).distinct()
If that works, you shouldn't need a set or a map to weed out
duplicates.
Ok...I'm looking more into sets. Whenever I do a search for products
under 3' width. This is what I get when I do a 'assert False, myset':
AssertionError at /rugs/searchresult/
set([, , , ,
, , , ])
I don't understand how the 2 entries of '' and '' are getting put into the list.
//
{% if item|in_cart:request %}
--~--~-~--~~~---~--~~
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
Yes, a tag file is a tag library, it does not represent a single tag :)
--~--~-~--~~~---~--~~
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
Add an __init__ function to your form that you can pass request to.
def __init__(self, request=None, *args, **kwargs):
self.request = request
super(MyForm, self).__init__(*args, **kwargs)
Something like that should work to add request to the form, and you
can then use it in
Why did you add _id to your model definition for levelID ? The column
does not have that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
Hello
I've started to use the django.contrib.sitemaps module, and it works
superb for my apps. But, I want to add custom links to it, and not
base it entirely on my django-applications.. for example I want to add
a entry for my contact form. Is it possible to do this without any
major battle
You cannot do that from save() - you need to add a validator for the
admin forms to use, using the validator_list attribute for a field.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post
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
It would appear to
Be a problem with your cookie.py
File.In order for me to help you further I will need
To see The source of said file
John Menerick
Sent from my iPhone
On Aug 9, 2007, at 9:03 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]
> wrote:
>
> Dear all,
>
> I have a problem using
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"
Tim and Nis,
Okay thanks for the help. My view is definitily better now than
before. Here is my new view
def searchresult(request):
if request.method == 'POST':
myset = set()
NOT_PICKED = "---"
y = Choice.objects.all()
Is it possible to run a django web server on a nix box and communicate
with a MS-SQL (2000) database on a Windoz 2003 server. I am looking
for a good python framework, and django seems like it might be the
one, but if it can't do this, that could be a show stopper. From what
I have seen, there is
SESSION_COOKIE_NAME = 'sessionid' # Cookie name. This can be
whatever you want.
SESSION_COOKIE_AGE = 60 * 60 * 24 * 7 * 2 # Age of cookie, in seconds
(default: 2 weeks).
SESSION_COOKIE_DOMAIN = None # A string like
".lawrence.com", or None for standard domain cookie.
Dear all,
I have a problem using mod_python with Django (v 0.95) under apache2
in Ubunu.
I followed all the steps described in the online documentation, but it
did not work.
The followins is how I set up the httpd.conf and error message I got.
httpd.conf:
DirectoryIndex index.php index.html
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
On 8/8/07, Ramdas S <[EMAIL PROTECTED]> wrote:
>
> How do I use the comments framework, so that users can comment on
> comments made by others? The free comments example does not
>
> Is it possible without hacking the comments app?
Ramdas,
Sorry you've received no response.
You'll find that
On 8/9/07, eXt <[EMAIL PROTECTED]> wrote:
>
> Sorry that I'm not exacly on the topic but I'd like to know what is
> current state of newforms-admin. Is it safe to use it in application
> or is it still too early?
I would say it's too early unless you are comfortable fixing bugs and
maintaining
He means that you can remove:
employee = models.ForeignKey(Employee)
from your 'EmployeeAssignment' and 'EmployeeContract' models because
the relationship is already defined in your 'Employee' model. You can
use reverse relations to get the relation instead.
On Aug 8, 10:58 pm, james_027
there's counterpoint, but I don't think its ready yet.
http://code.google.com/p/counterpoint
On 8/9/07, ZebZiggle <[EMAIL PROTECTED]> wrote:
>
>
> I need a good comment/forum library, ideally with Karma/Blocking/
> Voting/etc to integrate with my django project.
>
> I've looked at PHPBB and
Only for biggest fans
http://tuning-styling.blogspot.com/
--~--~-~--~~~---~--~~
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
I would like to know the expire date of the current session. I made this:
--
from django.contrib.sessions.models import Session
session_cookie_name = settings.SESSION_COOKIE_NAME
I need a good comment/forum library, ideally with Karma/Blocking/
Voting/etc to integrate with my django project.
I've looked at PHPBB and vbulletin which are good, but I can't stand
PHP.
Any suggestions?
Anyone interested in making a Django side project for this?
-Z
On 8/9/07, Vincent Foley <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I found a curious problem in my application when I put it into
> production this week: when a models.FloatField is "extracted" from the
> database, its type changes depending on the database. With SQLite in
> development, I got
Hello,
I found a curious problem in my application when I put it into
production this week: when a models.FloatField is "extracted" from the
database, its type changes depending on the database. With SQLite in
development, I got back floats, while on MySQL in production I have
decimals. As
> NO_COLOR = "---"
> styles = Choice.objects.get(id=h.id).style_set.all()
> if ('color' in request.POST) and (request.POST['color'] <> NO_COLOR):
> styles = styles.filter(color_cat=request['color'])
> for u in styles:
> dict[u] = u
>
>
>
> I did notice that whenever I
On 8/9/07, Chris Green <[EMAIL PROTECTED]> wrote:
>
> 1) initial_data has bitten me not realizing it was synced in
> production each time. I think that initial_data should only get
> inserted if you have an empty new database. Perhaps things synced
> each time should be called
Hi all,
I'm working with a MySQL legacy DB which was changed.
This was our previous Level table:
+-+---+--+-+-+---+
| Field | Type | Null | Key | Default | Extra |
On 8/9/07, Shawn Allen <[EMAIL PROTECTED]> wrote:
>
> Hey everyone,
>
> I'm about to tackle an API that supports multiple response formats
> using serializers. I realize that the API (as simple as it is) is
> subject to change, but it seems like a totally sensible pattern for
> what I'd like to
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
On Aug 9, 12:01 am, Michel Thadeu Sabchuk <[EMAIL PROTECTED]> wrote:
> Hi guys!
>
> I´m having a problem with a django site, sometimes my server stuck and
> goes down. Just before it happens I receive about 200 traceback
> messages telling me the same error: (1040, 'Too many connections'), I
>
I'm pretty sure that will help you -
http://blog.webfaction.com/tips-to-keep-your-django-mod-python-memory-usage-down
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
Для тестов существуют модули doctest и unittest, попробуй почитать
документацию :)
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to
I would like to use the admin search of the flatpage in my website
template so how can i do that
any help will be appreciated
Thank you in advance
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users"
Greg skrev:
> Nis,
> Thanks for the help. We'll I got my view to work for website visitors
> searching by any combintation of Size, Price, and Color. My code is
> not the most efficient and I wonder how the performance is going to be
> once I add more products and take it off of developmental
Hey All,
I'm trying to create a 'shopping' website, and one of the design
elements that is necessary is that the "Purchase this item" link
changes to a "Remove this item from your cart" link when the item has
been added to the user's Shopping Cart.
When an object is added to the shopping cart,
hi,
I am trying to put a page list for a search result. So far here's what
I've try by using the django.views.generic.list_detail.object_list and
the pagination tag (http://code.djangoproject.com/wiki/PaginatorTag)
and later found out that it won't meet my needs.
def search_employee(request):
> question = models.CharField(max_length=200)
change the above to 'question = models.CharField(maxlength=200)'
There should not be a '_' between 'max' and 'length'.
You should be set now
On 8/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> hi, after hitting
> python
I noticed that item deletion is currently broken. Except for that everything
seems to work for me, even inline editing.
On 9 August 2007 (Thu), eXt wrote:
> Hi
>
> Sorry that I'm not exacly on the topic but I'd like to know what is
> current state of newforms-admin. Is it safe to use it in
hi,
I am trying to do this http://code.djangoproject.com/wiki/PaginatorTag
I have two apps in my projects which are main and manning. I put the
pagination tag code in the main/templatetags/extra_tags.py file. And I
am trying to use the tag from a template in manning/templates/
results.htm. But
Hi Pigletto;
Is there a way that i can see the code you have implemented it will be
great to help me
Thank you in advance;
On Jul 24, 11:27 pm, Przemek Gawronski <[EMAIL PROTECTED]>
wrote:
> > Thanks. Finally I've used PaginatorPag from your link (with some
> > changes) and
> > Sortable
Hi
Sorry that I'm not exacly on the topic but I'd like to know what is
current state of newforms-admin. Is it safe to use it in application
or is it still too early? I have to do some customizations in admin's
widgets and I really don't want to do it with old style forms.
To answer your
Hello,
I need to write form for re-setting user's password:
class SettingsForm(forms.Form):
old_password = forms.CharField(max_length=200, required=False,
widget=forms.PasswordInput(attrs=passw_dict, render_value=False),
label=u'Actual password')
password1 =
OK, I got it.
You can't use the login_decorator to do what I'm trying to do.
I"ve addded one simple line to the form, used the original auth/views.py and
my original method of authentication and it all works fine.
Misread the docs again.
return HttpResponseRedirect('/accounts/login/?next=%s' %
Hi
I'm currently investigating newforms-admin and it looks amazingly
customizable. :) But still I couldn't find the way to use custom forms for
some models or something like that. What I need is to add some custom fields
to some admin form and then to save some additional data to the database
http://airconditioninginfo.blogspot.com/
--~--~-~--~~~---~--~~
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
All the informations about car air conditioners can be found on this
website...
http://car-air-conditioning.blogspot.com/
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group,
72 matches
Mail list logo