The more simplest way is to set UNIQUE to the column of the database you
want it to stay unique. That way a duplicate record will not be inserted
and the insert query will return an error stating "record already exist".
Check how to set your required column(s) "unique". This way is the fastest
Thank you Villas, you've been much helpful
On Thursday, July 23, 2020 at 2:05:49 PM UTC+2, villas wrote:
>
> As you've discovered, random doesn't work in this context. Make an array
> of class attendee numbers and then allocate the class which has the fewest
> students.
>
>
> On Thursday, 23
As you've discovered, random doesn't work in this context. Make an array
of class attendee numbers and then allocate the class which has the fewest
students.
On Thursday, 23 July 2020 12:50:00 UTC+1, mostwanted wrote:
>
> Well the whole concept behind this application was that allocation of
Well the whole concept behind this application was that allocation of
spaces in time, days & class rooms should be automatic, the user should
just select the lecturer, the subject & the period the subject takes
(Double session=2hrs, Single session=1hr) from there after the user submits
that inf
Suggestion:
Your idea of overriding the user's selections with random choices seems
strange.
Why not ask the user to specify a date and then show him which classes are
available nearest that date/time?
He can then choose one of those.
On Wednesday, 22 July 2020 19:04:27 UTC+1, mostwanted wrot
After a form has failed to save because that information already exists in
the database I wanna try & alter the value that determines a day where the
info is saved in the db for the form to be saved in a different day that
does not contain similar form details currently attempting to be saved an
On Tuesday, July 21, 2020 at 3:16:29 AM UTC-7, villas wrote:
>
> Your my_validator function iterates through the whole table. This is OK
> when you have a few records, but very inefficient if you have
> thousands/millions. Why not simply query the table? Something like this...
>
> def my_va
Impressive outlook Villas, thank you.
On Tuesday, July 21, 2020 at 12:16:29 PM UTC+2, villas wrote:
>
> Your my_validator function iterates through the whole table. This is OK
> when you have a few records, but very inefficient if you have
> thousands/millions. Why not simply query the table?
Your my_validator function iterates through the whole table. This is OK
when you have a few records, but very inefficient if you have
thousands/millions. Why not simply query the table? Something like this...
def my_validator(form):
if db((db.lecture.id == form.vars.id) & (db.lecture.lec
Thank you
On Saturday, July 18, 2020 at 10:16:09 PM UTC+2, Dave S wrote:
>
>
>
> On Friday, July 17, 2020 at 2:38:43 AM UTC-7, mostwanted wrote:
>>
>> Hey Dave, thanks for replying,
>> This below is what I tried & it seems to be working, idont know if the
>> best solution but please help e where
On Friday, July 17, 2020 at 2:38:43 AM UTC-7, mostwanted wrote:
>
> Hey Dave, thanks for replying,
> This below is what I tried & it seems to be working, idont know if the
> best solution but please help e where u think I could improve it:
>
> def my_validator(form):
> details=db(db.lecture)
Hey Dave, thanks for replying,
This below is what I tried & it seems to be working, idont know if the best
solution but please help e where u think I could improve it:
def my_validator(form):
details=db(db.lecture).select()
for d in details:
if form.vars.lecturer==d.lecturer.id an
On Thursday, July 16, 2020 at 7:56:47 AM UTC-7, mostwanted wrote:
>
> I have created a calendar that assigns lesson_times & class_rooms
> randomly. So far it has been working properly until a conflic arose, one
> lecturer being assigned 2 classes at the same time, another one one
> class_room
13 matches
Mail list logo