[web2py] Re: room booking system with web2py...

2012-02-28 Thread mikech
You should consider having a from and to date as a start, and as stated 
below, split room and reservations into two tables joined by room id.

On Tuesday, February 28, 2012 11:28:46 AM UTC-8, Christoph Ott wrote:
>
> Thank you for the great examples, helped me a lot. 
>
> It's almost working I've got only a few Problems... 
>
> My DB has 3 fields: Room, time, date. 
> Is there any possibility to check if the room already booked? So I 
> can't book a room twice 
> I've found nothing in the book and with google. 
> Can you give me hint what command it can probably work? 
>
>
> Thanks a lot 
>
>
> On 22 Feb., 18:53, Massimo Di Pierro  
> wrote: 
> > Here 
> > 
> > http://web2py.com/appliances 
> > 
> > you can find some reservation systems: hotelroom, restaurant table, 
> > books. 
> > 
> > Hope they are useful. 
> > 
> > Massimo 
> > 
> > On Feb 22, 10:37 am, Christoph Ott  
> > wrote: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > > Hello, 
> > 
> > > first of all I'm a beginner with web2py... I have to realize 
> aroombooking 
> > > system with web2py for my study. 
> > > For now I've created a table called db.bookings this table got the 
> values: 
> > > id, user,room, time, date... (theroomare from an other table called 
> > > db.room) 
> > 
> > > To allow the user to check if theroomis available on a certain time I 
> > > wanted to make a field where he can choose aroomand get the bookings 
> for 
> > > thisroomdisplayed... I've tried a lot with crud.select but I didn't 
> found 
> > > any useful examples with google and in the web2py book 
> > > (http://web2py.com/book/default/chapter/07#CRUD) isn't much 
> explained... 
> > 
> > > can anyone give me a hint or just a good site with some examples how I 
> > > could realize this function. 
> > > Thanks a lot for reading... 
> > 
> > > bye



[web2py] Re: room booking system with web2py...

2012-02-28 Thread Cliff
To start, you really need two tables.  This is a very simple example.
Look in the simple examples code for dogs and owners to get the whole
story about one-to-many relationships.  Also there is more information
in the on-line manual in the database chapter.

db.define_table('rooms',
  Field('room_number')
)

db.define_table('bookings',
  Field('room_id', db.rooms),
  Field('booking_start', 'datetime'),
  Field('booking_end', 'datetime'),
)

Look in the booking example code, I'm sure you will see something
similar...

I would also point you to the booking examples to see how double
bookings are prevented.

On Feb 28, 2:28 pm, Christoph Ott  wrote:
> Thank you for the great examples, helped me a lot.
>
> It's almost working I've got only a few Problems...
>
> My DB has 3 fields: Room, time, date.
> Is there any possibility to check if the room already booked? So I
> can't book a room twice
> I've found nothing in the book and with google.
> Can you give me hint what command it can probably work?
>
> Thanks a lot
>
> On 22 Feb., 18:53, Massimo Di Pierro 
> wrote:
>
>
>
>
>
>
>
> > Here
>
> >http://web2py.com/appliances
>
> > you can find some reservation systems: hotelroom, restaurant table,
> > books.
>
> > Hope they are useful.
>
> > Massimo
>
> > On Feb 22, 10:37 am, Christoph Ott 
> > wrote:
>
> > > Hello,
>
> > > first of all I'm a beginner with web2py... I have to realize aroombooking
> > > system with web2py for my study.
> > > For now I've created a table called db.bookings this table got the values:
> > > id, user,room, time, date... (theroomare from an other table called
> > > db.room)
>
> > > To allow the user to check if theroomis available on a certain time I
> > > wanted to make a field where he can choose aroomand get the bookings for
> > > thisroomdisplayed... I've tried a lot with crud.select but I didn't found
> > > any useful examples with google and in the web2py book
> > > (http://web2py.com/book/default/chapter/07#CRUD) isn't much explained...
>
> > > can anyone give me a hint or just a good site with some examples how I
> > > could realize this function.
> > > Thanks a lot for reading...
>
> > > bye


[web2py] Re: room booking system with web2py...

2012-02-28 Thread Christoph Ott
Thank you for the great examples, helped me a lot.

It's almost working I've got only a few Problems...

My DB has 3 fields: Room, time, date.
Is there any possibility to check if the room already booked? So I
can't book a room twice
I've found nothing in the book and with google.
Can you give me hint what command it can probably work?


Thanks a lot


On 22 Feb., 18:53, Massimo Di Pierro 
wrote:
> Here
>
> http://web2py.com/appliances
>
> you can find some reservation systems: hotelroom, restaurant table,
> books.
>
> Hope they are useful.
>
> Massimo
>
> On Feb 22, 10:37 am, Christoph Ott 
> wrote:
>
>
>
>
>
>
>
> > Hello,
>
> > first of all I'm a beginner with web2py... I have to realize aroombooking
> > system with web2py for my study.
> > For now I've created a table called db.bookings this table got the values:
> > id, user,room, time, date... (theroomare from an other table called
> > db.room)
>
> > To allow the user to check if theroomis available on a certain time I
> > wanted to make a field where he can choose aroomand get the bookings for
> > thisroomdisplayed... I've tried a lot with crud.select but I didn't found
> > any useful examples with google and in the web2py book
> > (http://web2py.com/book/default/chapter/07#CRUD) isn't much explained...
>
> > can anyone give me a hint or just a good site with some examples how I
> > could realize this function.
> > Thanks a lot for reading...
>
> > bye


[web2py] Re: room booking system with web2py...

2012-02-22 Thread Massimo Di Pierro
Here

http://web2py.com/appliances

you can find some reservation systems: hotel room, restaurant table,
books.

Hope they are useful.

Massimo

On Feb 22, 10:37 am, Christoph Ott 
wrote:
> Hello,
>
> first of all I'm a beginner with web2py... I have to realize a room booking
> system with web2py for my study.
> For now I've created a table called db.bookings this table got the values:
> id, user, room, time, date... (the room are from an other table called
> db.room)
>
> To allow the user to check if the room is available on a certain time I
> wanted to make a field where he can choose a room and get the bookings for
> this room displayed... I've tried a lot with crud.select but I didn't found
> any useful examples with google and in the web2py book
> (http://web2py.com/book/default/chapter/07#CRUD) isn't much explained...
>
> can anyone give me a hint or just a good site with some examples how I
> could realize this function.
> Thanks a lot for reading...
>
> bye