Re: How to add a javascript calendar to date textboxes

2007-08-08 Thread Noam Raphael

It looks great, thanks!

Noam

On 8/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> I've done that, and it's not hard, but there's quite a few good js
> datepickers out there, and on my most recent one I used one of
> those gives me a bit more control over how I want it to look on
> the public-facing part, and I'm not making 5 http calls to do it.
>
> Here's the one I went with:
> http://www.frequency-decoder.com/demo/date-picker-v2/
>
> And again, it's just adding a class to the input.
>
> On Aug 7, 5:45 pm, Noam <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I wanted to add a javascript calendar (like the one you have in
> > Django's admin) to a date textbox in a form.
> > I found this post, which says how to do 
> > it:http://groups.google.com/group/django-users/browse_frm/thread/3328829...
> >
> > I thought I might share with you how I did it - I think that it's
> > simpler than what's described there.
> >
> > To add the calendar, you only need to:
> >
> > 1. Make sure that the admin interface is enabled.
> > 2. Add this to the  element in your HTML template:
> >
> >  >
> > 
> > 
> > 
> > 
> >
> > Note that this assumes that your admin media sits in "/media". If it's
> > not the case, you need to replace "/media" with your admin media path.
> >
> > 3. Add an attribute class="vDateField" to your 
> > element.
> > If you're using the newforms library, you can do it by using a line
> > like this in your form definition:
> > date =
> > forms.DateField(widget=forms.TextInput(attrs={'class':"vDateField"}))
> >
> > Have a good day,
> > Noam
>
>
> >
>

--~--~-~--~~~---~--~~
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: ANN: DMigrate - A Django Database Migration Tool

2007-07-18 Thread Noam Raphael

On 7/18/07, Ben Ford <[EMAIL PROTECTED]> wrote:
> Just out of interest have you explored using SQLAlchemy directly with the 
> django model..? I mean mapping the SA Table onto the django Model..? I had a 
> play with that a while back and it seems a very straightforward way of 
> achieving SA - django integration...
> Ben
>

No, I haven't tried it. In the script DMigrate creates, there are SA
classes which interact with the source database, and Django classes
which interact with the destination database. They don't touch one
another.

Noam

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



ANN: DMigrate - A Django Database Migration Tool

2007-07-17 Thread Noam Raphael

Hello,

I'm happy to let you know about DMigrate. DMigrate is a simple tool
which lets you migrate Django databases easily. With DMigrate:
 * You don't have to use any SQL.
 * You don't need to learn any command for changing database structure.
 * You can do whatever transformations you like.
 * You can do the migration as many times as you like, until you get
it right, without fear of data loss.

There's one drawback: DMigrate is not as efficient as other migration
tools, which means that it's probably suitable only for small to
medium sites.

The idea is simple: DMigrate writes for you a script which takes all
the data from the current database and copies it to a newly created
database. You then edit the script to make any transformations you
like on your data, and then run the script. If you're not satisfied
with the result, you re-edit the script, and run it again. When you
are satisfied, make your website use your newly created database.
That's all!

DMigrate can also be used to migrate your data from one database
engine to another.

For more information about DMigrate, including examples, look at
http://code.google.com/p/dmigrate/wiki/Help

I would really like to hear what you think about it (especially if
it's good things...) Tell me!

Have a good day,
Noam

--~--~-~--~~~---~--~~
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: An idea on DB migration

2007-07-05 Thread Noam Raphael

On 7/6/07, SmileyChris <[EMAIL PROTECTED]> wrote:
>
> If you haven't already, check out http://www.aswmc.com/dbmigration/
>
> It's quite a good solution for migration.
> I've been writing a wrapper on top of that to handle auto-migration,
> which I'm mostly happy with. Just have to tie some loose ends and I'll
> put it up somewhere to share.

Thanks for the link!

My main concern about this method: I have to use SQL. I don't really
understand SQL, and I'm very happy to let Django write it up for me.
When I write it, I'm never sure if it will exactly fit what Django
expects, or if it will be efficient (Should I define some columns as
indices? As relations?) If my method was available, I wouldn't have to
write a single line of SQL, and I would still be able to do whatever I
want.

Have a good day,
Noam

--~--~-~--~~~---~--~~
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: An idea on DB migration

2007-07-04 Thread Noam Raphael

On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
> The problem I see is maintaining the generated file.  This process will often
> start before the target system is stable, so as soon as you start making 
> changes
> to the target model, the converter will need to be updated too.  If the
> transformation formulas are part of one of the models, then there isn't 
> anything
> to keep in sync.
>
You don't have to maintain the generated file. After you've updated
the database, there's no need to keep it. When you want another update
to the database, you create a new file and change there what you want.

>
> >
> >> Also, along the lines of slow... you are going to love this one: how about
> >> making it use the web server as the source which would allow migrating 
> >> between 2
> >> servers where http is the only exposed protocol?   it would also take care 
> >> of
> >> migrating between systems where I don't have both db stacks installed on 
> >> one box
> >> - consider win/mssql -> linux/SqlLite.  yeah yeah, django/mssql doesn't 
> >> exist
> >> yet... but it makes a good example :)
> >
> > I think that for this you can use "./manage.py dumpdata" and
> > "./manage.py loaddata". See
> > http://groups.google.com/group/django-users/msg/02f5447f41207a65
>
> But then you don't get any of the nifty transformations which is kinda the 
> point
> of your idea.
>
Well, you can separate nifty transformations (which will be done on
one computer) and system migration.

Noam

--~--~-~--~~~---~--~~
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: An idea on DB migration

2007-07-04 Thread Noam Raphael

On 7/4/07, nick feng <[EMAIL PROTECTED]> wrote:
> The django has already provided the way to use SQL, I don't think this is 
> needed.

Well, I'm not a SQL expert, and I don't feel comfortable with adding
fields manually. I'm never sure whether my SQL statement is what
Django would have issued when creating the table - not to mention
relations and indices. If I don't need to know SQL to use Django, why
should I need to learn SQL to modify my models?

Noam

--~--~-~--~~~---~--~~
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: An idea on DB migration

2007-07-04 Thread Noam Raphael

On 7/4/07, Carl Karsten <[EMAIL PROTECTED]> wrote:
>
> I don't like the "edit the file" part.  I can think of 2 alternatives:
>
> 1. add an attribute to one/both of the models.  something like
>
> class Book(models.Model):
>  name = models.CharField(blank=True, "migrate_to"="book_name" )
>
> 2. a 3rd file that defines those kind of translations, which might be about 
> the
> same by just subclassing the existing models.
>
> class Book(models.Book):
>  book_name = Book.name()
>
> (I am totally winging it here, so forgiveme if my brain storm has some 
> turbulence.)
>

What I like about my idea is that you don't need to learn new syntax
for migration. And syntax like this will never be enough - for
example, how would you convert a field with a full name into two
fields, the first name and last name? Using my idea, it will simply
be:

n.first_name, n.last_name = o.name.split()

(Well, you would have to add some error handling, but it won't be a
lot more complicated.)

> Also, along the lines of slow... you are going to love this one: how about
> making it use the web server as the source which would allow migrating 
> between 2
> servers where http is the only exposed protocol?   it would also take care of
> migrating between systems where I don't have both db stacks installed on one 
> box
> - consider win/mssql -> linux/SqlLite.  yeah yeah, django/mssql doesn't exist
> yet... but it makes a good example :)

I think that for this you can use "./manage.py dumpdata" and
"./manage.py loaddata". See
http://groups.google.com/group/django-users/msg/02f5447f41207a65

Noam

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